'en-EU'是HTML'lang'属性的有效值吗? [英] Is 'en-EU' a valid value for HTML 'lang' attribute?
问题描述
我的新闻网站不同版本的标记......
Markup for different editions of my news site...
-
美国版:
US Edition:
<html lang="en-US" xml:lang="en-US"> ... </html>
印度版:
India Edition:
<html lang="en-IN" xml:lang="en-IN"> ... </html>
欧洲版(在这种情况下不是特定国家,即新闻涵盖更广泛的区域) :
Europe Edition (in this case not a specific country, i.e. news covers a broader region):
<html lang="en-EU" xml:lang="en-EU"> ... </html>
我取决于页面的标记使目标语言/页面区域对搜索引擎清晰,因为新闻站点的不同版本使用基于目录的路径(例如 example.com/eu /
)而不是基于路径的子域( eu.example.com
)或域(例如 example.eu
)。
I am depending on the markup of the page to make the target language/region of pages clear to the search engines because the different editions of the news site use a directory-based path (e.g. example.com/eu/
) rather than a sub-domain (eu.example.com
) or domain (e.g. example.eu
) based path.
现在, lang
属性的值可以是 语言区域
。但是 en-EU
是否有效值?
Now coming to the point, the lang
attribute can have a value that is of the format language-region
. But is en-EU
a valid value?
PS:我是这么认为的,但是我想在这里与知识渊博的人确认。
PS: I think so, but I'd like to confirm with the knowledgeable folks here.
通过: http://www.w3.org/International/articles/language-tags/
推荐答案
为什么不呢?
-
HTML5 (CR )定义 值必须是有效的BCP 47语言标记,或空字符串。
HTML5 (CR) defines that the "value must be a valid BCP 47 language tag, or the empty string".
BCP 47 定义IANA语言子标签注册表[...]包含语言标签中有效的所有子标签的完整列表。
BCP 47 defines that the "IANA Language Subtag Registry […] contains a comprehensive list of all of the subtags valid in language tags".
IANA语言子标签注册表 包含类型<$ c的子标签 EU
$ c>地区。
IANA Language Subtag Registry contains the subtag EU
of type region
.
这不是任何人正式定义在哪些地区使用语言变体或使用哪种语言变体。语言不断变化,说话者生活和死亡无处不在。
It’s not up to anyone to formally define if or which linguistic variations are spoken in which regions. Language changes constantly, speakers live and die everywhere.
这篇关于'en-EU'是HTML'lang'属性的有效值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!