Hello,

  allow me to highlight Davor Cengija's Java.Net blog
story titled "Luxor Localization" that I stumbled on
while browsing javablogs.com.

  Davor writes:

  Luxor is a useful tool: it really increases your
productivity. Usage is simple: define your user
interface in an XML file, add some Java meat around it
and you have it running. Everything's nice and clean
as long as you have only one human language to
support.

   ...

  As soon as you introduce another language, you have
problems. As shown in the XML snippet above, Luxor
uses label, value and other attributes to assing the
text to be displayed in the GUI. Unfortunatelly, those
text values are hard coded and your only option is to
provide different set of XML definitions for each
human language you want to support. Please note that
noone said 'different XML files', but 'different XML
definitions', and that's the place where XSLT jumps
in.

  The approach we took was to translate XML
definitions on the fly, using a simple XSLT
stylesheet. To achieve that, we needed to do four
things: 1. Edit XML definitions and add a custom
attribute to those elements you want to translate, 2.
Create an XSLT stylesheet which will transform XML
definitions, 3. Create your translation file in the
language of your choice and 4. Edit Luxor's code and
glue it all together.

  Full story @ http://weblogs.java.net/pub/wlg/1141

  Let us know what you think about Davor's approach.
How do you handle internationalization in your XUL
toolkit?  I invite you to join us and post your
comments to xul-talk.

   - Gerald

PS: Davor's statement about hard-coded labels and
values is only partly true. More than a year ago I
started work on adding internationalization (i18n)
support using locale-sensitive string tables (property
like name-value pairs) so you no longer need to
hard-code your labels or values in your XUL documents
but instead you can use Velocity-style keys/variables
(e.g. $mybutton.label and so on). See
http://cvs.sourceforge.net/viewcvs.py/luxor-xul/ramses-intl
for an example.  


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
xul-announce mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xul-announce

Reply via email to