* (bug 4828) Fix genitive month-name variable for cs, pl, uk
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 5 Feb 2006 21:26:59 +0000 (21:26 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 5 Feb 2006 21:26:59 +0000 (21:26 +0000)
patch by Mormegil
http://bugzilla.wikimedia.org/attachment.cgi?id=1371&action=view

RELEASE-NOTES
languages/LanguageCs.php
languages/LanguagePl.php
languages/LanguageUk.php

index 4c1f949..0fe9ad5 100644 (file)
@@ -599,6 +599,8 @@ fully support the editing toolbar, but was found to be too confusing.
   in the automated test report.
 * (bug 4875) Define a div containing the shared image description
 * (bug 4860) Expose Title->userCan() as Hooks
+* (bug 4828) Fix genitive month-name variable for cs, pl, uk
+
 
 === Caveats ===
 
index a8e3b24..8238081 100644 (file)
@@ -142,8 +142,12 @@ class LanguageCs extends LanguageUtf8 {
 
        function getMonthNameGen( $key ) {
                #TODO: převést na return $this->convertGrammar( $this->getMonthName( $key ), '2sg' );
-               global $wgMonthNamesGenEn;
-               return wfMsg( $wgMonthNamesGenEn[$key-1] );
+               global $wgMonthNamesGenEn, $wgContLang;
+               // see who called us and use the correct message function
+               if( get_class( $wgContLang->getLangObj() ) == get_class( $this ) )
+                       return wfMsgForContent( $wgMonthNamesGenEn[$key-1] );
+               else
+                       return wfMsg( $wgMonthNamesGenEn[$key-1] );
        }
 
        function formatMonth( $month, $format ) {
index 3ca81df..d2747d0 100644 (file)
@@ -79,8 +79,12 @@ class LanguagePl extends LanguageUtf8 {
        }
 
        function getMonthNameGen( $key ) {
-               global $wgMonthNamesGenEn;
-               return wfMsg( $wgMonthNamesGenEn[$key-1] );
+               global $wgMonthNamesGenEn, $wgContLang;
+               // see who called us and use the correct message function
+               if( get_class( $wgContLang->getLangObj() ) == get_class( $this ) )
+                       return wfMsgForContent( $wgMonthNamesGenEn[$key-1] );
+               else
+                       return wfMsg( $wgMonthNamesGenEn[$key-1] );
        }
 
        function formatMonth( $month, $format ) {
index aa15ef5..a823d7b 100755 (executable)
@@ -69,8 +69,12 @@ class LanguageUk extends LanguageUtf8 {
        }
 
        function getMonthNameGen( $key ) {
-               global $wgMonthNamesGenEn;
-               return wfMsg( $wgMonthNamesGenEn[$key-1] );
+               global $wgMonthNamesGenEn, $wgContLang;
+               // see who called us and use the correct message function
+               if( get_class( $wgContLang->getLangObj() ) == get_class( $this ) )
+                       return wfMsgForContent( $wgMonthNamesGenEn[$key-1] );
+               else
+                       return wfMsg( $wgMonthNamesGenEn[$key-1] );
        }
 
        function getMessage( $key ) {