[uievents] KeyboardEvent.locale is too general (#14)

Copied from W3C Bugzilla: https://www.w3.org/Bugs/Public/show_bug.cgi?id=21830

##### Travis Leithead [MSFT] 2013-04-25 19:28:30 UTC
The KeyboardEvent.locale property is underspecified. BCP-47 is too general, we need to get much more crip on what sub-set of these strings are reasonable and which are not.

Eg., there is a dvorak BCP-47 string. Should this be reported?

Goal should be to simplify the set.

##### Comment 1 Masayuki Nakano 2013-04-30 00:00:04 UTC
It's good timing. I tried implementing KeyboardEvent.locale and CompositionEvent.locale on Gecko.

Then, I worked on Windows and Mac. I think there is no API on Linux (except directly accessing IM framework such as iBus, SCIM). I'm still investigating about Android, though.

On Windows, we can make conversion table with:
http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx
 # I guess that IE 9 also used this table.

On Mac, we can get the language property of current TIS with kTISPropertyInputSourceLanguages.
https://developer.apple.com/library/mac/#documentation/TextFonts/Reference/TextInputSourcesReference/Reference/reference.html

Then, on Mac, we cannot return locale. E.g., cannot return en-US, can just return en.

And IE 10 returns "zh-CN" for simplified Chinese. However, on Mac, we can returns "zh-Hans". So, I have no idea to implement with good compatibility between platforms.

So, I'm now thinking that .locale is not useful for web developers under current spec.

##### Comment 2 Masayuki Nakano 2013-04-30 05:07:54 UTC
The draft patches for Gecko are here:
https://bugzilla.mozilla.org/show_bug.cgi?id=680832

##### Comment 3 Gary Kacmarcik 2013-05-17 18:09:00 UTC
We may want to move KeyboardEvent.locale into UI Events so that we can take the time to define it properly.

Nothing in D3E relies on KeyboardEvent.locale, but UI Events has a few methods that want to make use of it.

##### Comment 4 Gary Kacmarcik 2013-11-14 09:00:41 UTC
The locale attribute has been moved into UI Events.


---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/14

Received on Tuesday, 6 October 2015 22:45:00 UTC