I have a problem changing the language in a JSF 2 application. I use the code below to the change the language of the current page (e.g. from English to German) which works fine, but as soon as I navigate to another page, the original language (in my example English) is used again. How can I change the language permanently for a user?
i think you have to write this code in every page.
Joined: Sep 13, 2011
thank you for your answer. The code I showed is inside the event handler of a button. So when the user presses the "German" button on the page, this code is executed. I do not want the user to press this button again on every page that he navigates to I think what happens is that as soon as the user navigates to another page, the browser local from the request is used again, but I did not find a way to set this locale.
Is there really no way to set the locale permanently for a user session?
Another question: Is it possible to get an event as soon as a page is displayed, then I could of course this code from this event handler, although I still think it would be nicer to set the locale permanently for a session.