You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martijn Dashorst (JIRA)" <ji...@apache.org> on 2015/08/10 11:28:46 UTC

[jira] [Reopened] (WICKET-5706) ResourceUtils.getLocaleFromFilename cannot handle filenames with classifiers

     [ https://issues.apache.org/jira/browse/WICKET-5706?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martijn Dashorst reopened WICKET-5706:
--------------------------------------

I think the ResourceUtils.getLocaleFromFilename(String path) has the order of locale and minimization wrong:

It currently parses: File.min_Lang_Coun_Var.ext while the typical convention is File_Lang_Coun_Var.min.ext


> ResourceUtils.getLocaleFromFilename cannot handle filenames with classifiers
> ----------------------------------------------------------------------------
>
>                 Key: WICKET-5706
>                 URL: https://issues.apache.org/jira/browse/WICKET-5706
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.17.0
>            Reporter: Tamas Szendrei
>            Assignee: Martin Grigorov
>             Fix For: 6.18.0, 7.0.0-M4
>
>
> 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('.');



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)