Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-4547

JcrResourceBundle does not support multiple base names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • i18n 2.5.8
    • i18n 2.5.10
    • i18n
    • None

    Description

      The sling:basename property may be multi-valued, that is the messages of a mix:language nodes may belong to multiple base names and thus ResourceBundle instances, as stated at https://sling.apache.org/documentation/bundles/internationalization-support-i18n.html.
      The latest codebase does not work in that way.

      JcrResourceBundle#loadPotentialLanguageRoots():
      if (baseName == null || baseName.equals(properties.get(PROP_BASENAME, ""))) {
      paths.add(bundle.getPath());
      }

      In case if property sling:basename have multiple values, only the first base name is considered, others are skipped.

      The correct implementation would be to use properties.get(PROP_BASENAME) - method version without default value parameter, which would return array. You would need to iterate over its items and check equality.

      Attachments

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              apilets Andrei Pilets
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: