I wan't to use a custom language (like pirate language on minecraft) on my app that the user can select through the settings menu. Normally I would put the strings.xml file into a values-en or so folder. Then I would load it at runtime using this code:
Resources res = context.getResources();
// Change locale settings in the app.
DisplayMetrics dm = res.getDisplayMetrics();
android.content.res.Configuration conf = res.getConfiguration();
conf.locale = new Locale("xy");
res.updateConfiguration(conf, dm);
If I was to create a language in a values-xy folder and then load it using the code and choosing the language xy it does not load it. Is something like that even possible? Creating a custom languag using a non existant language code and use that? Id did not work using the code above.
Aucun commentaire:
Enregistrer un commentaire