You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2014/09/23 13:49:34 UTC

[jira] [Updated] (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 ]

Martin Grigorov updated WICKET-5706:
------------------------------------
    Summary: ResourceUtils.getLocaleFromFilename cannot handle filenames with classifiers  (was: ResourceUtils.getLocaleFromFilename bug)

> 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
>
> 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)