NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item11383 for general documentation changes for release 1.1.5. Use Item9693 for docu changes for release 2.0.

Item3680: I18N: Sorting does not match locale settings

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal New Extension TablePlugin, I18N  

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):

H1 H2 Correct H2 sort order, da locale
abc def 2
def abc 1
æøå åøæ 4
åøæ æøå 3

-- 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

ItemTemplate edit

Summary I18N: Sorting does not match locale settings
ReportedBy TWiki:Main.SergejZnamenskij
Codebase
SVN Range TWiki-4.1.1, Tue, 20 Feb 2007, build 12932
AppliesTo Extension
Component TablePlugin, I18N
Priority Normal
CurrentState New
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
Topic revision: r12 - 16 Mar 2011 - 00:31:37 - GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads