08 February 2011

Strangeness(?) with RAP i18n

Just made my first attempt to add multi-language support to my RAP app. I created a default bundle for English and then one for German.

messages.properties
messages_de.properties

My browser was setup to accept German and English in that order so I got the German texts. I then swapped the language prefs in the browser to put English first but I still got German. I tried closing the browser, restarting the app etc. but I still got German. Finally, I added a new bundle, messages_en.properties and now I get English.

Is this the correct behaviour? It is not what I expected but I guess nothing is known about the default bundle and the browser is saying that German is acceptable (if not preffered), Hmmm...


UPDATE
the explanation is as follows:

your VM is set to German, right? What happens is that the
Browser asks for English, but RWT does not find a messages_en.properties
file. So it tries the default locale, in your case German and Bingo!
there is a messages_de.properties file. So you get German. If you want to
have English as your fallback, set your VM to English. Does this explain
the behavior?

Regards, Ralf

--
Ralf Sternberg

No comments:

Post a Comment