This is my messages_en_US.properties file in WEB-INF/classes folder :-
Login=Login
And then i created messages_fr_FR.properties :-
Login=frenchLogin
Then in my JSF page i wrote this :-
<f:loadBundle basename="messages" var="msg"/>
<h:commandButton id="btnLogin" value="#{msg.Login}" actionListener="#{IndexBean.doLogin}"/>
I can correctly see the Login text by default. But when i go in firefox and change my default language to fr-fr, my text still remains the same i.e i can’t see frenchLogin.
I don’t have anything in my faces-config.xml
What am i doing wrong? Thanks in advance 🙂
You have to have this in the
faces-config.xmlYou need a Messages.properties which will be the default one.
in your jsf page:
The messages file has to be in
src/main/java/and then in a package. Mine is/src/main/java/com/mydomain/resourcesAlso be careful with the capital letters.