问题
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>
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.
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: I think so, but I'd like to confirm with the knowledgeable folks here.
Based on: http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
Via: http://www.w3.org/International/articles/language-tags/
回答1:
Why not?
HTML5 (CR) defines that the "value must be a valid BCP 47 language tag, or the empty string".
BCP 47 defines that the "IANA Language Subtag Registry […] contains a comprehensive list of all of the subtags valid in language tags".
IANA Language Subtag Registry contains the subtag
EU
of typeregion
.
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.
来源:https://stackoverflow.com/questions/20722488/is-en-eu-a-valid-value-for-html-lang-attribute