After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729210 - xkb parsing gives very bizarre list of keyboard layouts for "English (Canada)"
xkb parsing gives very bizarre list of keyboard layouts for "English (Canada)"
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
3.12.x
Other Linux
: Normal major
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-29 18:02 UTC by Adam Williamson
Modified: 2014-12-03 08:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnome-xkb-info: Fix adding layouts to language and country tables (1.27 KB, patch)
2014-08-28 17:41 UTC, Rui Matos
committed Details | Review

Description Adam Williamson 2014-04-29 18:02:24 UTC
I just ran an install of the current Fedora Rawhide nightly (20140428). I created no user during Fedora install, so on boot, I got the 'no user account yet' incarnation of gnome-initial-setup. gis version is 3.12.0-1.

After picking English as my language and Canada as my location, I got a list of keyboard layouts to choose from which seemed rather bizarre: "English (Dvorak alternative international no dead keys)", "English (Ghana, GILLBT)", "English (Mali, US international)", "English (US, with euro on 5)", "Filipino (Capewall-Dvorak Latin)", "Filipino (Capewell-QWERF 2006 Latin)", and that was the full 'initial' set (the ... is below that last entry).

The layout I chose during Fedora install (US English) is not included in the list at all.

Clicking ... brings up a bunch of other English layouts including (but not highlighting) the layout chosen during Fedora installation, US English. But it's not *all* English layouts, and does not include English (Canada), which you'd kinda expect. It also, for some reason, includes Filipino, Irish, Irish (UnicodeExpert) and Serbo-Croatian (US), but not Canadian French.

Looking at langtable (at least current git master) I can't see any reasonable explanation for the layouts that are listed. It's not just listing all keyboards associated with the language "English" in keyboards.xml - otherwise it'd include English (Canada). It's clearly not prioritising the layouts associated with the territory "Canada" from territories.xml, because that list is just ca(eng) followed by ca. (I'd expect ca(fr) to be in there somewhere, but hey.)

Now I look, you get the same weird list of layouts if on a running system you try to add a new input source, search for "canad", and look at the list of layouts listed under "English (Canada)". Again, all the weird Cameroon and Ghana and Filipino and Irish stuff, but not English (Canada), which for some bizarre reason is down the bottom under "Other".

It looks like g-i-s and gcc are using libgnome-desktop's gnome-xkb-info for this, and it's not really doing a terribly good job. They should probably be using langtable - https://github.com/mike-fabian/langtable - and contributing any improvements necessary to that.
Comment 1 Rui Matos 2014-08-28 17:41:48 UTC
Created attachment 284729 [details] [review]
gnome-xkb-info: Fix adding layouts to language and country tables

Layout->xkb_name isn't unique so we can't use it as a key in the hash
table. Layout->id is the unique identifier that we should be using,
otherwise some layouts would never get added.
--

Using langtable is a good idea but will have to wait for now.
Comment 2 Rui Matos 2014-08-29 15:04:51 UTC
Attachment 284729 [details] pushed as b18bd36 - gnome-xkb-info: Fix adding layouts to language and country tables
Comment 3 Adam Williamson 2014-10-22 15:48:24 UTC
is this supposed to be in 3.14? IIRC I still get a weird list of layouts when I pick Canada as the location.
Comment 4 Matthias Clasen 2014-10-23 17:26:36 UTC
Can you list the layouts you get, and explain whats weird about them ?
Comment 5 Adam Williamson 2014-10-23 17:56:45 UTC
In F21 Beta TC4 the layouts you get when picking English (Canadian) as the locale are:

Cameroon Multilingual (qwerty)
English (Dvorak)
English (UK, Macintosh)
English (US, international with dead keys)
English (Workman)
English (programmer Dvorak)

the only one of those that's at all similar to the layout 99% of Canadians have - which would be "English (US)" - is "English (US, international with dead keys)", but even that isn't what most people want, most people aren't used to using the dead key system and it'd only be likely to confuse them.

The others, well, it seems pretty obvious? I've no idea what a Workman is but I'm pretty sure I don't want it, Dvorak is great for a practical joke, and Cameroon, well...
Comment 6 Adam Williamson 2014-10-23 19:51:27 UTC
Oh, one thing that may not be obvious to outsiders, I'd strongly expect some kind of French-y layout to be in there, for Quebec. I don't actually know specifically which layouts are most common in Quebec - there is a "Canadian French" layout, but I don't remember if it's actually particularly commonly used, or if they usually have regular French layouts, or what. Seems like the kind of thing langtable would know!
Comment 7 Adam Williamson 2014-12-03 08:52:36 UTC
This looks a lot better in F21 Final, I lost track of exactly what we changed in the meantime, but I tried a few different language installs and the layout lists seemed sensible.