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

discarding complete ResourceBundleCache in case of JSON dictionary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • i18n 2.4.6
    • None
    • Extensions, i18n
    • None

    Description

      In case user is using JSON dictionary then condition mentioned here https://github.com/apache/sling/blob/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java#L198

      will becomes true for any change in languagerootpaths which are cached. And this will discard complete resource bundle cache. which is different if user is using sling:Message dictionary.

      for example user has json dictionary at path
      "/libs/test/i18n/de.json"
      and also resource bundle for language "de" is cached so , "libs/test/i18n/de.json" will be in languageRootPaths.
      So any change at "/libs/test/i18n/de.json" will discard complete resourcebundleCache.

      Where as in case of sling:dictionary
      languageRootPath will be like "/libs/test/i18n/de"
      and any change in this dictionary will have path like this "/libs/test/i18n/de/testMessage" so condition becomes false and complete resourcebundleCache. will not be discarded.

      Can we improve this, like if condition becomes true, than check among the cached resourceBundle to which resourceBundle this path belongs to and than discarding that resourceBundle. and if this resourceBundle is parent of any ResourceBundle then discard that too.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              anagarwa Ankit Agarwal
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: