MrBertie / pagequery

An all-in-one, multi-column page listing plugin for Dokuwiki
http://www.dokuwiki.org/plugin:pagequery
16 stars 19 forks source link

German umlauts, sorting of headers #30

Open wkaurzinek opened 10 years ago

wkaurzinek commented 10 years ago

You've fixed the issue "Group by heading - German umlauts #29" faster than light. Thank you for that. Unfortunately there's one more problem with the german umlauts: The sorting of the groups is not correct.

The umlauts should be ordered after the "corresponding plain characters" (I don't know how to explain that in a better way). The sort order is from A to Z, and the umlauts should be ordered as follows: A, Ä, B, C, ..., O, Ö, ... U, Ü, ... X, Y, Z.

At the moment you do the sorting in this way:

A Anfang U Umlaute Z Zu Ende Ä Ärgernis Ü Überschrift1

The groups containing the umlauts are at the end of the list. In the last version the empty groups were at this place. I'm sorry, because I've noticed that this groups were on the end, but I havent't wrote that because I thought the order would be correct if the letter is there.

I'm using the plugin "simplenavi" for navigation in the sidebar. This plugin will show the pages in the correct order:

Anfang Ärgernis Umlaute Überschrift1 Zu Ende

Maybe you will find some time to fix this? I'm sorry for making troubles ...

MrBertie commented 10 years ago

This is quite a big request you are asking, sorting all different languages correctly (not just German) is no small task in PHP, I will eventually find time for it, but not soon. This is just a little plugin for my own use which I share with others... I have only so many free hours!

On 11 May 2014 08:57, wkaurzinek notifications@github.com wrote:

You've fixed the issue "Group by heading - German umlauts #29https://github.com/MrBertie/pagequery/issues/29" faster than light. Thank you for that. Unfortunately there's one more problem with the german umlauts: The sorting of the groups is not correct.

The umlauts should be ordered after the "corresponding plain characters" (I don't know how to explain that in a better way). The sort order is from A to Z, and the umlauts should be ordered as follows: A, Ä, B, C, ..., O, Ö, ... U, Ü, ... X, Y, Z.

At the moment you do the sorting in this way:

A Anfang U Umlaute Z Zu Ende Ä Ärgernis Ü Überschrift1

The groups containing the umlauts are at the end of the list. In the last version the empty groups were at this place. I'm sorry, because I've noticed that this groups were on the end, but I havent't wrote that because I thought the order would be correct if the letter is there.

I'm using the plugin "simplenavi" for navigation in the sidebar. This plugin will show the pages in the correct order:

Anfang Ärgernis Umlaute Überschrift1 Zu Ende

Maybe you will find some time to fix this? I'm sorry for making troubles ...

— Reply to this email directly or view it on GitHubhttps://github.com/MrBertie/pagequery/issues/30 .

wkaurzinek commented 10 years ago

Thank you for your answer! This thing is not that important, I know that. Please don't think that there's pressure from my side! As I wrote, "maybe you'll find some time". If you don't find the time (and I know that there's much more to do, more important things than that), I'll be glad. And if not, also everything's will be ok. I have to say "thank you" again, for fixing my first problem.

wkaurzinek commented 10 years ago

It's me again! I did some research abaout sorting in PHP. I'm no expert in PHP, commonly I use C# for my work. You're right, sorting umlauts in PHP is not as easy as expected. But then I've had an idea. So I looked into your code and made an extension to the file "pagequery.php", into the sorting function. Unfortunately I don't know how to attach a file.

At first I declare 2 arrays:

image

Then I put this 2 arrays into the sort function:

image

And at least I replace the umlauts in the sort keys using the arrays (which is faster than replacing every umlaut separated):

image

Well, maybe there's a more professional solution. It's a quick fix, maybe dirty too.