Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak keyboard descriptions #5338

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

AdamWill
Copy link
Contributor

Two changes with the effect that we prepend a language or country string to the evdev layout+variant description much less often. A lot of the cases where we do this are bogus and lead to confusing or redundant strings.

As reported in https://bugzilla.redhat.com/show_bug.cgi?id=2250388
we often prepend an apparently-random language to the keyboard
layout+variant description we get from evdev, with sometimes
bizarre results.

This happens when a layout+variant is associated with more than
one language: we effectively pick just one of those languages at
random to "care about", and if the evdev description for the
layout+variant doesn't start with the name of that language, we
prepend it. This gives bizarre results like the one reported in
the bug - "French (English (intl., with AltGr dead keys))".

To avoid this, let's just keep track of *all* the languages a
layout+variant is associated with, and if there's more than one,
we'll not try to do anything clever, we'll just use the evdev
description. We'll only ever prepend a language or country name
if a layout+variant is associated with only one language, or no
languages and at least one country.

Resolves: rhbz#2250388

Signed-off-by: Adam Williamson <[email protected]>
@AdamWill
Copy link
Contributor Author

I'll flag up one possibly-controversial change this causes: it changes the description for the tw layout from "Taiwan, Province of China (Taiwanese)" to just "Taiwanese" (and similarly for variants of tw).

We should be careful any time we touch a string like that, but I don't think this change is actually too provocative, because we're not making any claims or characterizations anyone would disagree with, I don't think. I think it's uncontroversial to refer to the keyboard layout as "Taiwanese", which is all we're doing here. The text description here is not a description of a place or anything potentially divisive like that, just a keyboard layout.

I also hacked this logic into a test script which just dumps out the full list of layouts and descriptions so you can see the effects of the changes. Here are the outputs at various stages:

More details on the 'more radical' one - the difference there is that when we encounter a layout only by country, we store it with an empty langs list, not with the first country name we encounter. That ensures we only ever prepend language names, not country names, as I had an idea it was never really right to consider the country names. But after I tried that and diffed the changes, I didn't love them, it seems like it is sometimes useful to prepend a country name. So I prefer this more conservative version.

I definitely feel like the "both changes" output is the best, which is why I proposed the PR this way, but wanted to provide the data for people to look through and spot any potential issues in.

@AdamWill
Copy link
Contributor Author

AdamWill commented Nov 21, 2023

For the record, the full diff from original code to this PR is as follows. In case it's not obvious, the format of the lines is layout (variant): description

--- /run/media/adamw/STORAGE/orig.txt	2023-11-20 09:54:48.000000000 -0800
+++ /run/media/adamw/STORAGE/country-firstword.txt	2023-11-20 09:54:48.000000000 -0800
@@ -15,11 +15,11 @@
 us (rus): Russian (US, phonetic)
 ge (ru): Russian (Georgia)
 de (ru): Russian (Germany, phonetic)
-kz (kazrus): Russian (Kazakh (with Russian))
+kz (kazrus): Kazakh (with Russian)
 kz (ruskaz): Russian (Kazakhstan, with Kazakh)
 pl (ru_phonetic_dvorak): Russian (Poland, phonetic Dvorak)
 br (rus): Russian (Brazil, phonetic)
-ru (srp): Russian (Serbian (Russia))
+ru (srp): Serbian (Russia)
 se (rus): Russian (Sweden, phonetic)
 ru (phonetic): Russian (phonetic)
 ru (phonetic_winkeys): Russian (phonetic, Windows)
@@ -43,24 +43,24 @@
 in (tel): Telugu
 in (tel-kagapa): Telugu (KaGaPa, phonetic)
 in (tel-sarala): Telugu (Sarala)
-in: Maithili (Indian)
+in: Indian
 us (haw): Hawaiian
