Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1827

MessageUtils don't handle MessageFormat substitution correctly with different Locale

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.5
    • 1.2.3
    • None
    • None
    • Java 6+5, Myfaces 1.1.5

    Description

      Using MessageUtils to generate FacesMessages from ResourceBundle like:

      my.message.key=Your current balance is

      {0,number,currency}

      Doesn't work out for other locales than the default one. Internally MessageUtils uses MessageFormat to do substitution. Due to wrong handling
      the given Locale won't be used correctly leading to wrong currency symbols and formatting in for example t:messages.

      The provided patch includes the fix, as well as two testcases to reproduce the problem.

      BTW: is there any JSF-API way to have resource bundle entries read via MessageFormat?

      Attachments

        1. MessageUtils.patch
          2 kB
          Veit Guna

        Activity

          People

            tomsp Thomas Spiegl
            vguna Veit Guna
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: