Add locale
This commit is contained in:
parent
50a676b712
commit
fe56004b66
3 changed files with 19 additions and 1 deletions
|
@ -374,7 +374,15 @@ public class OsmandRegions {
|
|||
}
|
||||
|
||||
public void setLocale(String locale) {
|
||||
setLocale(locale, null);
|
||||
}
|
||||
|
||||
public void setLocale(String locale, String country) {
|
||||
this.locale = locale;
|
||||
// Check locale and give 2 locale names
|
||||
// if("zh".equals(locale) && "rTW".equals(country)) {
|
||||
// this.locale = "zh-Hant";
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -567,7 +567,7 @@ public class AppInitializer implements IProgress {
|
|||
return null;
|
||||
}
|
||||
});
|
||||
app.regions.setLocale(app.getLanguage());
|
||||
app.regions.setLocale(app.getLanguage(), app.getCountry());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -775,6 +775,16 @@ public class OsmandApplication extends MultiDexApplication {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
String country;
|
||||
if (preferredLocale != null) {
|
||||
country = preferredLocale.getCountry();
|
||||
} else {
|
||||
country = Locale.getDefault().getCountry();
|
||||
}
|
||||
return country;
|
||||
}
|
||||
|
||||
public String getLanguage() {
|
||||
String lang;
|
||||
|
|
Loading…
Reference in a new issue