Bug 313082 - Unhelpful language entries in layout selection dialog
Summary: Unhelpful language entries in layout selection dialog
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard_layout (show other bugs)
Version: 4.9.5
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Andriy Rysin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-11 14:59 UTC by Pierre Buard
Modified: 2013-03-08 20:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.10.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Buard 2013-01-11 14:59:44 UTC
The language based filter in the "Add Layout" dialog contains 4 cryptic entries at the list end. They should be renamed for consistency.

In the "Layouts" tab of the keyboard settings, pressing "Add" brings up a dialog where one can limit the results to a particular language. Browsing this list to the end reveals 4 coded lower case entries: fr, mng, scr and trv.

"fr" is a duplicate of the "French" entry and should be merged with it.
The others must be renamed as:
- mng: "Mongolian",
- scr: "Serbo-Croatian",
- trv: "Taiwanese" or even "Taiwanese Mandarin".
Comment 1 Christoph Feck 2013-01-12 13:19:50 UTC
On my system, the list of languages is simply a list of three-letter codes, i.e. no language is displayed with its correct name.
Comment 2 Andriy Rysin 2013-01-12 14:15:39 UTC
Language codes provided by xkeyboard-config project, the codes are in iso639 standard and should be 3-letter, so "fr" is a bug in xkeyboard-config (you can file a bug for it at freedesktop.org).
Language names are provide by iso-codes project, if some codes don't get proper name you need to update iso-codes and if it's still a problem file a bug against it.
Comment 3 Christoph Feck 2013-01-22 02:40:04 UTC
After installing iso-codes package, I see the same issues as the reporter, but as indicated, this is not a KDE bug.
Comment 4 Pierre Buard 2013-01-31 20:01:34 UTC
Back to square one.
After investigating both iso-codes and xkeyboard-config, here's what I gathered:
- the mng, scr and trv were erroneous entries that are being corrected in xkeyboard-config. They will become mon, hrv and fox. It still doesn't explain why, in the language filter list, they where not correctly parsed to begin with since the xml databases appear to be valid in both projects.
- likewise, the "fr" duplicate couldn't be identified as an upstream bug. In KDE, it contains 2 entries: French (Canada) and Bambara. The Canadian layout and its variants are a complete duplicate of the ones found under the French language entry, while the Bambara layout, "French (Mali, alternative)" variant is not listed under the Bambara or French languages.

So either there's a third unidentified source being polled to establish the languages list or something is wrong with the KDE parser.


Tests performed with iso-codes 3.40, xkeyboard-config 2.8 and KDE 4.9.5.

Upstream bug reports:
xkeyboard-config <https://bugs.freedesktop.org/show_bug.cgi?id=59840>
iso-codes <https://alioth.debian.org/tracker/index.php?func=detail&aid=313984&group_id=30316&atid=413077>
Comment 5 Andriy Rysin 2013-02-01 00:18:07 UTC
For right or for wrong kcm_keyboard uses iso639.xml which is ISO639 standard (http://www.loc.gov/standards/iso639-2) and it tries both _2B and _2T codes.
Those three missing codes are only present in ISO 639-3 (http://www.sil.org/iso639-3/).

Also a two-letter language code "fr" is only present in one entry in xkeyboard-config:
            <description>French (Mali, alternative)</description>
            <languageList>
              <iso639Id>fr</iso639Id>
            </languageList>

for other layouts that describe French three-letter "fra" is used. I would think that Mali layout should also use "fra", as we could use ISO639_1 codes to parse this one but it does not make much sense to have only one two-letter language code for language that is represented by 3-letter code everywhere else, so I would say it should be also fixed in xkeyboard-config.
Comment 6 Andriy Rysin 2013-02-01 00:44:30 UTC
I've talked to xkeyboard-config maintainer and he fixed "fr": http://cgit.freedesktop.org/xkeyboard-config/tree/rules/base.xml.in
Comment 7 Pierre Buard 2013-02-01 09:06:02 UTC
Thank you for double-checking. Too much back and forth between each database...

That still leaves the duplicated "French (Canada)" layout which was and still is using a 3-letter code:
        <_description>French (Canada)</_description>
        <languageList>
          <iso639Id>fra</iso639Id>
        </languageList>
Apart from the ubiquitous <_shortDescription>fr</_shortDescription> (and apparently harmless in our case), I don't see why it would be the only French layout to go under the "fr" language. It's not the absence of an "iso639Id" tag for each variant because the French and Belgian ones would also be duplicated. It's all very confusing...

And since kcm_keyboard doesn't use ISO 639-3, then there will still be a coded entry for "Taiwanese", i.e. "fox" (Taiwanese not being a "real" language, it has no ISO code - it is actually composed of a myriad of indigenous languages grouped under the "Formosan" umbrella).
Comment 8 Pierre Buard 2013-02-01 10:37:17 UTC
After compiling xkeyboard-config from git, I can confirm that the only remaining coded entries are "fox" and "fr".
Comment 9 Andriy Rysin 2013-02-02 03:46:21 UTC
ok, "fr" is coming from base.extras.xml, that should be fixed in xkeyboard-config - I've sent an email to its maintainer

"fox" is only present in ISO639-3 (not in ISO639-2), so the only way to fix it is to switch using -3 standard, I have a patch which fixes the problem but I think KDE 4.10 branch is frozen now, we'll have to wait
Comment 10 Andriy Rysin 2013-02-07 03:44:59 UTC
Git commit fbb8d67cf445a6ca1617ad25ee22dcee2c7f62f7 by Andriy Rysin.
Committed on 07/02/2013 at 03:52.
Pushed by rysin into branch 'KDE/4.10'.

Use ISO639-3 to get language names
FIXED-IN: 4.10.1

M  +6    -4    kcontrol/keyboard/iso_codes.cpp
M  +6    -4    kcontrol/keyboard/iso_codes.h
M  +6    -5    kcontrol/keyboard/kcm_add_layout_dialog.cpp
M  +16   -0    kcontrol/keyboard/tests/config/base.1.1.xml
M  +20   -6    kcontrol/keyboard/tests/iso_codes_test.cpp

http://commits.kde.org/kde-workspace/fbb8d67cf445a6ca1617ad25ee22dcee2c7f62f7
Comment 11 Pierre Buard 2013-03-08 20:29:50 UTC
Thank you, it's now working as expected in 4.10.1.
Good job!