commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "haiwei li (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LANG-888) If locale is "pt_pt", it's not a variant
Date Mon, 22 Apr 2013 04:23:17 GMT
haiwei li created LANG-888:
------------------------------

             Summary: If locale is "pt_pt", it's not a variant
                 Key: LANG-888
                 URL: https://issues.apache.org/jira/browse/LANG-888
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.*
    Affects Versions: 3.0
            Reporter: haiwei li
            Priority: Critical


You hava a spring MVC site, it's support multiple languages. 
You can try url is http://xxx.com/controll/action?locale=pt_pt, it's think so "There is definitely
a variant, and it is everything after the country"

form code:
org.springframework.util.StringUtils.parseLocaleString[659]

if (parts.length >= 2) {
			// There is definitely a variant, and it is everything after the country
			// code sans the separator between the country code and the variant.
			int endIndexOfCountryCode = localeString.indexOf(country) + country.length();
			// Strip off any leading '_' and whitespace, what's left is the variant.
			variant = trimLeadingWhitespace(localeString.substring(endIndexOfCountryCode));
			if (variant.startsWith("_")) {
				variant = trimLeadingCharacter(variant, '_');
			}
		}
		return (language.length() > 0 ? new Locale(language, country, variant) : null);

When locale is "pt_pt", it's result "pt_PT_pt", I think so it's not a variant.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message