en_UK 是非法语言环境吗?
到目前为止,我一直使用“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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
正确的国家/地区代码是
en_GB
。区域设置使用 ISO 3166-1 作为国家/地区代码。 维基百科文章包括:The correct country code is
en_GB
. Locales use ISO 3166-1 for country codes. The wikipedia writeup includes:这确实是一个常见的(?)错误。 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.
根据维基百科http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2。
所以显然这是一个已经卡住的旧东西或类似的东西。
编辑:马丁·克莱顿找到了更好的答案。
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.
你不能简单地发明语言环境!它们已经被定义了。所以“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.
由于某种原因,ISO 3166 中大不列颠及北爱尔兰联合王国的正确国家/地区代码是“GB”,因此区域设置代码应为 en_GB,而不是如上所述的 en_UK 此处。
en_GB 也被 glibc、gnome、kde 等使用。
而且我喜欢这样一个事实,即开源项目中的许多以前的错误修复都与此相关,如 apache http 1.3 和 roundcube 项目
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