Improve lang code
This commit is contained in:
parent
9d4923cc2e
commit
a022c67dc8
1 changed files with 9 additions and 3 deletions
|
@ -624,10 +624,16 @@ public class OsmandApplication extends Application {
|
|||
}
|
||||
|
||||
public String getLanguage() {
|
||||
if(preferredLocale != null) {
|
||||
return preferredLocale.getLanguage();
|
||||
String lang = "";
|
||||
if (preferredLocale != null) {
|
||||
lang = preferredLocale.getLanguage();
|
||||
} else {
|
||||
lang = Locale.getDefault().getLanguage();
|
||||
}
|
||||
return Locale.getDefault().getLanguage();
|
||||
if (lang != null && lang.length() > 2) {
|
||||
lang = lang.substring(0, 2).toLowerCase();
|
||||
}
|
||||
return lang;
|
||||
}
|
||||
|
||||
public RoutingConfiguration.Builder getDefaultRoutingConfig() {
|
||||
|
|
Loading…
Reference in a new issue