Hello, my tattoo site is using dynamic locale for czech and international visitors. I'm having album directories in english and so in english "version" they are sorted correctly (like "american, ankle, back, celtic .. etc.), but switched to czech, the sorting looks like .. kind of "completely unsorted" ;-)
I'm wondering if there's a way how to sort albums custom by language. It doesn't need to rely on dynamic locale, just the different locale, as I'm thinking now.
Any ideas please?
As I do research, it could be somehow done by selecting TITLE from albums SQL table, as follows example: "a:3:{s:5:"cs_CZ";s:6:"anděl";s:5:"en_US";s:5:"angel";s:5:"nl_NL";s:5:"engel";}"
but before I start coding my "patch", as I'm not very skilled coder, isn't there any other solution?
Many thanks
Filip
You can sort by title. I suggest you try the current release first before trying anything since you are using 1.2.8.
If you think sorting does not work correctly with 1.3 as well please open a ticket.
Besides if you are using the multilingual you can't sort by a query using the title field as that is serialized (as you posted).
Wow, it's working now. I found the menu option and had it set right. The confusion was made probably by czech translation where one was "name" and second was "title". This is great, it makes the gallery much more clean, sorted now ;-)
Anyway I'm having another issue to solve now - it put's diacritical beginning characters in front of all instead of where it belongs.
But I understand this is regional issue. Anyway any idea how to solve it by hardrecoding somewhere?
Thanks
ps: I'm going to upgrade to 1.3 asap, just have to make some backups and testing, etc.
There is a function named sortByMultilingual() in functions.php which is used for the title sorts. However, there are other places where this solution would be needed--for instance, sorting the Tags. There is a parameter for normal sorts, SORT_LOCALE_STRING that handles this, but with these sorts, numbers are not sorted the way people expect. (Orders end up like 1,10,2,3...)
Good news everyone. Solved ;-)
This function used after natcasesort on $temp make it right for czech language. Unfortunately this is language specific.
btw. in my case I had to alter one of the last lines to while ($charA !=); (which makes this part of code disabled kind of) because it gave me some error I could'nt solve but make this work at all.
As for the comments if you need, put it into google translate and you should be fine.