Wicket
  1. Wicket
  2. WICKET-4162

Add new StringResourceLoader to allow Wicket extensions to provide localization resource bundles

    Details

      Description

      Issue:
      It is currently not possible to provide default localization resource bundles for components in wicket extension modules (e.g. wicket-extensions). See issues WICKET-3911 and WICKET-4154 where this was a problem.

      Proposed changes:
      1-Add a new IStringResourceLoader type (WicketExtensionStringResourceLoader?) which checks the root of the jar containing the component for properties in extension.properties.

      2-Insert this new resource loader in the existing default resource loader chain:
      ResourceSettings() constructor:
      stringResourceLoaders.add(new ComponentStringResourceLoader());
      stringResourceLoaders.add(new PackageStringResourceLoader());
      stringResourceLoaders.add(new ClassStringResourceLoader(application.getClass()));
      // New loader inserted here
      stringResourceLoaders.add(new WicketExtensionStringResourceLoader());
      stringResourceLoaders.add(new ValidatorStringResourceLoader());

      3-Start adding extension.properties files in wicket-extension and friends.

      Questions:
      Is a similar effort already underway?
      Are there any better ideas?
      Should the new loader be inserted at the end of the chain instead?
      Do you prefer other names for the loader or the properties file?

      I am prepared to provide a patch sometime next week if this is agreed on.

      1. jar_resource.patch
        9 kB
        Bertrand Guay-Paquet
      2. WICKET-4162.patch
        13 kB
        Sven Meier

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Sven Meier
              Reporter:
              Bertrand Guay-Paquet
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development