Sorting in twiki tables, searchresults etc. does not match locale settings. Adding lines
require POSIX;
import POSIX qw( locale_h LC_CTYPE LC_COLLATE);
setlocale(&LC_COLLATE, $TWiki::cfg{Site}{Locale});
to Search.pm and other related modules fixes the problem Tests shows that LC_CTYPE was correct there, but LC_COLLATE wrong.
Settings are the same as in Item3679
--
TWiki:Main/SergejZnamenskij
- 23 Feb 2007
As discussed elsewhere, the fix is to do a similar
setlocale
call during initial TWiki.pm locale setup. Something like this should work:
setlocale(&LC_CTYPE, $TWiki::cfg{Site}{Locale}); *setlocale(&LC_COLLATE, $TWiki::cfg{Site}{Locale});*
--
TWiki:Main.RichardDonkin
- 04 Mar 2007
Sergej. We clearly need someone with both knowledge and interest in i18n and perl to drive the development of TWiki in this direction. The regular developers do not seem to have the i18n knowledge that is requires.
Do you have SVN checkin rights Sergej? Otherwise you should apply and participate as a developer. Our developer community is not that large and there is room for much more to drive the development.
--
TWiki:Main.KennethLavrsen
- 04 Mar 2007
Sergej doesn't have checkin rights, but is quite interested in doing
I18N (see
TWiki:Codev.InternationalisationGuidelines
discussion) - I've emailed him to point to this page.
--
TWiki:Main.RichardDonkin
- 05 Mar 2007
The fix committed for
Item3652 included a line to set LC_COLLATE, so this should now be fixed - needs testing.
--
TWiki:Main.RichardDonkin
- 11 Sep 2007
Current MAIN (r14866) doesn't seem to sort correctly for our locale here (I only tried sorting by clicking headers generated by
TablePlugin).
--
TWiki:Main.SteffenPoulsen
- 14 Sep 2007
That may well be a bug in
TablePlugin - is it using locales properly as per the internationalisation guidelines (linked from
I18N)?
The core sorting code using locales can be tested using WebIndex.
--
TWiki:Main.RichardDonkin
- 30 Sep 2007
WebIndex sorts as it should here - excellent. Probably an item against
I18N support for
TablePlugin would make sense.
--
TWiki:Main.SteffenPoulsen
- 30 Sep 2007
Reattributing to
TablePlugin. Minor testcase (danish locale):
--
TWiki:Main.SteffenPoulsen
- 22 Dec 2007
WebIndex does not sort correctly.
It consequently sorts ÆØÅ as ÅÆØ. Both in tables and in tables. Even when I define the locale as $TWiki::cfg{Site}{Locale} = 'da_DK.ISO-8859-1';
I noted the same problem in a Codev topic written by Richard about some perl lib that should be good for sorting. It did not know the Danish alphabeth either.
Either the locale setting sucks or the CPAN libs are buggy and have been for a long time.
--
TWiki:Main.KennethLavrsen
- 29 Jul 2008