1 Reply Latest reply on Jun 3, 2008 10:24 PM by Francois Eric

    Supported Locales stored in database

    Francois Eric Novice

      Hello,


      In my application, I wish to have my supported locales stored in the database.  Therefore instead of having them specified in the faces-config.xml, I would store them in the database.


      Is this possible?  If so how?


      Also how can I get the supported locales programmatically (i.e. in java code?


      Thank you,


      Francois

        • 1. Re: Supported Locales stored in database
          Francois Eric Novice

          Anyone?


          Also is it possible to get the list of supported locales through EL?


          For example I would like to be able to do something like this (look at the foreach):


          
          <script>
              /*****************************************************
               *  Global util methods
               *****************************************************/
              function getLocalizationContext() {
                  var localizationConf = new Hash({
                      defaultLocale: '#{localeSelector.locale}',
                      currentLocale: '#{localeSelector.language}'
                  });
                  var localizationContext = new MdaradLocalizationContext(localizationConf);
                  <c:forEach var="currentLocale" items="#{localeSelector.supportedLocales}">
                           localizationContext.addLocale('#{currentLocale.displayName}');
                  </c:forEach> 
                   
                  return localizationContext;
              }
          
          </script>
          
          


          I need the localization context for my javascript but I want to retrieve it from seam...is this possible?


          This doesn't work because the supportedLocales method does not exist anymore on the LocaleSelector


          Thank you