I would like to offer English and French languages for English and French speaking users, and English for all the other users who ask for another language. My faces-config.xml:
<application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>fr</supported-locale>
</locale-config>
<resource-bundle>
<base-name>fr.testi18n.messages</base-name>
<var>msg</var>
</resource-bundle>
I have 3 resource files named messages.properties and messages_en.properties (with English messages), and messages_fr.properties (with French messages).
The user can choose their language with a <h:selectOneMenu>
and the selected locale is registered in a session scope backing bean. All the views have a locale attribute with a value get from the backing bean. When they choose French or English, it's OK: the correct messages are displayed but when they choose Chinese (zh), the messages are in French and not in English.
In order to test, I have even removed the line <supported-locale>fr</supported-locale>
and the messages are still in French!
I am French but I have put French in the last position in the configuration of my Browser (Chrome).
What could be my error?