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/
The lang attribute is an essential component in the basic structure of an HTML document. It's important that we define it correctly because it affects many aspects of user experience. Unfortunately, the negative effects a missing or wrong attribute can have aren't always evident.
For example, a declaration of <html lang="en"> tells the browser that all content on the page is English. lang subtags may also have a script or region designator, which allows you to specify either the language's writing system or geographic region.
Definition and Usage. The lang attribute specifies the language of the element's content. Common examples are "en" for English, "es" for Spanish, "fr" for French and so on.
The lang global attribute helps define the language of an element: the language that non-editable elements are written in, or the language that the editable elements should be written in by the user.
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 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With