2 Replies Latest reply on Sep 25, 2013 1:57 PM by kenfinni

    Default locale problem

    mbasovni

      Hello,

       

      in my portlet I have two localisations: en, cs. But I have got problem with default locale.

       

      faces-config.xml

       ...
      <application>  
              <resource-bundle>
                  <base-name>path.to.file.text</base-name>
                  <var>text</var>
              </resource-bundle>
              <locale-config>
                  <default-locale>en</default-locale>
                  <supported-locale>cs</supported-locale>
              </locale-config>
      </application>
      ...
      

       

      portlet.xml

      <supported-locale>en</supported-locale>
      <supported-locale>cs</supported-locale>
      

       

      My resouce bundle's name is "text" and default file should be "text.properties". But when I have this file and then "text_cs.properties" English does not work!

       

      BUT!

      When my filenames are "text_en.properties" and "text_cs.properties" both languages work!

       

      Next problem is that when I change language to language without localisation default language is Czech and not English. Do you know why? It must be connected with 1st problem that english works after renaming file  "text.properties" to "text_en.properties".

       

      Here is example I used:

      https://github.com/gatein/gatein-portal-quickstart/blob/master/jsf2-rf4-hello-world-portlet/src/main/webapp/WEB-INF/faces-config.xml

       

      Thank you for every answer!

       

       

       

      Martin

        • 1. Re: Default locale problem
          yrjayasanka

          I also have the same issue in jBoss4.

          Two struts web application runs on one jboss node in my hosted machine (system local is en_US). But, changing local from sv_SE to en_GB does not reflect in the UI.

          My default properties file also in English.

           

          waitting for a answer.

           

          Thanks

          • 2. Re: Default locale problem
            kenfinni

            Martin,

             

            Apologies for the time it took me to respond!

             

            From a quick test I did, changing the language in GateIn correctly updates the internationalized parts of the JSF portlet, when the "en" properties file does not include the locale portion.

             

            Basically I built the GateIn Quickstart for JSF2 and tried it.

             

            Once difference I can see is that the quickstart doesn't set the supported locales in portlet.xml, so not sure if that is causing an issue or not.

             

            Ken