mercredi 11 mars 2015

How to localize an Android app to an Aboriginal language


Vote count:

0




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.



asked 35 secs ago

Millthorn

1,569






How to localize an Android app to an Aboriginal language

Aucun commentaire:

Enregistrer un commentaire