en_UK 是非法语言环境吗?

发布于 2024-12-02 14:17:25 字数 1040 浏览 1 评论 0原文

到目前为止,我一直使用“en_UK”来表示英式英语。今天,我在将它与 Zend Framework 一起使用时遇到错误,因为该语言环境未包含在可识别语言环境的长列表中。

以下是该列表的简短摘录:

'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,

如您所见,有各种使用英语的地区,并且还有一个条目“en_GB”,我认为它代表英国......但没有“en_UK”。这只是 Zend Framework 中的一个“错误”还是还有其他原因?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

二智少女猫性小仙女 2024-12-09 14:17:25

正确的国家/地区代码是 en_GB。区域设置使用 ISO 3166-1 作为国家/地区代码。 维基百科文章包括:

根据 ISO 3166/MA 选择代码“以反映
国家名称的重要、独特组成部分,以便允许
国家名称和国家代码之间的视觉关联”。[7] 为此
原因,国家名称的常见组成部分,如“共和国”、“王国”、
“联合”、“联邦”或“民主党”通常不用于推导
代码元素。因此,例如,英国
官方分配的 alpha-2 代码为 GB 而不是 UK,基于
其正式名称为“大不列颠及北爱尔兰联合王国”
爱尔兰”(尽管英国应联合国的要求保留
王国)。

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

笑脸一如从前 2024-12-09 14:17:25

这确实是一个常见的(?)错误。 en_UK 是错误的。英国的 ISO 国家/地区代码是 GB,因此语言标签为 en_GB。

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.

儭儭莪哋寶赑 2024-12-09 14:17:25

不完美的实现

从 1985 年开始,ISO 3166-1 alpha-2 代码已在
作为国家代码顶级域名 (ccTLD) 的域名系统。这
互联网号码分配机构目前正在分配 ccTLD
大多数遵循 alpha-2 代码,但也有一些例外。[9]为了
例如,英国的 alpha-2 代码为 GB,使用 .uk
而不是 .gb 作为其 ccTLD,因为英国目前特别保留
应英国要求,纳入 ISO 3166-1。

根据维基百科http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

所以显然这是一个已经卡住的旧东西或类似的东西。

编辑:马丁·克莱顿找到了更好的答案。

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.

分开我的手 2024-12-09 14:17:25

你不能简单地发明语言环境!它们已经被定义了。所以“en-gb”是英式英语,而“en-us”是美式英语。如果你使用“en-uk”,你只是在编一个代码。

至于为什么官方代码是“en-gb”而不是“en-uk”,我想基本上是因为不存在英国英语这样的东西。语言变体是英国。请注意,大不列颠和联合王国之间的区别是:

UK = GB + Northern Ireland

因此,通过将变体命名为“en-UK”,就好像您想将北爱尔兰的说话方式纳入此类别中。但你为什么要这么做呢?从语言学的角度来看,这是没有意义的,因为北爱尔兰英语比英国英语更接近爱尔兰英语 (en-IE)。

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.

何止钟意 2024-12-09 14:17:25

由于某种原因,ISO 3166 中大不列颠及北爱尔兰联合王国的正确国家/地区代码是“GB”,因此区域设置代码应为 en_GB,而不是如上所述的 en_UK 此处

en_GB 也被 glibc、gnome、kde 等使用。

而且我喜欢这样一个事实,即开源项目中的许多以前的错误修复都与此相关,如 apache http 1.3roundcube 项目

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文