Open martinhankovec opened 1 year ago
I appears groups are sorted at https://github.com/nextcloud/contacts/blob/eb035630e2ca67195da30371c0403e6873c64d8c/src/components/AppNavigation/RootNavigation.vue#L334 using https://www.npmjs.com/package/string-natural-compare.
If I look at https://github.com/nwoltman/string-natural-compare/issues/11 I get the impression that for our case it would be more clever to use the browser's compare API that respects the locale.
Yes. naturalCompare solves the problem with order of numbers (1, 10, 100 etc.), but it seems not working well with locale. In my opinion the problem with locales in group names is much more serious than the possible problem of bad order with numbered groups (Group 1, Group 10, Group 2 etc.). Thanks a lot.
is there any workaround?
Describe the bug
Groups with UTF8 characters in names are sorted in bad order, characters with diacritics are at the end (see SOkA Písek, SOkA České Budějovice on the picture): Right order of groups: SOA v Třeboni SOA v Třeboni - odd.... SOkA České Budějovice (Č sorted as C!) SOkA Český Krumlov (Č sorted as C!) SOkA Jindřichův Hradec SOkA Písek (í sorted as i!) SOkA Prachatice SOkA Strakonice SOkA Tábor
Steps to reproduce
Try to add these groups and see displayed order: SOkA České Budějovice SOkA Český Krumlov SOkA Jindřichův Hradec SOkA Písek SOkA Prachatice SOkA Strakonice
Expected behavior
Sort group names with UTF-8 characters correctly
Actual behavior
Now are the names of groups sorted in bad order, maybe latin1 and not UTF-8?
Contact version
4.2.2
Operating system
CentOS 7
PHP engine version
PHP 7.4
Web server
Apache (supported)
Database
PostgreSQL
Additional info
No response