Author |
Message |
03/01/2008 11:28:00
|
hilka
Power User
Joined: 23/11/2007 09:00:08
Messages: 191
Offline
|
Hello,
I tried to bring up the default screens using your I18n description combined with our login mechanism.
What I did:
I added a new managed bean to faces-config.xml exactly the way as described in the documentation.
After login to our application, i set the locale in FacesContext.getCurrentInstance().getViewRoot().setLocale() to a new Locale according to our login language.
I checked the yesno.jsp file and inside the text points to the binding as described in the documentation: #{eclnti18n.YESNOPopup_yes}
As far as I can see, the following should happen:
if the locale is "de" the resource bundle named like ..._de... is used,
if the locale is "en" the resource bundle named like ..._en... is used, which does not exist, therefore the default (without locale and english texts) should be used.
But in our application, the german translation is displayed, no matter if we login in english or in german.
Is there another place where the locale should be set? Another mechanism to use?
Tobias
|
|
|
04/01/2008 07:47:42
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5521
Offline
|
Hi Tobias,
yes, your are right - and I am totally confused with ResourceBundle (currently...).
To solve the problem: you need to create a "_en" property file as well. It seems that the getBundle() method selects the bundle that corresponds to the default locale (and this is somehow coming from the VM if not explicitly set). I.e. it takes the "_de" file, rather than taking the "" file. This behaviour is not documented in the API doc, at least I could not find it.
The next beta contains "", "_en", "_de"... ;-) Then it works.
Would be great if someone could contribute here and help me to get out of my confusion...
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
|
|
|