-id: Achinese (Indonesian (Latin))
-my: Achinese (Malay (Jawi, Arabic Keyboard))
-id (melayu-phonetic): Achinese (Indonesian (Arab Melayu, phonetic))
-id (melayu-phoneticx): Achinese (Indonesian (Arab Melayu, extended phonetic))
-id (pegon-phonetic): Achinese (Indonesian (Arab Pegon, phonetic))
-id (javanese): Achinese (Javanese)
-my (phonetic): Achinese (Malay (Jawi, phonetic))
-bd: Bengali (Bangla)
-in (ben): Bengali (Bangla (India))
-in (ben_probhat): Bengali (Bangla (India, Probhat))
-in (ben_baishakhi): Bengali (Bangla (India, Baishakhi))
-in (ben_bornona): Bengali (Bangla (India, Bornona))
-in (ben-kagapa): Bengali (Bangla (India, KaGaPa, phonetic))
-in (ben_gitanjali): Bengali (Bangla (India, Gitanjali))
-in (ben_inscript): Bengali (Bangla (India, Baishakhi InScript))
-bd (probhat): Bengali (Bangla (Probhat))
+id: Indonesian (Latin)
+my: Malay (Jawi, Arabic Keyboard)
+id (melayu-phonetic): Indonesian (Arab Melayu, phonetic)
+id (melayu-phoneticx): Indonesian (Arab Melayu, extended phonetic)
+id (pegon-phonetic): Indonesian (Arab Pegon, phonetic)
+id (javanese): Javanese
+my (phonetic): Malay (Jawi, phonetic)
+bd: Bangla
+in (ben): Bangla (India)
+in (ben_probhat): Bangla (India, Probhat)
+in (ben_baishakhi): Bangla (India, Baishakhi)
+in (ben_bornona): Bangla (India, Bornona)
+in (ben-kagapa): Bangla (India, KaGaPa, phonetic)
+in (ben_gitanjali): Bangla (India, Gitanjali)
+in (ben_inscript): Bangla (India, Baishakhi InScript)
+bd (probhat): Bangla (Probhat)
 ge: Georgian
 fr (geo): Georgian (France, AZERTY Tskapo)
 it (geo): Georgian (Italy)
@@ -69,33 +69,33 @@
 in (ori): Oriya
 in (ori-bolnagri): Oriya (Bolnagri)
 in (ori-wx): Oriya (Wx)
-it (intl): Neapolitan (Italian (intl., with dead keys))
-cm (qwerty): Duala (Cameroon Multilingual (QWERTY, intl.))
-cm (azerty): Duala (Cameroon (AZERTY, intl.))
+it (intl): Italian (intl., with dead keys)
+cm (qwerty): Cameroon Multilingual (QWERTY, intl.)
+cm (azerty): Cameroon (AZERTY, intl.)
 cn (tib): Tibetan
 cn (tib_asciinum): Tibetan (with ASCII numerals)
 ru (chm): Mari
-ph: Hiligaynon (Filipino)
-ph (qwerty-bay): Hiligaynon (Filipino (QWERTY, Baybayin))
-ph (capewell-dvorak-bay): Hiligaynon (Filipino (Capewell-Dvorak, Baybayin))
-ph (capewell-qwerf2k6-bay): Hiligaynon (Filipino (Capewell-QWERF 2006, Baybayin))
-ph (colemak-bay): Hiligaynon (Filipino (Colemak, Baybayin))
-ph (dvorak-bay): Hiligaynon (Filipino (Dvorak, Baybayin))
-ph (capewell-dvorak): Hiligaynon (Filipino (Capewell-Dvorak, Latin))
-ph (capewell-qwerf2k6): Hiligaynon (Filipino (Capewell-QWERF 2006, Latin))
-ph (colemak): Hiligaynon (Filipino (Colemak, Latin))
-ph (dvorak): Hiligaynon (Filipino (Dvorak, Latin))
+ph: Filipino
+ph (qwerty-bay): Filipino (QWERTY, Baybayin)
+ph (capewell-dvorak-bay): Filipino (Capewell-Dvorak, Baybayin)
+ph (capewell-qwerf2k6-bay): Filipino (Capewell-QWERF 2006, Baybayin)
+ph (colemak-bay): Filipino (Colemak, Baybayin)
+ph (dvorak-bay): Filipino (Dvorak, Baybayin)
+ph (capewell-dvorak): Filipino (Capewell-Dvorak, Latin)
+ph (capewell-qwerf2k6): Filipino (Capewell-QWERF 2006, Latin)
+ph (colemak): Filipino (Colemak, Latin)
+ph (dvorak): Filipino (Dvorak, Latin)
 bg: Bulgarian
 bg (phonetic): Bulgarian (traditional phonetic)
 bg (bas_phonetic): Bulgarian (new phonetic)
 bg (bekl): Bulgarian (enhanced)
 md: Romanian; Moldavian; Moldovan (Moldavian)
