cockpit icon indicating copy to clipboard operation
cockpit copied to clipboard

Wrong sorting: list of languages

Open Der-K-2000 opened this issue 2 years ago • 5 comments

In the list at the sidebar the list is sorted by the key, not the value. An example list from the config.php:


'languages' => [
	'danish' => 'Dänisch',
	'german' => 'Deutsch'
	'dutch' => 'Niederländisch',
]

Output will be

1. Dänisch
2. Niederländisch
3. Deutsch

...but it should be

1. Dänisch
2. Deutsch
3. Niederländisch

So the bug is: It's ordered by the array-key, not the value, which it should. And that's confusing, especially for newbies, who are only editing the text-fields.

Der-K-2000 avatar Jun 23 '22 15:06 Der-K-2000

I was wrong. Excuse me. There is actually no sorting. Neither by key nor by value. It depends on the list you've add in the config.php. Nevertheless it would be good to sort by the values.

Der-K-2000 avatar Jun 23 '22 17:06 Der-K-2000

Please close this

takumade avatar Jun 30 '22 09:06 takumade

Please close this

Why? It's still not sorted.

Der-K-2000 avatar Jun 30 '22 09:06 Der-K-2000

... but it is sorted... by the top-down line order (you said this yourself @SebastianBerlin).

Line order sorting also gives the Dev much more flexibility than a forced A->Z sort. Sorting by alphabetical would also override to all existing sites which have already set their preferred ordering.

mountainash avatar Jul 02 '22 07:07 mountainash

Well, no.

  1. There is no "flexibility" if you use multiple languages (for the admin-dashboard). In every language there has to be a different sorting and you can NOT fix that in any way.

It's a failure by construction, at least not well-wrought – and that function is necessary.

  1. Of course, there should be an option to choose, what you want, and to prevent problems with existing configs: Manual by config-file AND logical sorting by the value.

Der-K-2000 avatar Jul 02 '22 07:07 Der-K-2000