I' trying to localize an app to a language that is in the code set: ISO 639-3. This language is spoken in Australia and is called Gupapuyŋu.
In the directory tree, I have created: res/values-guf/strings.xml. However, no one of the localized strings is loaded:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ABN Dhupuma</string>
<string name="action_settings">Ŋäj</string>
<string name="about">Nhämirri</string>
</resources>
Here's the code:
private void setLocaleGupapuyŋu() {
Locale gupapuyŋu;
Context con = getBaseContext();
Resources res = con.getResources();
if(BuildConfig.VERSION_CODE < Build.VERSION_CODES.LOLLIPOP) {
//gupapuyŋu = new Locale("guf", "au");
gupapuyŋu = new Locale("guf");
} else {
gupapuyŋu = new Locale.Builder()
.setLanguage("guf")
//.setRegion("au")
//.setScript("lati")
.build();
}
Log.v("Language", gupapuyŋu.getDisplayCountry());
Locale.setDefault(gupapuyŋu);
Configuration config = new Configuration();
config.locale = gupapuyŋu;
DisplayMetrics displayMetrics = con.getResources().getDisplayMetrics();
res.updateConfiguration(config, displayMetrics);
}
Thanks guys and gals, appreciating the effort.