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

There are several use cases:

- Localization of form controls in languages where browser support
is lacking, such as some minor languages.
- Localization of HTML elements, especially date formatting of span
  and div elements in the page's default language, see especially [1].

When it comes to retrieving the language of an element, a JavaScript 
implementation can do everything except retrieve the value of the 
Content-Language header of the document, so even providing a DOM attribute 
like "contentLanguage" will resolve this issue.

[1]: 
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#input-impl-notes

-----Original Message----- 
From: Ian Hickson
Sent: Saturday, July 13, 2013 11:39 AM
To: Peter Occil
Cc: WHATWG
Subject: Re: [whatwg] HTML: A DOM attribute that returns the language of a 
node

On Fri, 12 Jul 2013, Peter Occil wrote:
>
> Well, my true hope is that such a DOM attribute like "language" will be
> specified in the HTML or DOM spec.  Especially since it's not currently
> possible to get the language of a node through JavaScript methods alone.

What's the use case for having this in HTML?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.' 

Received on Saturday, 13 July 2013 16:05:31 UTC