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?
According to wikipedia http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2.
So apparently it's an old thing that has stuck or something like that.
EDIT: martin clayton found a better answer.
The correct country code is
en_GB
. Locales use ISO 3166-1 for country codes. The wikipedia writeup includes:the correct country code in ISO 3166 for the United Kingdom of Great Britain and Northern Ireland is for some reason "GB", so the locale code should be en_GB, and not en_UK as noted here.
en_GB is also used by glibc, gnome, kde, etc
Also i like the fact that many previous bug fixes in opensource projects are related to this like in apache http 1.3 and roundcube project
It is indeed a common (?) mistake. en_UK is wrong. The ISO country code for the UK is GB, making the language tag en_GB.
You cannot simply invent locales! They are already defined. So "en-gb" is British English, whereas "en-us" is American English. If you use "en-uk", you are just making up a code.
As to why the official code is "en-gb" and not "en-uk", I think basically because there is no such thing as United Kingdom English. The language variant is British. Note that the difference between Great Britain and the United Kingdom is:
UK = GB + Northern Ireland
So by naming the variant "en-UK" it's as if you are saying that you want to include the way they speak in Northern Ireland within this category. But why would you want to do that? From a linguistic perspective it makes no sense, as Northern Ireland English is closer to Irish English (en-IE) than British English.