mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-29 10:26:36 +01:00
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:
parent
16b9bab719
commit
495c82baa0
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue