Mailinglist Archive: yast-devel (35 mails)

< Previous Next >
[yast-devel] Table sorting and locales in YaST UI

Hi all,

I found out that sorting a table in Yast does not work the same way in
all UIs.

The Qt UI respects the current locale, while ncurses and Gtk
always use standard C (ASCII) sorting. That makes a trouble when sorting
texts with accents.

E.g. ["Z", "Ž", "á", "Á", "A", "a"] is in Qt sorted as users would
expect ["a", "A", "á", "Á", "Z", "Ž"] (unless the locale is C/POSIX), while the
others always display ["A", "Z", "a", "Á", "á", "Ž"], which is IMHO a bug.


The problem is additionally complicated by the locale setting, i.e. it depends
on
invocation, ssh or su/kdesu keeps the current locale, but "su -" or logging in
a text
console sets POSIX locale (which results in C sorting).


On the other hand locale sorting does not work correctly with numbers,
in the repository module I pad priority number with spaces so in C sorting
values " 90" and "100" are sorted correctly. However, this does not work
when locale sorting is active, the values are in order like this: " 99", " 90",
"105", "100", which looks strange. So C sorting would be good here.


So how to solve all these problems?

- I think table sorting should respect the current locale
(so there is a bug in Gtk/ncurses)

- The numeric sorting problem can be solved by padding numbers with zeroes
instead
of spaces e.g. "090" instead of " 90" - it does not look nice but I haven't
found
any better solution. Any idea? (I tried some tricks with UTF-8 non-breakable
space
but that didn't help.)


Any comments?


(BTW I foud out this problem when debugging bnc#752768, I could not reproduce
it in
12.1, but I could in 12.2M3.)


--

Ladislav Slezák
Appliance department / YaST Developer
Lihovarská 1060/12
190 00 Prague 9 / Czech Republic
tel: +420 284 028 960
lslezak@xxxxxxxx
SUSE
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >