[
http://www.stripesframework.org/jira/browse/STS-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11220#action_11220
]
Qian Qiao commented on STS-501:
-------------------------------
You are doing something wrong here, according to java's resource bundle
matching strategy, Locale("cs") cannot be matched to <Resource_name>_cs_CZ.
So in you original case: cs_CZ:UTF-8, en_US:UTF-8, it's not because the locale
picker prefers en_US over cs, it's because en_US is the only match.
A general rule: it can only go from more specific to less specific, not the
other direction, I'll explain:
Assuming you have the following resourcebundle files:
Bundle.properties
Bundle_cs_CZ.properties
Bundle_en_US.properties
Locale("cs") can only be matched to Bundle.properties, because cs is less
specific than cs_CZ.
> DefaultLocalePicker behavior - is it right to always prefer a two-way locale
> match ?
> ------------------------------------------------------------------------------------
>
> Key: STS-501
> URL: http://www.stripesframework.org/jira/browse/STS-501
> Project: Stripes
> Issue Type: Improvement
> Reporter: Karel Kolman
> Priority: Minor
>
> The way DefaultLocalePicker chooses the locale to use does not seem right to
> me. It always preferres a two-way match (language + country), language match
> corresponding to language priorities in the request allowed locales should be
> a priority.
> Example:
> I have a Firefox installation with czech locale, the locales it sends in
> default settings with web requests are "cs", "en_US".
> Let's say I have LocalePicker.Locales value set to "cs_CZ:UTF-8,en_US:UTF-8",
> the web pages are rendered to me in english.
> (I can "fix" this by setting LocalePicker.Locales
> "cs:UTF-8,cs_CZ:UTF-8,en_US:UTF-8")
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development