0

I have 3 folders for Norwegian languages but I only have 1 file for translations.

/values-no/
/values-nn/
/values-nb/

For now I have the same strings.xml triplicated, one in every folder.

Could I link the resources of some folders to another one? Any other solution?

Edit:
I want to avoid to have the same file 3 times in the final .apk

MarcGV
  • 1,242
  • 1
  • 10
  • 33

1 Answers1

1

If it's your own application, you could probably use this trick to merge all 3 locales:

Locale locale = getResources().getConfiguration().locale;
if (locale.getLanguage().equals("no") || locale.getLanguage().equals("nb") || locale.getLanguage().equals("nn")){
    locale = new Locale("no","NO");
    Configuration config = new Configuration();
    config.locale = locale;
    Resources res = getBaseContext().getResources();
    res.updateConfiguration(config, res.getDisplayMetrics());
}

Source

Community
  • 1
  • 1
Zomby
  • 164
  • 3
  • 10