• Post Reply Bookmark Topic Watch Topic
  • New Topic

[JSF 1.2 and 2.0/Internationalization] How to propagate the Locale to the entire application

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
do you know how to internationalize an application in a dynamic way in JSF 1.2 ?
I created 2 files msg_fr.properties ( language by default, french) and msg_en.properties ( english)

Then I wrote a methode changeLanguage() in a Managed Bean . This method allows me to switcher the language in the first page of the application.
This method is called in a tag <h:commandLink>



I have of course modified the file faces-config.xml.

This WORKS but for the current page only. The Locale is not propagated to the next pages of the application.

The Locale by default of my browser is English and so the next pages are always in English, even if i switch the first page to French.

Do you know how to propagate this Locale to all the pages of the application in JSF 1.2 ?
Also, has internationalization been improved in JSF 2.0 ?

thanks
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the solution : I have to play with the Locale attribute of the <f:view> tag.
I had already tried that before and, for some stupid reason, it did not work.
I wanted to ask around before trying to fix it in case there was another way to deal with internationalization.

I am surprised that version 2.0 has not brought anything to internationalization.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!