eb3ha4
March 24, 2020, 2:07am
1
Hello, I have a small but big issue testing Kirby 3 to make a Korean small dictionary.
In Korean sortBy('title', 'asc')
and sortBy('title', 'desc')
is not working correctly. I had same issue using Kirby 2, though it solved now.
Hello, Iām trying to make a website with Kirby. All contents are Korean. In some pages, I want to sort all titles by Korean alphabetical order. But sortBy(ātitleā, āascā) is not working on my localhost. It is sorted by only English alphabetical order. In addition, in panel sort: title asc, too. I donāt know why. Am I missing something?
I looked through kirby/src/Toolkit/Collection.php#L906
, but I donāt know why. Is there anyone who can help me?
Can you try with SORT_LOCALE_STRING
flag on Kirby 3 like that?
sortBy('title', 'asc', SORT_LOCALE_STRING)
eb3ha4
March 24, 2020, 7:22am
3
Thank you. Itās not working, but I found a way!
sortBy('title', 'asc', SORT_REGULAR)
But SORT_REGULAR
is not working in the Panel and blueprints. I didnāt know that before. Now I just wonder why this basic function was not mounted.
Could you share an example list with actual and expected order to test please?
I see that it works properly on the panel without any additional settings. Which Kirby version do you use?
sortBy: title asc
sortBy: title desc
Really weird. Letās ask to @texnixe have an idea about the issue?
For me, it was sorted correctly whether I set it or not.
For me it works if I set the locale and then sort by
sortBy: title asc SORT_LOCALE_STRING
SORT_NATURAL also works, adding nothing only works with the locale set.
eb3ha4
March 26, 2020, 8:32am
12
Yes. But it was not sorted correctly whether I set it or not. Maybe itās because of the PHP version? Iām using 7.3.8 on MAMP.
I just tested with MAMP as well with different PHP versions, not 7.3.8 though), and the result is the same. With the locale set, sorting works for me, no matter if I use a sort flag or not.
Edit: Somehow it doesnāt work if I set the locale to ko_KR.utf-8
, hm :thinking, while just setting ko
works.
Iām using PHP 7.3.14 either. Did you test with Kirby starterkit or plainkit?
eb3ha4
March 26, 2020, 10:36am
15
I tested with both, and the result is the same. I need to test with another computer and OS!
eb3ha4
March 26, 2020, 10:58am
16
ko
works instead of ko_KR
! But why? I donāt knowā¦ If I need to use Korean, I should set the locale?
I donāt know, this is weird.
Yes, that usually makes sense for any language, anyway, because it also affects dates, numbers etc. Or do you have a multi-language site?
eb3ha4
March 26, 2020, 11:13am
18
texnixe:
Yes, that usually makes sense for any language, anyway, because it also affects dates, numbers etc. Or do you have a multi-language site?
Not now. But it could be. Before that I think I need to test more with another machine and OS. Thank you so much!
eb3ha4:
Not now.
If you create languages, the locale is added to the language definitions in /site/languages/
, anyway.
But we have to investigate, why the full locale doesnāt work.
eb3ha4
March 26, 2020, 11:18am
20
Thank you. I will do that.
Yes, please!
I created an issue on GitHub:
opened 11:19AM - 26 Mar 20 UTC
Describe the bug
When setting the locale for Korean to ko_KR.utf-8, the locale setting is ignored, while setting it to only ko...
For now, you can probably work with the āreducedā locale.
1 Like