Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5706

ResourceUtils.getLocaleFromFilename cannot handle filenames with classifiers

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.17.0
    • Fix Version/s: 6.18.0, 7.0.0-M4
    • Component/s: wicket
    • Labels:
      None

      Description

      When I try to get PathLocale with ResourceUtils, than get wrong values, when the files contains '.' in name.

      Example: 'jquery.test.js'
      PathLocale.path=jquery, PathLocale.locale = null

      or jquery.test_hu.js'.
      PathLocale.path=jquery, PathLocale.locale = null

      That's why I'd like to use
      jquery.test_hu.js' as resource, the ResourceStreamLocator try to find
      jquery.test_hu_hu_HU.js, jquery.test_hu_hu.js, and after jquery.test_hu.js.
      Because the
      ResourceStreamLocator.locate

      PathLocale data = ResourceUtils.getLocaleFromFilename(path);
      if ((data != null) && (data.locale != null))

      { path = data.path; locale = data.locale; }

      doesn't work in this case.

      Should change the
      ResourceUtils

      public static PathLocale getLocaleFromFilename(String path) {
      int pos = path.indexOf('.');
      ----------------
      To
      int pos = path.lastIndexOf('.');

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mgrigorov Martin Tzvetanov Grigorov
                Reporter:
                szetamas Tamas Szendrei
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: