PHPFan
PHPFan

Reputation: 796

Android localization (invalid resource directory name)

Each time I create values_enu folder under res folder in eclipse for localization issue I get an error invalid resource directory name

http://developer.android.com/training/basics/supporting-devices/languages.html

Can someone help please.

Upvotes: 2

Views: 2119

Answers (3)

Martin Pfeffer
Martin Pfeffer

Reputation: 12627

You only should write "values-en".
The syntax is: FOLDERNAME MINUS 2-CHARACTER-LANGUAGE-KEY

Another example:

drawable-es <<= this will create a folder for Spanish picture files. It could be useful for implementing a labeled button you have created in photoshop or gimp.

Upvotes: 0

Czechnology
Czechnology

Reputation: 14992

One thing that wasn't clear to me from the docs is what a directory should be called in case of language variants, e.g. British/American English or German/Austrian German.

So even though the locales are of form en_GB, en_US, de_DE or de_AT etc, the corresponding folders should be called

res/values-en-rGB/
res/values-en-rUS/
res/values-de-rDE/
res/values-de-rAT/

That means keep the letter capitalization but use only hyphens instead of underscores and add an r before the language variant.

Upvotes: 8

Sripathi
Sripathi

Reputation: 1780

Use hyphen(-) instead of underscores(_)..

values-en is valid and values_en is invalid

Upvotes: 1

Related Questions