Author Topic: Drop-down menu is not sorted according to locale language  (Read 77 times)

tukusejssirs

  • Beginner
  • *
  • Posts: 1
  • A beginner
Drop-down menu is not sorted according to locale language
« on: October 07, 2018, 19:15:21 pm »
First of all, I am all new to Virtuemart, Joomla, and this forum, so be easy on me. ;p

I have set up a multilingual website on Joomla! 3.8.12 Stable and VirtueMart 3.2.14.

When the customer (on page in language other than English, let's say in Slovak) is asked to enter country of his address, there's a drop-down menu, which is searchable, but:
  • list is ordered according to Latin/English alphabet, not in the locale alphabet;
  • when one searches for a country that contains characters with diacritics (like č or í), these can be found if they enter the name with diacritics, but not without it.

As for the point 1., here as example list:

Current sorting:
Code: [Select]
Slovenská republika  // Slovak Republic
Spojené štáty        // United States
Česká republika      // Czech Republic
Írsko                // Ireland

Desired sorting:
Code: [Select]
Česká republika      // Czech Republic
Írsko                // Ireland
Slovenská republika  // Slovak Republic
Spojené štáty        // United States

As for the point 2., if one search for 'irsko', it currently outputs nothing (No results match "irsko"), but it should output Írsko (Ireland).

The question is: how can I accomplish this?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3399
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Drop-down menu is not sorted according to locale language
« Reply #1 on: October 07, 2018, 23:32:58 pm »
1 list is ordered according to Latin/English alphabet, not in the locale alphabet;
standard PHP ordering use ascii char, i think no advanced sorting is used for this list(this can be very slower)

2 when one searches for a country that contains characters with diacritics (like č or í), these can be found if they enter the name with diacritics, but not without it.
This is a general problem about the search with jquery chosen script
See for eg
https://stackoverflow.com/questions/14263579/searching-through-international-characters-with-chosen-js
https://github.com/harvesthq/chosen/issues/2821
So perhaps on using last chosen, it work better for search, but of course this can break other components in your site in some cases.