Uploaded image for project: 'Seam International'
  1. Seam International
  2. SEAMINTL-29

bundles messages doesnt return proper values

    Details

      Description

      #

      {bundles.messages.MyKey}

      doesnt return the correct properties file after firing locale event and changed the locale of user. @Inject @Client Locale locale returns proper value after changing locale but bundles messages returns values from jdk locale. I will add non working example and I working example with helper class later once the repository is up again.

        Gliffy Diagrams

          Activity

          Hide
          ssachtleben Sebastian Sachtleben added a comment -

          Both projects can be imported in eclipse as maven projects and deployed on jboss6 with "mvn clean package jboss:hard-deploy"

          Show
          ssachtleben Sebastian Sachtleben added a comment - Both projects can be imported in eclipse as maven projects and deployed on jboss6 with "mvn clean package jboss:hard-deploy"
          Hide
          ssachtleben Sebastian Sachtleben added a comment -

          ResourceBundle.getBundle(key.toString()); in Bundles.java returns ResourceBundle with Locale.getDefault(); --> JVM Locale

          Show
          ssachtleben Sebastian Sachtleben added a comment - ResourceBundle.getBundle(key.toString()); in Bundles.java returns ResourceBundle with Locale.getDefault(); --> JVM Locale
          Hide
          ssachtleben Sebastian Sachtleben added a comment -

          Added pull request for possible solution

          Show
          ssachtleben Sebastian Sachtleben added a comment - Added pull request for possible solution
          Hide
          kenfinni Ken Finnigan added a comment -

          This is certainly a bug that there is no connection between the bundle messages retrieval and the locale of the user. The suggested solution to make the Bundles class Session instead of Application scoped while a good thought, it is not recommended to store large amounts of data within the Session.

          The ideal solution is to retain the Application scoped nature of Bundles while also allowing you to retrieve a bundle based on the current users locale

          Show
          kenfinni Ken Finnigan added a comment - This is certainly a bug that there is no connection between the bundle messages retrieval and the locale of the user. The suggested solution to make the Bundles class Session instead of Application scoped while a good thought, it is not recommended to store large amounts of data within the Session. The ideal solution is to retain the Application scoped nature of Bundles while also allowing you to retrieve a bundle based on the current users locale
          Hide
          ssachtleben Sebastian Sachtleben added a comment -

          Yep I thought about that too. But its not that easy cause we have a several locales. Each locale can have several resource files for that depending locale. And I think the name should stay as #

          {bundles.resourcename.Key}

          since some applications use that allready. I try later to make a better solution later.

          Show
          ssachtleben Sebastian Sachtleben added a comment - Yep I thought about that too. But its not that easy cause we have a several locales. Each locale can have several resource files for that depending locale. And I think the name should stay as # {bundles.resourcename.Key} since some applications use that allready. I try later to make a better solution later.

            People

            • Assignee:
              kenfinni Ken Finnigan
              Reporter:
              ssachtleben Sebastian Sachtleben
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development