From aaab7e6836027156d602cdf639b1c4406ff692fc Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 5 Feb 2006 21:26:59 +0000 Subject: [PATCH] * (bug 4828) Fix genitive month-name variable for cs, pl, uk patch by Mormegil http://bugzilla.wikimedia.org/attachment.cgi?id=1371&action=view --- RELEASE-NOTES | 2 ++ languages/LanguageCs.php | 8 ++++++-- languages/LanguagePl.php | 8 ++++++-- languages/LanguageUk.php | 8 ++++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4c1f949f3d..0fe9ad5f2f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/languages/LanguageCs.php b/languages/LanguageCs.php index a8e3b24dd4..823808175b 100644 --- a/languages/LanguageCs.php +++ b/languages/LanguageCs.php @@ -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 ) { diff --git a/languages/LanguagePl.php b/languages/LanguagePl.php index 3ca81dfb37..d2747d056d 100644 --- a/languages/LanguagePl.php +++ b/languages/LanguagePl.php @@ -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 ) { diff --git a/languages/LanguageUk.php b/languages/LanguageUk.php index aa15ef5e8c..a823d7b0c7 100755 --- a/languages/LanguageUk.php +++ b/languages/LanguageUk.php @@ -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 ) { -- 2.20.1