On 05/06/2011 11:49 PM, Andy Black wrote:
>
> I was able to figure out what I was doing wrong in getting strings in
> the CSS (and commands) to work. I figured out how to get the build.xml
> file to include the .properties files in the .jar file and it now works
> very nicely. So all this is quite encouraging.
>
> This just leaves the Schematron question.
In XXE, the only objects which have been designed to be localized are:
extensions written in Java (e.g. commands), configuration files, XSLT
stylesheets.
There is no easy method allowing to localize CSS stylesheets. What you
have done is a bit extreme. The example found in the Developer's Guide,
was, well, just an example. It's not really meant for production use.
It's the same for Schematron. There is no easy method allowing to
localize Schematron. If you are really motivated you'll have to find
such method by yourself.
May be (not tested) creating an XML file containing messages and
referencing a message from your schematron using something like:
<sch:value-of
select="document('xling-paper-config:messages.xml')/messages/message[name='warning23'])"/>
The XML catalog of your configuration should contain:
<rewriteURI uriStartString="xling-paper-config:" rewritePrefix="." />
You have to do this because our document() function cannot resolve a
relative URL against the URL of your schematron.
On 05/06/2011 05:17 PM, Andy Black wrote:
>
> As for how to localize, I see that there were two things that I was not
> understanding:
>
> 1. One uses the .properties file of the reference language to
> effectively define the IDs. I had thought the IDs were supposed
> to come from the configuration files. Apparently, when rendering
> menus, file/new templates, and element templates, XXE compares the
> strings in the configuration files against the strings on the
> right hand side of the equals sign in the reference .properties
> file. It then uses the ID (the left hand side of the equals sign)
> to look up the replacement string in the .properties file of the
> locale of the UI.
That's right.
> 2. The <translation> element refers only to the .properties file of
> the reference language.
>
> Perhaps these are familiar concepts to those who are more familiar with
> how Java allows for localization. Obviously, this was all new to me.
Configuration files, CSS stylesheets, Schematron schemas are not Java
programs. There is no standard method for localizing these objects.
>
> I have now had success in getting some localization for menus, file/new
> templates, and element templates (I'll still have to get my strings
> translated by someone who knows the target language well). Thanks, that
> is encouraging to me.
>
> For strings in the CSS configuration and strings in commands, I assume
> I'll need to write some custom Java a la the nice example in the
> developer's guide for how to localize CSS strings (part of the
> StyleSheetExtension class). I've done that and discovered apparently I
> do not know how to tell it precisely where my .properties files are. In
> the static ResourceBundle getMessages(String lang)method, I have
>
> messages = ResourceBundle.getBundle("localizations/XLingPap", new
> Locale(lang));
>
> assuming that the "current directory" would be where I have my
> XLingPap.xxe file. (I have my XLingPap_en.properties and
> XLingPap_es.properties files in the localizations directory). This,
> however, does not work. I get a MissingResourceException with a message of
>
> Can't find bundle for base name localizations/XLingPap, locale es
>
> Is there anything you could suggest I try to overcome this?
>
> Finally, I'm wondering how to localize my Schematron messages. I see
> that some have suggested a way
> (http://www.w3.org/TR/2008/WD-sml-20080114/#Localization_of_Messages),
> but my experiments with this using XXE failed to work. How, if it is
> even possible, does one localize Schematron messages in XXE?
>
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support