4 Replies Latest reply on Aug 28, 2007 11:30 AM by alex_enache

    SEAM internationalization problem :(

    alex_enache

      Hi guys,

      I'm having a problem with internationalization in SEAM for 2 days now. And I can't seem to make it right. So, I have the following files:

      pmResources_ro.properties
      pmResources_en.properties
      pmResources_fr.properties
      pmResources.properties

      They are stored in:
      /myapp.ear/myapp.war/WEB-INF/classes/

      Here is what faces-config.xml contains about the bundle:

      <application>
       <message-bundle>pmResources</message-bundle>
       <locale-config>
       <default-locale>ro</default-locale>
       <supported-locale>ro</supported-locale>
       <supported-locale>en</supported-locale>
       <supported-locale>fr</supported-locale>
       </locale-config>
      </application>


      The components.xml part:
      <core:resource-bundle>
       <core:bundle-names>
       <value>pmResources</value>
       </core:bundle-names>
      </core:resource-bundle>


      And in my page I use it with:
      ...
      <f:loadBundle basename="pmResources" var="bundle"/>
      ...
      <h:outputText value="Text=#{bundle.AboutUsText}"/>


      Even though ro should be default, every time I load the page en is the one displayed. And I tried to use:
      <h:selectOneMenu value="#{localeSelector.language}">
       <f:selectItem itemLabel="English" itemValue="en"/>
       <f:selectItem itemLabel="Francais" itemValue="fr"/>
       <f:selectItem itemLabel="Romana" itemValue="ro"/>
      </h:selectOneMenu>
      <s:button action="#{localeSelector.select}" value="ChangeLanguage"/>


      From what I know, JSF searches the properties files in the following order:
      pmResources_ro.properties
      pmResources_ro_RO.properties
      pmResources_en.properties
      pmResources_en_US.properties
      pmResources_fr.properties
      pmResources_fr_FR.properties
      pmResources.properties

      Can anyone help me with this ? Thanks in advance!