Bug 28245

Summary: Language dropdown in advanced search should be sorted
Product: Koha Reporter: David Cook <dcook>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

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.