* (bug 19286) Correct commafying function in Polish (pl)
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 19 Jun 2009 08:52:17 +0000 (08:52 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 19 Jun 2009 08:52:17 +0000 (08:52 +0000)
RELEASE-NOTES
languages/classes/LanguageDe.php
languages/classes/LanguagePl.php

index d153ff4..c32411c 100644 (file)
@@ -242,9 +242,10 @@ changes to languages because of MediaZilla reports.
 * (bug 18806) Use correct unicode characters in spelling of native Chuvash
   (Чӑвашла)
 * (bug 18864) Updated autonym for Zhuang language
-* (bug 18957) Updated number formatting for German
-* (bug 18308) Updated date formatting in Occitan
+* (bug 18957) Updated number formatting for German (de)
+* (bug 18308) Updated date formatting in Occitan (oc)
 * (bug 19080) Added ăâîşţșțĂÂÎŞŢȘȚ to Romanion (ro) linktrail
+* (bug 19286) Correct commafying function in Polish (pl)
 
 == Compatibility ==
 
index d0a19a5..b6fe048 100644 (file)
@@ -6,6 +6,7 @@
 class LanguageDe extends Language {
 
        /*
+        * FIXME: Comment is wrong, decimals prevent space suppression
         * German numeric format is "12 345,67" but "1234,56"
         * Copied from LanguageUk.php
         */
index 54314fa..bb79891 100644 (file)
@@ -21,4 +21,12 @@ class LanguagePl extends Language {
                                return $forms[2];   // plural genitive
                }
        }
+
+       function commafy($_) {
+               if (!preg_match('/^\d{1,4}(.\d+)?$/',$_)) {
+                       return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
+               } else {
+                       return $_;
+               }
+       }
 }