Bug 28245 - Language dropdown in advanced search should be sorted
Summary: Language dropdown in advanced search should be sorted
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-28 05:32 UTC by David Cook
Modified: 2021-04-28 05:43 UTC (History)
0 users

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 David Cook 2021-04-28 05:32:49 UTC
The Language dropdown in the advanced search should be sorted. It should be sorted according to the locale of the user. 

For instance, sorting by iso 629-2 codes favours English. Take for example "German". The code is "ger" and in English it's "German" but in French it's "Allemand", and in German it's "Deutsch". The alphabetical sort should be done to align with the expectations of the language of the user/interface.

I'm not sure what to do about non-alphabetic languages like Chinese that don't do alphabetic sorting...

Also, this is neat https://perldoc.perl.org/Unicode::Collate::Locale. A core module which adds support for locales. That said, sort for French is weird. The first is normal sort() and the second is Unicode::Collate::Locale sort.

$VAR1 = [
          'a',
          'e',
          'ç',
          'é',
          'ï'
        ];
$VAR1 = [
          'a',
          'ç',
          'ï',
          'é',
          'e'
        ];
Comment 1 David Cook 2021-04-28 05:43:08 UTC
(In reply to David Cook from comment #0)
> I'm not sure what to do about non-alphabetic languages like Chinese that
> don't do alphabetic sorting...

From what I've seen, Chinese just gets sorted by byte order.

I tried Unicode::Collate::Locale->new(locale => 'zh__pinyin'), but that didn't work. 

So no idea.