-ro: Romanian; Moldavian; Moldovan (Romanian)
-de (ro): Romanian; Moldavian; Moldovan (Romanian (Germany))
-de (ro_nodeadkeys): Romanian; Moldavian; Moldovan (Romanian (Germany, no dead keys))
-ro (std): Romanian; Moldavian; Moldovan (Romanian (standard))
-ro (winkeys): Romanian; Moldavian; Moldovan (Romanian (Windows))
-ru (xal): Kalmyk; Oirat (Kalmyk)
+ro: Romanian
+de (ro): Romanian (Germany)
+de (ro_nodeadkeys): Romanian (Germany, no dead keys)
+ro (std): Romanian (standard)
+ro (winkeys): Romanian (Windows)
+ru (xal): Kalmyk
 tm: Turkmen
 tm (alt): Turkmen (Alt-Q)
 ru (bak): Bashkirian
@@ -104,14 +104,14 @@
 in (mal_lalitha): Malayalam (Lalitha)
 in (mal_enhanced): Malayalam (enhanced InScript, with rupee)
 in (mal_poorna): Malayalam (Poorna, extended InScript)
-lk: Sinhala; Sinhalese (Sinhala (phonetic))
-lk (us): Sinhala; Sinhalese (Sinhala (US))
+lk: Sinhala (phonetic)
+lk (us): Sinhala (US)
 ca (ike): Inuktitut
 epo: Esperanto
 pt (nativo-epo): Esperanto (Portugal, Nativo)
 br (nativo-epo): Esperanto (Brazil, Nativo)
 epo (legacy): Esperanto (legacy)
-be: French (Belgian)
+be: Belgian
 dz: French (Berber (Algeria, Latin))
 fr: French
 ca: French (Canada)
@@ -120,15 +120,15 @@
 ma (french): French (Morocco)
 ml (fr-oss): French (Mali, alt.)
 cm (french): French (Cameroon)
-us (altgr-intl): French (English (intl., with AltGr dead keys))
+us (altgr-intl): English (intl., with AltGr dead keys)
 ch (fr): French (Switzerland)
 ch (fr_nodeadkeys): French (Switzerland, no dead keys)
 ch (fr_mac): French (Switzerland, Macintosh)
-be (oss): French (Belgian (alt.))
-be (oss_latin9): French (Belgian (Latin-9 only, alt.))
-be (iso-alternate): French (Belgian (ISO, alt.))
-be (nodeadkeys): French (Belgian (no dead keys))
-be (wang): French (Belgian (Wang 724 AZERTY))
+be (oss): Belgian (alt.)
+be (oss_latin9): Belgian (Latin-9 only, alt.)
+be (iso-alternate): Belgian (ISO, alt.)
+be (nodeadkeys): Belgian (no dead keys)
+be (wang): Belgian (Wang 724 AZERTY)
 fr (nodeadkeys): French (no dead keys)
 fr (oss): French (alt.)
 fr (oss_nodeadkeys): French (alt., no dead keys)
@@ -160,29 +160,29 @@
 kr: Korean
 kr (kr104): Korean (101/104-key compatible)
 ml: Bambara
