Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
    

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/

like image 757
its_me Avatar asked Dec 21 '13 19:12

its_me


People also ask

Is html lang en necessary?

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.

What does the attribute lang =' en tell the browser?

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.

What is lang en in html?

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.

What is the purpose of lang en GB attribute in html?

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.


1 Answers

Why not?

  1. HTML5 (CR) defines that the "value must be a valid BCP 47 language tag, or the empty string".

  2. BCP 47 defines that the "IANA Language Subtag Registry […] contains a comprehensive list of all of the subtags valid in language tags".

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

like image 79
unor Avatar answered Sep 18 '22 13:09

unor