https://bugzilla.wikimedia.org/show_bug.cgi?id=42607

       Web browser: ---
             Bug #: 42607
           Summary: Tablesorter sorts all numbers as dates in Czech
           Product: MediaWiki
           Version: unspecified
          Platform: All
               URL: http://cs.wikipedia.org/wiki/?oldid=9352755
        OS/Version: All
            Status: NEW
          Keywords: i18n
          Severity: normal
          Priority: Unprioritized
         Component: JavaScript
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
            Blocks: 31601
    Classification: Unclassified
   Mobile Platform: ---


The table sorting feature is currently quite broken in Czech, apparently
because the tablesorter considers (almost) any number to be a calendar date.
(See the linked URL and click e.g. the “Sčítání 2001” column.)

The sorter constructs the date-matching regex as

^\\s*\\d{1,2}[\\,\\.\\-\\/\'\\s]*(' + regex_for_months + ')' +
'[\\,\\.\\-\\/\'\\s]*\\d{2,4}\\s*$

The problem in Czech is triggered by the fact that we do not use alphabetic
abbreviations for short month names, but just month numbers, i.e. our final
regex looks like

^\s*(\d{1,2})[\,\.\-\/'\s]*(leden|1|únor|2|březen|3|duben|4|květen|5|červen|6|červenec|7|srpen|8|září|9|říjen|10|listopad|11|prosinec|12)[\,\.\-\/'\s]*(\d{2,4})\s*$

And because the separators are qualified with *, i.e. optional, the regex
considers e.g. “123456” to be, in fact, something like “12/3/456”, i.e. “March
12, 456”. Which is obviously silly.

Do we really want to write dates as e.g. “1Dec2012”, so that we would need the
* there? Wouldn’t + be better? (Or, at the very least, check whether
wgMonthNamesShort is not numeric, and do not add it into the regex if it is.)

On the other hand, the date recognition does not really work for Czech, anyway.
In dates, we use the genitive month names (e.g. “1. prosince 2012”, not “1.
prosinec 2012”), see Language::mMonthGenMsgs.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to