Call the LanguageGetMagic hook only once (per language object)
[lhc/web/wiklou.git] / languages / LanguageCs.php
index 8238081..0265c6f 100644 (file)
@@ -172,7 +172,6 @@ class LanguageCs extends LanguageUtf8 {
        }
 
        function checkTitleEncoding( $s ) {
-               global $wgInputEncoding;
 
                # Check for non-UTF-8 URLs; assume they are WinLatin2
                $ishigh = preg_match( '/[\x80-\xff]/', $s);
@@ -186,18 +185,17 @@ class LanguageCs extends LanguageUtf8 {
                return $s;
        }
 
-       var $digitTransTable = array(
-                       ',' => "\xc2\xa0", // @bug 2749
-                       '.' => ','
-       );
-
-       function formatNum( $number, $year = false ) {
-               return $year ? $number : strtr($this->commafy($number), $this->digitTransTable);
+       function separatorTransformTable() {
+               return array(',' => "\xc2\xa0", '.' => ',' );
        }
 
        # Grammatical transformations, needed for inflected languages
        # Invoked by putting {{grammar:case|word}} in a message
        function convertGrammar( $word, $case ) {
+               global $wgGrammarForms;
+               if ( isset($wgGrammarForms['cs'][$case][$word]) ) {
+                       return $wgGrammarForms['cs'][$case][$word];
+               }
                # allowed values for $case:
                #       1sg, 2sg, ..., 7sg -- nominative, genitive, ... (in singular)
                switch ( $word ) {
@@ -245,6 +243,23 @@ class LanguageCs extends LanguageUtf8 {
                # unknown
                return $word;
        }
+
+  # Plural form transformations, needed for some languages.
+  # Invoked by {{plural:count|wordform1|wordform2|wordform3}}
+  function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
+    switch ( $count ) {
+      case 1:
+        return $wordform1;
+
+      case 2:
+      case 3:
+      case 4:
+        return $wordform2;
+
+      default:
+        return $wordform3;
+    };
+  }
 }
 
 ?>