Skip to main content

JSF - Facelets - How to change locale?

3 replies [Last post]
Joined: 2006-12-09


I am a little bit helpless. I try to change the user locale (Language) used in my Web application independent form the users browser and OS settings. But it did not work.

I have a typical faces-config.xml with locale support for english (default) and german (de):


In my facelets template file I try to set the locale fixed to 'en'

But my application shows always the german (de) resources.
I did not understand why I cannot change the locale in a view tag to a fixed value

I am using facelets 1.1.14
and also RichFaces 3.2.1.GA

Thanks for any help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2009-07-07

I don't know if it has an impact on your problem, but you shouldn't repeat the default locale in the list of supported locales. Deleting the default properties file is definitely a bad idea, as you are deleting your fallback file...

Joined: 2006-12-09

it seems that the

only work if a ressource bundle with the locale sufix '_en' is provided.
Everything works now if I provide 3 ressouce files: and are identically!
But if I delete the file always the file wins before the default properties.
I did not expect such a behavior :-(

Joined: 2007-03-12

Did you try to delete the Tried that on my project an everthing seems to work as expected.