look for and remove '-' in locale

Some versions apparently return "en-us" as the language code when "en"
is expected. Check for and remove anything after a '-'.
This commit is contained in:
Eric House 2016-08-19 12:28:54 -07:00
parent 16b9bab719
commit 495c82baa0

View file

@ -568,6 +568,11 @@ public class LocUtils {
}
if ( null == lang ) {
lang = Locale.getDefault().getLanguage();
// sometimes I get "en-us" in this case, i.e. the locale's
// there too. Strip it.
if ( lang.contains( "-" ) ) {
lang = TextUtils.split(lang, "-")[0];
}
}
s_curLang = lang;
}