Summary: | Language list is displayed in wrong order (getLanguages sorts it by language code; places that display language list to the end-user in UI should re-sort that by localized display name order) | ||
---|---|---|---|
Product: | Koha | Reporter: | Michał <schodkowy.omegi-0r> |
Component: | I18N/L10N | Assignee: | Bugs List <koha-bugs> |
Status: | In Discussion --- | QA Contact: | Testopia <testopia> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | dcook, f.demians, jonathan.druart, martin.renvoize |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38646 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: |
Description
Michał
2025-01-30 10:12:16 UTC
Also wasn't sure whether to mark it as OPAC or I18N category. Technically the user-facing display bug is in OPAC, even though also unit test regressed after MariaDB update due to the UB. Welp. I was going to say that sorting the @languages_list at the end of getLanguages() would be the easiest solution, but that wouldn't be translation friendly... ...but it looks like we just use the description straight from the database, so that's fine. I don't recall if sort() can handle UTF-8 or not. I think it should. But if not it might be necessary to use something like Unicode::Collate's sort() Or do we sort by code? Using Unicode::Collate might be useful with the description because that would use whatever the default is used in the Unicode Collation Algorithms... I wonder if Greek speakers would expect to find Greek at the end of the list or in the Es... This could be another case where Unicode::Collate::Locale could be useful although it runs into issues of installed locales... see bug 36947 Now after the follow-up to Bug 38646, the order of languages returned from C4::Languages::getLanguages is sorted by language code ascending. I think that's a good call, since it makes the output of the function stable, regardless of the session context (and the user language selected therein). So as far as undefined behavior went, that bug is solved. However, I keep it open and change status to "In Discussion", unless someone decides to close, because there might still be some merit to considering language order in places where users see it. I think for places where actual users sees a list of languages, they might really expect to see them ordered alphabetically by how they're displayed, but for that we might want to handle this directly at the places that display such lists in/for UI and not at getLanguages func level. That might be the most stable approach. Aforementioned places is mostly the advanced search form page, I think. I kept the bug name |