This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23512 - API to expose actual language of a node, to aid scripts doing localisation and CJK editors during copy&paste and drag&drop
Summary: API to expose actual language of a node, to aid scripts doing localisation an...
Status: RESOLVED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other All
: P3 enhancement
Target Milestone: Needs Impl Interest
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-14 21:43 UTC by Ian 'Hixie' Hickson
Modified: 2017-07-21 11:01 UTC (History)
4 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2013-10-14 21:43:29 UTC
On Sat, 13 Jul 2013, Peter Occil wrote:
> > >
> > > a DOM attribute like "language" [...] since it's not currently
> > > possible to get the language of a node through JavaScript [...]
>
> 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.
>
> 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.
Comment 1 Ian 'Hixie' Hickson 2013-10-14 22:02:45 UTC
Another use case Ryosuke Niwa mentioned is editors; they need to know the language of text when copying or dragging or pasting or dropping, so that CJK text ends up rendered correctly.

See Ryosuke's e-mails here:
   http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Aug/0015.html
   http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Aug/0093.html
   http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Aug/0152.html
Comment 2 Ian 'Hixie' Hickson 2013-11-27 23:56:27 UTC
See also comments from Elliott, dbaron, and Anne, which talk about how this is implemented as an internal CSS property by browsers and the implications thereof:
   http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Sep/0199.html
   http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Sep/0201.html
Comment 3 Anne 2016-03-22 14:49:10 UTC
Main problem I see: I don't see how this squares with WebKit/Chromium's strategy of doing language inheritance through CSS.
Comment 4 Anne 2017-07-21 11:01:07 UTC
If this is still desired, please file a new issue at https://github.com/whatwg/html/issues/new.