[whatwg] HTML: A DOM attribute that returns the language of a node

Peter Occil poccil14 at gmail.com
Wed Apr 24 09:22:21 PDT 2013

I have no objection to the name "baseLang" rather than "language" as the 
name of the DOM attribute.

But if there isn't more interest or you decide not to add this DOM 
attribute, I encourage you to at least:

* define a DOM attribute to get the value of the document's Content-Language 
header (or other fallback language), or if that's not acceptable,
* change the definition of the language of an HTML node to remove the 
requirement to use the document's Content-Language header, or if that's not 
* change section 3.3 of HTML+RDFa to say, for example, that only information 
in the "lang" and "xml:lang" attributes are relevant for determining 
language for the purposes of HTML+RDFa.

With any of these three alternatives, I can live with doing tree traversal 
for finding the language of a node, both in my Java/C# DOM and (if I get 
around to it) in JavaScript.  Especially the last two may be viable if it 
turns out that people use the Content-Language header even less than people 
use the "lang" and "xml:lang" attributes on HTML and XHTML documents.


In the meantime, is it advisable for me to extend my Java/C# DOM by adding a 
"getLanguage" method?  (See my previous message for context.)


-----Original Message----- 
From: Anne van Kesteren
Sent: Wednesday, April 24, 2013 10:03 AM
To: Peter Occil
Subject: Re: [whatwg] HTML: A DOM attribute that returns the language of a 

On Wed, Apr 24, 2013 at 6:49 AM, Peter Occil <poccil14 at gmail.com> wrote:
> While a "language" attribute on Node may also be useful to
> HTML+RDFa processors in JavaScript, I have no plans to implement
> such a processor in JavaScript, though.

There's https://www.w3.org/Bugs/Public/show_bug.cgi?id=16489 fwiw.
Interest thus far seems fairly low, prolly due to what Kenny mentioned
with people not doing much language tagging at all.


More information about the whatwg mailing list