VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: tukusejssirs on October 07, 2018, 19:15:21 PM

Title: Drop-down menu is not sorted according to locale language
Post by: tukusejssirs 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:

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

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


Desired sorting:
Č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?
Title: Re: Drop-down menu is not sorted according to locale language
Post by: Studio 42 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.