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

haiwei li commented on LANG-889:
--------------------------------

Thanks, I have find this bug from spring Jura.

发自我的 iPhone

在 2013-4-22,17:49,"Sebb (JIRA)" <[email protected]> 写道:


                
> If locale is "pt_pt", it's not a variant
> ----------------------------------------
>
>                 Key: LANG-889
>                 URL: https://issues.apache.org/jira/browse/LANG-889
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.0
>            Reporter: haiwei li
>
> You hava a spring MVC site, it's support multiple languages.
> <bean id="localeChangeInterceptor" 
> class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
>   <property name="paramName" value="locale" />
> </bean>
>  
> 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.
> <a href="http://jakarta.apache.org/commons/lang/";>Jakarta's Commons Lang</a>

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

Reply via email to