• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

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

 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic