SUMMARY Natural sorting does not sort numbers in filenames (anymore?). The example in the Dolphin manual does not work like documented. STEPS TO REPRODUCE 1. Enable natural sorting. 2. In a test folder, create test files: "touch File1 File2 File10" OBSERVED RESULT Regardless of selected sort order in Dolphin preferences, files are always sorted like this: File1 File10 File2 EXPECTED RESULT In natural sort order, files are sorted like this: File1 File2 File10 SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 19.10 with Plasma backports KDE Plasma Version: 5.17.2 KDE Frameworks Version: 5.62.0 Qt Version: 5.12.4 ADDITIONAL INFORMATION The reproducible example is taken from the Dolphin manual, see https://docs.kde.org/stable5/en/applications/dolphin/configuring-dolphin.html See also the result of ls with -v option: $ ls -v File1 File2 File10 $ ls File1 File10 File2 Reading other bugs I realize that this may be related to locale. This is my locale info: LANG=en_US.UTF-8 LANGUAGE=en_US:de LC_CTYPE="en_US.UTF-8" LC_NUMERIC=de_DE.UTF-8 LC_TIME=de_DE.UTF-8 LC_COLLATE="en_US.UTF-8" LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=POSIX LC_PAPER=de_DE.UTF-8 LC_NAME=de_DE.UTF-8 LC_ADDRESS=de_DE.UTF-8 LC_TELEPHONE=de_DE.UTF-8 LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=de_DE.UTF-8 LC_ALL=
I don't reproduce it on Dolphin 20.04 / Plasma 5.18 / KF 5.65 from sources. My locale is french.
Still present with 19.12.1. Here is a screenshot: https://i.imgur.com/3anjuXt.png
Have tried changing the setting (leave on natural) quit dolphin, launch it again and see if the behavior has changed ?
(In reply to Méven Car from comment #3) > Have tried changing the setting (leave on natural) quit dolphin, launch it > again and see if the behavior has changed ? I have the setting on natural all the time anyway and had many Dolphin starts in the few months since reporting this. But I tried it and there is no difference. There is a minor other bug (I would say): after changing the sort order and closing the options dialog the file list is not resorted right away. Seems to be cached. On reopening the options dialog it is resorted, before changing any option. Keeping this in mind I can confirm that alphabetical order with or without case sensitivity works as expected. Natural seems to work exactly like alphabetical, case insensitive.
Fixed with the commit for bug 406296.
(In reply to Christoph Feck from comment #5) > Fixed with the commit for bug 406296. Doesn't look fixed to me: https://i.imgur.com/xpex4OR.png - still sorted File1, File10, File2, not File1, File2, File10. Or is there a misunderstanding?
You are right, I am running Dolphin from master instead of branch. It will be fixed with the next point release in April.
Thanks. Looking forward to it :-)
(In reply to Christoph Feck from comment #7) > You are right, I am running Dolphin from master instead of branch. It will > be fixed with the next point release in April. I'm on the kde-unstable repo on Plasma 5.19 and it's not working
It might be relevant that the steps to reproduce involved files, but I 'm having this issue with folders
The Plasma version is irrelevant. Make sure you have Dolphin 20.04.x. On my system, also folder names are correctly naturally sorted: cd /tmp; mkdir Test12; mkdir Test2 Order shown in Dolphin is: Test2 Test12
I have Dolphin 20.04.2, and it's not working Proof: https://drive.google.com/drive/folders/1_FuuQsIoziYYH5ixzU2zHTiTbMn5LI3L?usp=sharing
(In reply to Christoph Feck from comment #11) > The Plasma version is irrelevant. Make sure you have Dolphin 20.04.x. On my > system, also folder names are correctly naturally sorted: > > cd /tmp; mkdir Test12; mkdir Test2 > > Order shown in Dolphin is: Test2 Test12 I ran that command, and it doesn't
I noticed something on your screenshots, Andrés Cabero, you are using the details view but it is not sorted by Name : there should be an arrow pointing down in the name column header. Unless your theme hides it. So can you check your sorting setting, Right Click > Sort by ?
(In reply to Méven Car from comment #14) > I noticed something on your screenshots, Andrés Cabero, you are using the > details view but it is not sorted by Name : there should be an arrow > pointing down in the name column header. Unless your theme hides it. > So can you check your sorting setting, Right Click > Sort by ? It is actually sorted by name. The arrow doesn't appear because Dolphin was spanning half the viewport, but when it's set to fullscreen it does (may be related to my theme). It is also set to natural sorting, in case you wonder if I set it alphabetical
Something else on your screenshot I noticed. You are using dolphin version control plugins. And once I installed dolphin-plugins on my system in a git version controlled folder, I was able to reproduce the bug everywhere. (Test12 was before TEST2) It is a different bug from the original though although close. Even after uninstalling dolphin-plugins, the wrong behavior occurs. This should help pinpointing the bug origin.
This is actually really weird, possibly another bug. The folder in the screenshot (it's a external hard drive) isn't even a git repository, but Dolphin treats it as one.
Well I have reinstalled dolphin-plugins and I can't reproduce the bug anymore, so there is something weird somewhere. (I test with Dolphin 19.12.3 btw)
NOT fixed in 20.04.0. Running 20.08.0, still experiencing the issue. Can't get natural sorting to work in any scenario whatsoever.
Everyone affected please vote!
I saw this bug when I had misconfigured my locale settings.
I have this bug too. Latest Archlinux. Natural sorting, by name, alphabetically. https://pix.louiz.org/o/lMtOl.jpg
Workaround : Change sort order to your locale : https://pix.louiz.org/o/KqbcY.jpg Credits : https://www.reddit.com/r/kde/comments/hsxxw0/how_to_sort_numbered_files_in_dolphin_natural/fyhy4ok/?utm_source=reddit&utm_medium=web2x&context=3
https://commits.kde.org/dolphin/9e3418bd558293a92b2e8bcba55f5a3f5d3cc5a4 was not a fix for this, it added natural sorting ordering on all columns not just on the title one. This workaround seems to points out that the value LC_COLLATE is the major factor. The formats kcm allows to set it, and update it (after a plasma logout/login), but by default does not read it or change it. So my question for those who are affected: - what is your distro (it might be related to how the distro set your locate) - what is the value of your environment variables LANG and LC_COLLATE and whether or not it is set - Does setting the workaround, setting a ordering setting in systemsettings formats and restart plasma, fix the issue
- My distro is Archlinux. (A month old installation btw) - LANG=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8 - As said in my previous post, specifying the fr_FR ordering setting worked around the issue. Before the change, "Detailed setting was not ticked", the custom parameters were greyed out. I think the greyed out "ordering setting" was showing "C" rather than "no modifications".
(In reply to Yamashita Ren from comment #25) > - My distro is Archlinux. (A month old installation btw) > - LANG=fr_FR.UTF-8 > LC_COLLATE=fr_FR.UTF-8 > - As said in my previous post, specifying the fr_FR ordering setting worked > around the issue. > > Before the change, "Detailed setting was not ticked", the custom parameters > were greyed out. I would need those settings in the condition the bug reproduce. > I think the greyed out "ordering setting" was showing "C" rather than "no > modifications". That's helpful, it confirms what I suspected : some distro (here arch) don't help users having LC_COLLATE adapted to their LANG. In the kcm the ordering is LC_COLLATE. We should probably try to warn users, to set a good LC_COLLATE value. The Arch Linux french wiki documents this well https://wiki.archlinux.fr/locale#Ordre_de_tri Anyway I believe this remaining bug is not much in fact kde-related.
What do you mean ? My LC_COLLATE (as shown in `locale`) IS fr_FR.UTF-8. The issue looks like that kcm, for whatever reason, default to C (or whatever it was) instead of respecting my system LC_COLLATE setting. Which is why I had to manually specify LC_COLLATE=fr_FR.UTF-8 in the kcm.
kcm in bug situation : https://pix.louiz.org/o/iqaEm.jpg
(In reply to Yamashita Ren from comment #27) > What do you mean ? > My LC_COLLATE (as shown in `locale`) IS fr_FR.UTF-8. > The issue looks like that kcm, for whatever reason, default to C (or > whatever it was) instead of respecting my system LC_COLLATE setting. > By default the KCM does nothing, the system defined LC_COLLATE is used. Probably LC_COLLATE=C was your default set LC_COLLATE. > Which is why I had to manually specify LC_COLLATE=fr_FR.UTF-8 in the kcm. This way would overwrote your system settings (plasma on startup uses the set value in the kcm to set the LC_COLLATE value).
Then how can I show you my system defined LC_COLLATE ? Because for some unexplained reason, you don't seem to believe me when I tell you that my system LC_COLLATE is fr_FR.UTF-8...
(In reply to Yamashita Ren from comment #30) > Then how can I show you my system defined LC_COLLATE ? > `env | grep LC_COLLATE` or `echo $LC_COLLATE` (I don't have it set on my Kubuntu or neon installs) > Because for some unexplained reason, you don't seem to believe me when I > tell you that my system LC_COLLATE is fr_FR.UTF-8... I believe you. > > Probably LC_COLLATE=C was your default set LC_COLLATE. For when you still experienced the bug. The kcm settings are stored in `~/.config/plasma-localerc`. If you don't have "useDetailed=true" in it, plasma does nothing to your settings and the kcm greys out the detailed parameters.
(In reply to Méven Car from comment #31) > > > Probably LC_COLLATE=C was your default set LC_COLLATE. > > For when you still experienced the bug. This is the thing. My LC_COLLATE has been fr_FR.UTF8 for weeks. The locale is one of the first things I set up. $ env | grep LC_COLLATE; echo $LC_COLLATE LC_COLLATE=fr_FR.UTF-8 fr_FR.UTF-8 So THERE IS a bug. And I was a victim of it until I got fed up and looked how to fix it a week ago. Moreover, you can see that KCM itself says that C is the default sort order : https://pix.louiz.org/o/iqaEm.jpg Is it related to the bug ? I don't know. All I know is that there is a bug to fix.
(In reply to Yamashita Ren from comment #32) > (In reply to Méven Car from comment #31) > > > > Probably LC_COLLATE=C was your default set LC_COLLATE. > > > > For when you still experienced the bug. > > This is the thing. My LC_COLLATE has been fr_FR.UTF8 for weeks. The locale > is one of the first things I set up. > > $ env | grep LC_COLLATE; echo $LC_COLLATE > LC_COLLATE=fr_FR.UTF-8 > fr_FR.UTF-8 > > So THERE IS a bug. And I was a victim of it until I got fed up and looked > how to fix it a week ago. > > Moreover, you can see that KCM itself says that C is the default sort order > : https://pix.louiz.org/o/iqaEm.jpg > > Is it related to the bug ? I don't know. > All I know is that there is a bug to fix. Thanks, could you copy here the content of ~/.config/plasma-localerc I have an hypothesis as to what cause the issue and a possible fix.
$ cat ~/.config/plasma-localerc [Formats] LANG=fr_FR.UTF-8 [Translations] LANGUAGE=fr:en_US
(In reply to Yamashita Ren from comment #34) > $ cat ~/.config/plasma-localerc > [Formats] > LANG=fr_FR.UTF-8 > > [Translations] > LANGUAGE=fr:en_US Have you logged out of your session since you applied your fix ? How did you set your LC_COLLATE, I mean in the commandline or through bash_profile or equivalent ?
Created attachment 140986 [details] Example of the problem I can confirm this ugly bug (tested with different LC_COLLATE, it doesn't affect at all in the sorting mode). Dolphin Version 21.08.0 KDE framework: 5.85
Indeed, the natural sorting mode shows different patterns with or without strings around, all are wrong: $ mkdir {1..15} $ mkdir {1..15}s $ mkdir s{1..15}
I can confirm that the problem is due to LC_COLLATE variable set to "C" (LC_COLLATE=C and maybe other values), I fixed not setting that variable (just delete in the config or doing export LC_COLLATE=""). I think this is not directly a bug or problem directly related to Dolphin, so I'm going to close it.
I was having this bug in Dolphin 22.08.3 and i followed this arch wiki's guide https://wiki.archlinux.org/title/KDE#Plasma_desktop_does_not_respect_locale/language_settings --- I edited my `/etc/locale.conf` file and replaced the LANG key with value "C.UTF-8" with my language locale (in my case "en_US.UTF-8"), i also created the entry LC_COLLATE="en_US.UTF-8" (this entry is the important one i think) Then i deleted `~/.config/plasma-localerc` Ran `sudo locale-gen` (not necessary according to the wiki guide) Logged out and in again And i had natural sort working. Hope this helps someone!