[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
I18n problem  XML
Forum Index -> Development
Author Message
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
CaptainCasa

Power User
[Avatar]

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
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team