List of usage examples for org.springframework.util StringUtils parseLocaleString
@Nullable public static Locale parseLocaleString(String localeString)
From source file:org.springframework.web.servlet.i18n.LocaleChangeInterceptor.java
/** * Parse the given locale value as coming from a request parameter. * <p>The default implementation calls {@link StringUtils#parseLocaleString(String)} * or JDK 7's {@link Locale#forLanguageTag(String)}, depending on the * {@link #setLanguageTagCompliant "languageTagCompliant"} configuration property. * @param locale the locale value to parse * @return the corresponding {@code Locale} instance * @since 4.3/*from ww w .jav a 2s . co m*/ */ @Nullable protected Locale parseLocaleValue(String locale) { return (isLanguageTagCompliant() ? Locale.forLanguageTag(locale) : StringUtils.parseLocaleString(locale)); }