Matej Drobnič
Matej Drobnič

Reputation: 1191

Language of the default values/strings.xml

Which language does android treats default strings.xml as?

Specifically, when there are <plurals> tags inside default strings.xml, rules for which language will Android pick? Is there a way to specify that?

Upvotes: 1

Views: 2185

Answers (2)

felli mohamed hedi
felli mohamed hedi

Reputation: 309

Use this to change the language by programmatically--

Locale locale = new Locale("en_US");
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
context.getApplicationContext().getResources().updateConfiguration(config, null);

Write the countrycode of language in place of "en_US" whatever language you want...like for japanese--"ja_JP" For Arabic--"ar" or check this link for code of country--

http://code.google.com/apis/igoogle/docs/i18n.htmlenter code here

Upvotes: 0

M G
M G

Reputation: 1250

It doesn't treat default values folder as a language dependant. It's basically a fallback if it doesn't find a better match. You can read more here.

Android will pick plurals rules for language that is currently selected in the phone(e.g. if users has german language then android will pick german rules).

Upvotes: 2

Related Questions