/** * Explicitly sets the language to be used during parsing. The argument is first normalized by replacing * underscores with hyphens (to support locale strings being used as RFC 5646 language tags), and then forwarded to * {@link #setLocale(String)} so that the Locale information of the tag is preserved. * * @param language The language string to parse. * @see #getLanguage() * @see #setLocale(String) */ public void setLanguage(String language) { setLocale(language.replace("_", "-")); }
/** * Explicitly sets the locale to be used during parsing. This creates a Locale instance from the given language * tag, and passes that to {@link #setLocale(Locale)}. * * @param languageTag the language tag to parse * @see #setLocale(Locale) */ public void setLocale(String languageTag) { setLocale(LocaleFactory.fromLanguageTag(languageTag)); }
model.setLanguage(asString(value, "")); else if (key.last().equals(Model.LOCALE)) model.setLocale(asString(value, "")); else if (key.last().equals(Model.ENCODING)) model.setEncoding(asString(value,""));