initial i18n work is complete

Joseph Marques jmarques at redhat.com
Fri Nov 19 15:37:50 UTC 2010


The initial work for internationalizing the web application is now 
complete.  You can see the tokens with their values in:

...coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties

If you want to add translations for other languages, all you need to do 
is add another file in the same directory suffixed with the locale like so:

...coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties

Once the translation is complete, go to CoreGUI.gwt.xml and enable that 
localization in the build:

<extend-property name="locale" values="de" />

Keep in mind that due to the fact that we're using the static string 
initialization technique [1], this will lengthen the overall build time 
when you do this.  If you were previously compiling two versions of the 
application - one for FF, one for WebKit - this will now double the 
number of compilation permutations - one for FF 'en', one for FF 'de', 
one for WebKit 'en', and one for WebKit 'de'.

Once built, you can access the translated web application by going to:

...CoreGUI.html?locale=de

Keep in mind that when you switch locales, it's effectively loading an 
entirely different application because the translated strings are 
compiled directly into each permutation separately, thus you'll 
experience the initial download/startup time again).  There are other 
ways to invoke the correct localized application, such as <meta> tags 
and property providers [2], but we can cross that bridge a bit later.

Note: the Messages*.properties files should use UTF-8 encoding, which 
will allow Unicode characters to be used directly in the properties.  
I've already added the necessary <meta> tag to CoreGUI.html, to support 
rendering correctly:

<meta http-equiv="content-type" content="text/html;charset=utf-8" />

If you have any questions, feel free to ping back.

-joseph

[1] - 
http://code.google.com/webtoolkit/doc/latest/DevGuideI18n.html#DevGuideStaticStringInternationalization
[2] - 
http://code.google.com/webtoolkit/doc/latest/DevGuideI18nLocale.html#LocaleProperty 



More information about the rhq-devel mailing list