You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/11/23 04:12:41 UTC

[jira] [Issue Comment Edited] (WICKET-4162) Add new StringResourceLoader to allow Wicket extensions to provide localization resource bundles

    [ https://issues.apache.org/jira/browse/WICKET-4162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155655#comment-13155655 ] 

Igor Vaynberg edited comment on WICKET-4162 at 11/23/11 3:12 AM:
-----------------------------------------------------------------

i think this is an ok compromise but not an ideal implementation. imho, the proper way would be to change IResourceStreamLocator methods that return IResourceStream to return IResourceStream[] properly representing the fact that there can be multiple resources on the classpath. but this is a much bigger refactor...

the intializer solution suffers the same problem if two jars contain an initializer with the same name, eg Initializer that happen to be in the same package :( not likely, but still possible

also, i think its ok to backport this into 1.5.x and deprecate the old Jar variant.
                
      was (Author: ivaynberg):
    i think this is an ok compromise but not an ideal implementation. imho, the proper way would be to change IResourceStreamLocator methods that return IResourceStream to return IResourceStream[] properly representing the fact that there can be multiple resources on the classpath. but this is a much bigger refactor...

the intializer solution suffers the same problem if two jars contain an initializer with the same name, eg Initializer :(

also, i think its ok to backport this into 1.5.x and deprecate the old Jar variant.
                  
> Add new StringResourceLoader to allow Wicket extensions to provide localization resource bundles
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4162
>                 URL: https://issues.apache.org/jira/browse/WICKET-4162
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.5.1
>            Reporter: Bertrand Guay-Paquet
>            Assignee: Sven Meier
>              Labels: extension, localization
>             Fix For: 1.5.3
>
>         Attachments: WICKET-4162.patch, jar_resource.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira