Hum...
I'm using Glassfish with Mojarra 2.0.2. I will try to update to 2.0.3 and
test again.
But, for now, that's my codes:
faces-config.xml
bundles.mensagenssistema_pt_BR.properties
bundles.mensagenssistema_en.properties
myview.xhtml (form and message that work fine after changes)
... myview.xhtml (images and commandButtons)
GeralBean.java
As you can see, I have <resource-bundle> and <message-bundle> tags at faces-config.
When the browser sends this Accept-Language: en,en-us;q=0.8,pt-br;q=0.5,es;q=0.3
It show #{mens.escolha} as an english text and show images from resources/ingles/imagens/.
When I change the browser to make it send this Accept-Language: pt-br,en;q=0.8,en-us;q=0.5,es;q=0.3
It show #{mens.escolha} as a portuguese text and show images from resources/portugues/imagens/.
The same occurs with all of the other languages.
When the user picks a choice through the selectOneMenu, only #{mens.escolha} (and eventually other messages) is translated to the new language. The images stay on the same language even after page refresh. To change the language I just need to change the accept-language, but I don't believe that my users will know how to do that.
Fix me if I'm wrong, but I believe that the locale used by the ViewRoot, which controls the resource-bundles to write down the page is different than the locale used by the message-bundles which loads the javax.faces.resource.localePrefix to get the external resources.
The source codes of the view sent to the browser bring tags like this:
See loc=portugues. It occurs even when the ViewRoot's locale is "en".
What am I still doing wrong?
Ps.: Brendan, really thank you for your attention.