SAL: I18nResolver.getAllTranslationsForPrefix(key, locale) does not return raw format string

XMLWordPrintable

    • 4.03

      Encountered while developing STRM 4.0. This appears to be a bug in JIRA's SAL plugin, but I could not locate where exactly. My code looked like the following:

      Map<String, String> translations = i18nResolver.getAllTranslationsForPrefix(key, locale);
      String pattern = translations.get(key);
      String text = MessageFormat.format(pattern, arguments);
      

      Nothing special. We found that the code was formatting text incorrectly. After investigating, it appeared that getAllTranslationsForPrefix was returning the following format string

      {0} attached{1} to {2}
      

      that was defined in a properties file like so:

      streams.item.jira.title.attached={0} attached{1,choice,1# one file|1< {1} files} to {2}
      

      It appears that somewhere the property value is being processed or interpolated when it shouldn't be.

      It's possible this wasn't an issue with 4.3 milestone builds since we didn't notice it until after we started testing against 4.3 final.

            Assignee:
            Peter Leschev
            Reporter:
            Arun Bhalla (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: