2 Replies Latest reply on Dec 20, 2006 10:05 AM by Manuel Aznar Pérez

    Internatinalization: messages only default messages.properti

    Manuel Aznar Pérez Newbie

      Two messages.properties :

      messages.properties
      ---------------------------
      ChangeLanguage=Change
      
      ###########################
      
      messages_es.properties
      ------------------------------
      ChangeLanguage=Cambiar
      
      


      In faces-config.xml :

       <application>
       <message-bundle>messages</message-bundle>
       <view-handler>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</view-handler>
       <locale-config>
       <default-locale>es</default-locale>
       <supported-locale>en</supported-locale>
       </locale-config>
       </application>
      


      In xhtml page :

       <h:form id="selectLanguage">
       <h:selectOneMenu value="#{localeSelector.language}">
       <f:selectItems value="#{localeSelector.supportedLocales}"/>
       </h:selectOneMenu>
       <h:commandButton action="#{localeSelector.select}" value="#{messages['ChangeLanguage']}"/>
       </h:form>
      


      -Combobox shows 2 : español, English --> OK

      -If I change to English --> Button #{messages['ChangeLanguage']} shows "Change" --> OK

      -If I change to Spanish --> Button #{messages['ChangeLanguage']} shows "ChangeLanguage" --> ERROR

      what is the problem?

      Any idea?