-ma (tifinagh): Berber languages (Berber (Morocco, Tifinagh))
-ma (tifinagh-alt): Berber languages (Berber (Morocco, Tifinagh alt.))
-ma (tifinagh-alt-phonetic): Berber languages (Berber (Morocco, Tifinagh phonetic, alt.))
-ma (tifinagh-extended): Berber languages (Berber (Morocco, Tifinagh extended))
-ma (tifinagh-phonetic): Berber languages (Berber (Morocco, Tifinagh phonetic))
-ma (tifinagh-extended-phonetic): Berber languages (Berber (Morocco, Tifinagh extended phonetic))
-gb (gla): Gaelic; Scottish Gaelic (Scottish Gaelic)
-ke (kik): Kikuyu; Gikuyu (Kikuyu)
+ma (tifinagh): Berber (Morocco, Tifinagh)
+ma (tifinagh-alt): Berber (Morocco, Tifinagh alt.)
+ma (tifinagh-alt-phonetic): Berber (Morocco, Tifinagh phonetic, alt.)
+ma (tifinagh-extended): Berber (Morocco, Tifinagh extended)
+ma (tifinagh-phonetic): Berber (Morocco, Tifinagh phonetic)
+ma (tifinagh-extended-phonetic): Berber (Morocco, Tifinagh extended phonetic)
+gb (gla): Scottish Gaelic
+ke (kik): Kikuyu
 de (dsb): Lower Sorbian
 de (dsb_qwertz): Lower Sorbian (QWERTZ)
 it: Italian
-it (scn): Italian (Sicilian)
+it (scn): Sicilian
 it (nodeadkeys): Italian (no dead keys)
 it (winkeys): Italian (Windows)
 it (mac): Italian (Macintosh)
 it (us): Italian (US)
 it (ibm): Italian (IBM 142)
-es (cat): Catalan; Valencian (Catalan (Spain, with middle-dot L))
-gr: Greek, Modern (1453-) (Greek)
-gr (simple): Greek, Modern (1453-) (Greek (simple))
-gr (extended): Greek, Modern (1453-) (Greek (extended))
-gr (nodeadkeys): Greek, Modern (1453-) (Greek (no dead keys))
-gr (polytonic): Greek, Modern (1453-) (Greek (polytonic))
+es (cat): Catalan (Spain, with middle-dot L)
+gr: Greek
+gr (simple): Greek (simple)
+gr (extended): Greek (extended)
+gr (nodeadkeys): Greek (no dead keys)
+gr (polytonic): Greek (polytonic)
 dz (ber): Kabyle (Berber (Algeria, Tifinagh))
 dz (azerty-deadkeys): Kabyle (AZERTY, with dead keys)
 dz (qwerty-gb-deadkeys): Kabyle (QWERTY, UK, with dead keys)
@@ -197,7 +197,7 @@
 lk (tam_TAB): Tamil (Sri Lanka, TamilNet '99, TAB encoding)
 me: Serbian (Montenegrin)
 rs: Serbian
-us (hbs): Serbian (Serbo-Croatian (US))
+us (hbs): Serbo-Croatian (US)
 me (cyrillic): Serbian (Montenegrin (Cyrillic))
 me (cyrillicyz): Serbian (Montenegrin (Cyrillic, ZE and ZHE swapped))
 me (cyrillicalternatequotes): Serbian (Montenegrin (Cyrillic, with guillemets))
@@ -221,10 +221,10 @@
 az: Azerbaijani
 az (cyrillic): Azerbaijani (Cyrillic)
 cn (ug): Uighur; Uyghur (Uyghur)
-ch: Swiss German; Alemannic; Alsatian (German (Switzerland))
-ch (de_nodeadkeys): Swiss German; Alemannic; Alsatian (German (Switzerland, no dead keys))
-ch (de_mac): Swiss German; Alemannic; Alsatian (German (Switzerland, Macintosh))
-ch (legacy): Swiss German; Alemannic; Alsatian (German (Switzerland, legacy))
+ch: German (Switzerland)
+ch (de_nodeadkeys): German (Switzerland, no dead keys)
+ch (de_mac): German (Switzerland, Macintosh)
+ch (legacy): German (Switzerland, legacy)
 kz: Kazakh
 kz (ext): Kazakh (extended)
 kz (latin): Kazakh (Latin)
@@ -245,7 +245,7 @@
 sk (bksl): Slovak (extra backslash)
 sk (qwerty): Slovak (QWERTY)
 sk (qwerty_bksl): Slovak (QWERTY, extra backslash)
-fr (oci): Occitan (post 1500); Provençal (Occitan)
+fr (oci): Occitan
 mm: Burmese
 mm (zawgyi): Burmese (Zawgyi)
 ir: Persian
@@ -260,9 +260,9 @@
 no (colemak_dh): Norwegian (Colemak-DH)
 no (colemak_dh_wide): Norwegian (Colemak-DH Wide)
 no (dvorak): Norwegian (Dvorak)
-ua (crh): Crimean Tatar; Crimean Turkish (Crimean Tatar (Turkish Q))
-ua (crh_f): Crimean Tatar; Crimean Turkish (Crimean Tatar (Turkish F))
-ua (crh_alt): Crimean Tatar; Crimean Turkish (Crimean Tatar (Turkish Alt-Q))
+ua (crh): Crimean Tatar (Turkish Q)
+ua (crh_f): Crimean Tatar (Turkish F)
+ua (crh_alt): Crimean Tatar (Turkish Alt-Q)
 custom: Undetermined (A user-defined custom Layout)
 ie (CloGaelach): Irish (CloGaelach)
 in (mar-kagapa): Marathi (KaGaPa, phonetic)
@@ -271,10 +271,10 @@
 mt (us): Maltese (US)
 mt (alt-us): Maltese (US, with AltGr overrides)
 mt (alt-gb): Maltese (UK, with AltGr overrides)
-nl: Dutch; Flemish (Dutch)
-nl (us): Dutch; Flemish (Dutch (US))
-nl (mac): Dutch; Flemish (Dutch (Macintosh))
-nl (std): Dutch; Flemish (Dutch (standard))
+nl: Dutch
+nl (us): Dutch (US)
+nl (mac): Dutch (Macintosh)
+nl (std): Dutch (standard)
 tr: Turkish
 de (tr): Turkish (Germany)
 tr (f): Turkish (F)
@@ -339,8 +339,8 @@
 af (ps-olpc): Pushto; Pashto (Pashto (Afghanistan, OLPC))
 la: Lao
 la (stea): Lao (STEA)
-cn (mon_trad_manchu): Manchu (Mongolian (Manchu))
-cn (mon_manchu_galik): Manchu (Mongolian (Manchu Galik))
+cn (mon_trad_manchu): Mongolian (Manchu)
+cn (mon_manchu_galik): Mongolian (Manchu Galik)
 pl: Polish
 gb (pl): Polish (British keyboard)
 pl (legacy): Polish (legacy)
@@ -350,10 +350,10 @@
 pl (dvorak_altquotes): Polish (Dvorak, with Polish quotes on key 1)
 pl (dvp): Polish (programmer Dvorak)
 ru (tt): Tatar
-fi (smi): Northern Sami (Northern Saami (Finland))
-no (smi): Northern Sami (Northern Saami (Norway))
-no (smi_nodeadkeys): Northern Sami (Northern Saami (Norway, no dead keys))
-se (smi): Northern Sami (Northern Saami (Sweden))
+fi (smi): Northern Saami (Finland)
+no (smi): Northern Saami (Norway)
+no (smi_nodeadkeys): Northern Saami (Norway, no dead keys)
+se (smi): Northern Saami (Sweden)
 in (san-kagapa): Sanskrit (KaGaPa, phonetic)
 nz (mao): Maori
 it (fur): Friulian (Italy)
@@ -375,16 +375,16 @@
 ua (homophonic): Ukrainian (homophonic)
 ie (ogam): Irish, Old (to 900) (Ogham)
 ie (ogam_is434): Irish, Old (to 900) (Ogham (IS434))
-es: Spanish; Castilian (Spanish)
-latam: Spanish; Castilian (Spanish (Latin American))
-es (nodeadkeys): Spanish; Castilian (Spanish (no dead keys))
-es (deadtilde): Spanish; Castilian (Spanish (dead tilde))
-es (winkeys): Spanish; Castilian (Spanish (Windows))
-es (dvorak): Spanish; Castilian (Spanish (Dvorak))
-latam (nodeadkeys): Spanish; Castilian (Spanish (Latin American, no dead keys))
-latam (deadtilde): Spanish; Castilian (Spanish (Latin American, dead tilde))
-latam (dvorak): Spanish; Castilian (Spanish (Latin American, Dvorak))
-latam (colemak): Spanish; Castilian (Spanish (Latin American, Colemak))
+es: Spanish
+latam: Spanish (Latin American)
+es (nodeadkeys): Spanish (no dead keys)
+es (deadtilde): Spanish (dead tilde)
+es (winkeys): Spanish (Windows)
+es (dvorak): Spanish (Dvorak)
+latam (nodeadkeys): Spanish (Latin American, no dead keys)
+latam (deadtilde): Spanish (Latin American, dead tilde)
+latam (dvorak): Spanish (Latin American, Dvorak)
+latam (colemak): Spanish (Latin American, Colemak)
 mm (shn): Shan
 mm (zgt): Shan (Zawgyi)
 dk: Danish
@@ -450,7 +450,7 @@
 br (thinkpad): Portuguese (Brazil, IBM/Lenovo ThinkPad)
 ke: Swahili (Kenya)
 tz: Swahili (Tanzania)
-es (ast): Asturian; Bable; Leonese; Asturleonese (Asturian (Spain, with bottom-dot H and L))
+es (ast): Asturian (Spain, with bottom-dot H and L)
 np: Nepali
 si: Slovenian
 si (alternatequotes): Slovenian (with guillemets)
@@ -554,32 +554,32 @@
 vn: Vietnamese
 vn (us): Vietnamese (US)
 vn (fr): Vietnamese (France)
-ge (os): Ossetian; Ossetic (Ossetian (Georgia))
-ru (os_legacy): Ossetian; Ossetic (Ossetian (legacy))
-ru (os_winkeys): Ossetian; Ossetic (Ossetian (Windows))
+ge (os): Ossetian (Georgia)
+ru (os_legacy): Ossetian (legacy)
+ru (os_winkeys): Ossetian (Windows)
 pk (snd): Sindhi
 by: Belarusian
 by (legacy): Belarusian (legacy)
 by (latin): Belarusian (Latin)
 by (intl): Belarusian (intl.)
 by (phonetic): Belarusian (phonetic)
-tw: Taiwan, Province of China (Taiwanese)
-tw (indigenous): Taiwan, Province of China (Taiwanese (indigenous))
-tw (saisiyat): Taiwan, Province of China (Saisiyat (Taiwan))
+tw: Taiwanese
+tw (indigenous): Taiwanese (indigenous)
+tw (saisiyat): Saisiyat (Taiwan)
 cn (mon_trad): China (Mongolian (Bichig))
 cn (mon_trad_todo): China (Mongolian (Todo))
 cn (mon_trad_xibe): China (Mongolian (Xibe))
 cn (mon_trad_galik): China (Mongolian (Galik))
 cn (mon_todo_galik): China (Mongolian (Todo Galik))
-md (gag): Moldova, Republic of (Gagauz (Moldova))
+md (gag): Gagauz (Moldova)
 lt (sgs): Lithuania (Samogitian)
 mm (mnw-a1): Myanmar (Mon (A1))
 gh (avn): Ghana (Avatime)
 pl (szl): Poland (Silesian)
 se (swl): Sweden (Swedish Sign Language)
 af: Afghanistan (Dari)
-af (fa-olpc): Afghanistan (Dari (Afghanistan, OLPC))
-ir (azb): Iran, Islamic Republic of (Azerbaijani (Iran))
-ma: Morocco (Arabic (Morocco))
+af (fa-olpc): Dari (Afghanistan, OLPC)
+ir (azb): Azerbaijani (Iran)
+ma: Arabic (Morocco)
 ma (rif): Morocco (Tarifit)
 rs (rue): Serbia (Pannonian Rusyn)

Note, there are some cases where the new string seems "less descriptive" - e.g. we go from "Maithili (Indian)" to just "Indian". But on further inspection I think these are all correct. Those are all cases where the layout is associated with multiple languages, often six or even more. It doesn't make sense to just pick one of them apparently at random to prepend, and prepending all of them would just look rather unwieldy - the non-variant in (Indian) layout is associated with 53 languages, we can't exactly list all of those out! Just saying "Indian" seems the right call.

Checking whether the layout+variant description from evdev starts
with the exact ISO-ified name of the language or country with
which it's associated is rather too strict. See things like the
official ISO name of Iran - "Iran, Islamic Republic of" - or the
ISO name of modern Greek - "Greek, Modern (1453-)" - or Berber -
"Berber languages". These cases mean our layout list winds up with
entries like "Greek, Modern (1453-) (Greek)" in it.

Avoid that with a more liberal check. Once we have our 'lang'
string, take the first word of it, strip any trailing commas and
semi-colons, then check if that word is in the evdev description,
and if so, don't prepend the lang string. Also ignore case - I
noticed that in French all translated language names are not
title-cased, so we wind up with entries like
"anglais (Anglais (US))".

Signed-off-by: Adam Williamson <[email protected]>
@AdamWill
Copy link
Contributor Author

AdamWill commented Nov 21, 2023

fun, so I noticed the language/country names and layout descriptions themselves can be translated, so there's just a huge space here. It's a bit impractical to check the output in every single language anaconda offers, I think, but I checked a few and added a tweak for French (make the comparison non-case-sensitive as for some reason all ISO language names are lower-case in French; without this we have entries like "anglais (Anglais)", both with and without my changes).

There are still some questionable ones in French even now (e.g. the evdev strings call Spanish "Espagnol" but the French ISO name for Spanish is "castillan" so we get "castillan (Espagnol)"), but at a quick look it does seem better than before.

I also looked at Japanese and it seems OK as best I can tell, again with some dumb cases like the ISO names of languages (like Greek) not quite matching up with the ones used in the evdev name translations so we prepend unnecessarily, but again nothing in this PR makes things worse AFAICS.

@AdamWill
Copy link
Contributor Author

If you want to play around with this live in the installer in different languages to see the effects, https:///www.happyassassin.net/updates/2250388.img is an updates image with both changes in it.

@jkonecny12
Copy link
Member

Hi @AdamWill thanks for the contribution. I just wonder if you want to spent time on this when we are planning to completely redesign the code because of libxklavier deprecation https://bugzilla.redhat.com/show_bug.cgi?id=1955025 . Seems that this have to happen on F40 or F41 anyhow. In general we would have to completely redesign solution of the keyboard switching.

I'm fine with merging this now just not sure if it is beneficial for you from the testing perpective.

@AdamWill
Copy link
Contributor Author

AdamWill commented Dec 4, 2023

it shouldn't affect testing at all (we use the default keyboard layout for the language in all existing automated tests). I already did all the work on it, so I think it would be a good idea to merge it - we don't know if the redesign will be done in time for F40, and if not, it would be nice to have this fixed.

@jkonecny12
Copy link
Member

Most probably not for F40 but F41.

Copy link
Member

@jkonecny12 jkonecny12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me from code perspective.

@jkonecny12
Copy link
Member

/kickstart-test --testtype smoke

@jkonecny12
Copy link
Member

The failed test is not related to this change. Going with merge.

@jkonecny12 jkonecny12 merged commit d66b991 into rhinstaller:master Dec 5, 2023
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants