5 Replies Latest reply on Apr 11, 2007 9:54 AM by Pete Muir

    Load Resource Bundle

    Jane A Newbie

      Hi,

      I'm trying to load a Resource Bundle for a particular Locale.

      In faces-config.xml I have:

       <message-bundle>messages</message-bundle>
       <locale-config>
       <default-locale>fr</default-locale>
       <supported-locale>fr</supported-locale>
       </locale-config>
      


      And in my Bean I load the current Locale in this way:
       LocaleSelector localeSelector = LocaleSelector.instance();
       Locale locale = localeSelector.getLocale();
       ResourceBundle bundle = ResourceBundle.getBundle("messages", locale);
      
      


      I have been able to get the Locale to "fr", but I can't load the Resource Bundle. I get a java.util.MissingResourceException: Can't find bundle for base name messages, locale fr.

      Are there any other configurations that need to be set?

      I have also tried to inject the Resource Bundle using
      @In java.util.ResourceBundle resourceBundle;
      resourceBundle.getBundle("messages").getString(key);
      


      but to no avail