Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid resource directory name for values with country code

I have an android app in more languages. If I have a folder named: values-en I have no error and everything is working fine.

If I rename the name of the dir to values-en_GB i got this error: android-apt-compiler: [NAMEOFAPP] invalid resource directory name: [path]\res/values-en_GB

Why is this invalid? or what I should do to have for same language (in this example en) different values depend of the location (in this example US or GB)

I am using Idea 12, Java 1.7, Android 4.2

like image 822
Daniel Dudas Avatar asked Mar 20 '13 00:03

Daniel Dudas


1 Answers

The format of your directory is incorrect. See: Documentation

Use:

res/values-en-rGB

Basically:

The language is defined by a two-letter ISO 639-1 language code, optionally followed by a two letter ISO 3166-1-alpha-2 region code (preceded by lowercase "r").

The codes are not case-sensitive; the r prefix is used to distinguish the region portion. You cannot specify a region alone.

like image 101
Tushar Avatar answered Oct 08 '22 19:10

Tushar