Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is en_UK an illegal locale?

So far I had always used 'en_UK' for British English. Today I got an error when using it with Zend Framework because the locale is not included in the long list of recognized locales.

Here's just a short extract of that list:

'ee_GH' => true, 'ee_TG' => true, 'ee'    => true, 'el_CY' => true, 'el_GR' => true, 'el'    => true, 'en_AS' => true, 'en_AU' => true, 'en_BE' => true, 'en_BW' => true, 'en_BZ' => true, 'en_CA' => true, 'en_GB' => true, 'en_GU' => true, 'en_HK' => true, 'en_IE' => true, 'en_IN' => true, 'en_JM' => true, 'en_MH' => true, 'en_MP' => true, 'en_MT' => true, 'en_NA' => true, 'en_NZ' => true, 'en_PH' => true, 'en_PK' => true, 'en_SG' => true, 'en_TT' => true, 'en_UM' => true, 'en_US' => true, 'en_VI' => true, 'en_ZA' => true, 'en_ZW' => true, 'en'    => true, 'eo'    => true, 'es_AR' => true, 'es_BO' => true, 'es_CL' => true, 'es_CO' => true, 'es_CR' => true, 'es_DO' => true, 

As you can see, there are all kinds of territories with English language and there is also an entry 'en_GB' which I assume stands for Great Britain... but there is no 'en_UK'. Is that just a 'bug' in Zend Framework or is there another reason for that?

like image 455
markus Avatar asked Sep 03 '11 22:09

markus


People also ask

What is en_GB locale?

UTF-8 locale (English for the United States), while an English-speaking user in Great Britain can select en_GB. UTF-8 (English for Great Britain).

What does locale en us mean?

The construct Locale.US is equivalent to: new Locale("en", "US"); This particular Locale constructor requires two arguments: The language code and the country code for the Locale that you want to create. The language codes are lower-case, two-letter codes defined by ISO-639.


1 Answers

The correct country code is en_GB. Locales use ISO 3166-1 for country codes. The wikipedia writeup includes:

The codes are chosen, according to the ISO 3166/MA, "to reflect the significant, unique component of the country name in order to allow a visual association between country name and country code".[7] For this reason, common components of country names like "Republic", "Kingdom", "United", "Federal" or "Democratic" are normally not used for deriving the code elements. As a consequence, for example, the United Kingdom is officially assigned the alpha-2 code GB rather than UK, based on its official name "United Kingdom of Great Britain and Northern Ireland" (although UK is reserved on the request of the United Kingdom).

like image 134
martin clayton Avatar answered Sep 22 '22 11:09

martin clayton