Skip to main content

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?


Comments

  1. 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).

    ReplyDelete
  2. 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.

    ReplyDelete
  3. Imperfect implementations

    Starting in 1985, ISO 3166-1 alpha-2 codes have been used in the
    Domain Name System as country code top-level domains (ccTLDs). The
    Internet Assigned Numbers Authority currently assigns the ccTLDs
    mostly following the alpha-2 codes, but with a few exceptions.[9] For
    example, the United Kingdom, whose alpha-2 code is GB, uses .uk
    instead of .gb as its ccTLD, as UK is currently exceptionally reserved
    in ISO 3166-1 on the request of the United Kingdom.


    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.

    ReplyDelete
  4. 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

    ReplyDelete

Post a Comment

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex