Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-1448

SeamResourceBundle.getBundle(String baseName) fails to return correct message based on Locale

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • 4.3.0.GA_CP04_FP01
    • 4.3.0.GA_CP02_FP01
    • Seam
    • None
    • Release Notes

      When specifying the Locale directly, everything works as expected, when not, the default locale is used, which is incorrect. Ex.

      log.info("SeamResourceBundle.getBundle w/o passing Local: " + SeamResourceBundle.getBundle("ECISConfig").getString("ecis.hello"));
      log.info("SeamResourceBundle.getBundle w passing Local: " + SeamResourceBundle.getBundle("ECISConfig", LocaleSelector.instance().getLocale()).getString("ecis.hello"));

      Produces:
      15:08:45,438 INFO [TestAction] SeamResourceBundle.getBundle w/o passing Local: Hello from ECISConfig_en.properties
      15:08:45,439 INFO [TestAction] SeamResourceBundle.getBundle w passing Local: Hello from ECISConfig_en_US_tmwa.properties

      When both should be saying "Hello from ECISConfig_en_US_tmwa.properties" because the locale and resource bundle are defined in components.xml as:

      <international:locale-selector locale-string="en_US_tmwa" />

      <core:resource-loader>
      <core:bundle-names>
      <value>messages</value>
      <value>ECISConfig</value>
      </core:bundle-names>
      </core:resource-loader>

              mnovotny@redhat.com Marek Novotny
              sjmenden_jira Samuel Mendenhall (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: