Bug 501968

Summary: My country isn't listed in the Settings > Home Country Dropdown
Product: [Applications] KDE Itinerary Reporter: Caleb <caleb>
Component: generalAssignee: Volker Krause <vkrause>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 23.08.3   
Target Milestone: ---   
Platform: Android   
OS: Android 14.x   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot of the country dropdown on android

Description Caleb 2025-03-25 04:50:11 UTC
Created attachment 179715 [details]
screenshot of the country dropdown on android

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY


STEPS TO REPRODUCE
1. Launch Kitinerary App on Android
2. Click "Settings" button
3. Select "Home Country" Dropdown (it may have United States pre-selected)
4. Attempt to find home country (Taiwan)

OBSERVED RESULT
There is no listing for Taiwan. Bizarrely, there is a listing for a nonexistent country, "Taiwan, Province of China," which is using the Taiwanese flag. There is no such country on this planet, so I, nor anyone in this world, can select it. It's a strange name too, how can a Province be a Country? It probably thus shouldn't be in the dropdown, both because it doesn't exist, and because it doesn't make sense for a province to be in a country dropdown. You'll notice there's no other PRC provinces in the dropdown. 

As I understand it, KDE often uses ISO 3166, which is a wonderful resource for many country names, however it bizarrely also doesn't maintain a listing for Taiwan. If you'd like an official standard to which you may refer, you might choose BCP47 which lists Taiwan as the country which uses the zh-Hant-TW language https://www.venea.net/web/culture-code . Or you may choose to use what much of the web, iOS, and Android applications use, Unicode CLDR https://cldr.unicode.org/ which contains Taiwan. 

EXPECTED RESULT
There should be a listing for Taiwan. 


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Volker Krause 2025-03-25 16:45:49 UTC
Itinerary gets the country list from KF::I18n which gets the (translated) names from https://salsa.debian.org/iso-codes-team/iso-codes, so this would need to be fixed there.
Comment 2 Caleb 2025-03-26 04:17:13 UTC
(In reply to Volker Krause from comment #1)
> Itinerary gets the country list from KF::I18n which gets the (translated)
> names from https://salsa.debian.org/iso-codes-team/iso-codes, so this would
> need to be fixed there.

Thank you for mentioning this. I'm happy to issue a bug report there or, since this looks very text-forward (rather than requiring specific technical knowledge), issue a patch myself if possible. 

Interestingly, there may be another alternative. According to this list: https://salsa.debian.org/iso-codes-team/iso-codes/-/blob/main/iso_3166-1/zh_TW.po?ref_type=heads the correct name for Taiwan is available under :1578 `#. Common name for TWN`. 

Also fascinating, the official name of Taiwan in Mandarin, "中華民國" (Kind of like how Korea's official name is Republic of Korea), is listed next to the nonexistent country written in English, "Taiwan, Province of China." In any case, is it possible that apps choose to use the `Common name for TWN`?  The Mandarin version of same, "臺灣", is how the vast majority of people the vast majority of the time, write Taiwan.
Comment 3 Volker Krause 2025-03-26 08:52:22 UTC
Interesting, `common_name` might not have existed when this was initially implemented, that indeed seems to improve the result for several countries.
Comment 4 Bug Janitor Service 2025-03-26 08:53:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ki18n/-/merge_requests/142
Comment 5 Volker Krause 2025-03-30 15:43:06 UTC
Git commit b8c4b6a2f05fa46b8427aed862de1cfaf6f481f0 by Volker Krause.
Committed on 30/03/2025 at 14:11.
Pushed by vkrause into branch 'master'.

Use iso-codes' common_name field for country names when present

This provides more expected names for the countries having this set, e.g.
"Venezuela" instead of "Venezuela, Bolivarian Republic of".

M  +2    -0    autotests/kcountrytest.cpp
M  +12   -2    src/localedata/isocodescache.cpp

https://invent.kde.org/frameworks/ki18n/-/commit/b8c4b6a2f05fa46b8427aed862de1cfaf6f481f0