NRUSINGHA MOHARANA
NRUSINGHA MOHARANA

Reputation: 1559

How to create string resource for same language but different region?

While creating a new resource file with Locale qualifier inside res/values folder, I have chosen English as Language and US:United States as Region then directory name is automatically created as values-en-rUS. And file created successfully having above language and region. As you can see in the pic.

enter image description here

But now I want to create another file having English as Language and GB:United Kingdom as Region then directory name is automatically created as values-en-rGB. but when I click OK button, it does not allow to create file for same language having different region. See below pic.

enter image description here

My requirement is to create different string resource for different region. Two different region might have same language. So how can I achieve this?

Any help would be appreciated ! Thanks in Advance.

Upvotes: 0

Views: 1414

Answers (1)

NRUSINGHA MOHARANA
NRUSINGHA MOHARANA

Reputation: 1559

Found solution. Don't let android studio to generate resource directory name by selecting Language and Region from the populated dialog, instead type directory name for each region though language remains same.For instance type values-en-rUS in place of directory name to create resource file.Here en stands for English language and r stands for Region and US is the country code for United States. Same applicable for values-en-rGB.Now I am able to create resource file for different region having same language.

Upvotes: 1

Related Questions