Bug 35213 - Standardize country information sent to Hea
Summary: Standardize country information sent to Hea
Status: NEW
Alias: None
Product: Project Infrastructure
Classification: Unclassified
Component: Hea (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Chris Cormack
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-01 12:22 UTC by Katrin Fischer
Modified: 2025-02-17 14:22 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-11-01 12:22:31 UTC
At the moment we store the translated name of the country in UsageStatsCountry which leads to a confusing display in https://hea.koha-community.org/libraries-by-country.

We should use standardized language codes in the database instead of names.
Comment 1 Victor Grousset/tuxayo 2024-07-22 23:49:29 UTC
ok, so this is why the country list is so messy!!
(also on the homepage: https://hea.koha-community.org/)
Comment 2 Michał 2025-02-17 14:22:08 UTC
Yeah it really should be using just the country code of some kind from the database as value being sent. Currently, even after the current set of fixes, you stop seeing the selected country value in the dropdown after changing intranet language.

So three things would need to be done:
- make Koha save the preference as country code (and on upgrade convert the currently saved prefs)
- coerce all existing countries in Hea database into the country codes
- Hea would need to map legacy translated values from legacy Koha versions to allow them to still be displayed on the site (because let's be real, nobody will update these installs for next 10 years)

Problem: while languages are stored nicely in `language_descriptions` in the database, countries don't seem to have an equivalent; their current list is just in `country-list.inc` file.

Simple alternative: always store and send the English name, display translated name in the UI only for the looks. The country list would still have to be stored in some nicer way probably, but at least it wouldn't require counterpart country codes list? Not sure if this would save much effort at all in the end.