From cc7c4cd74c7714a288d5a8defaf2fc1681ee380c Mon Sep 17 00:00:00 2001 From: Zheng Zhu Date: Mon, 13 Dec 2004 02:14:31 +0000 Subject: [PATCH] Call the correct message function in the language object depending on whether the language object is used for UI or content. This should fix the problem with date formatting in signatures. --- languages/Language.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/languages/Language.php b/languages/Language.php index 87c67c30bf..080ab49014 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1743,8 +1743,11 @@ class Language { } function getMonthName( $key ) { - global $wgMonthNamesEn; - return wfMsg($wgMonthNamesEn[$key-1]); + global $wgMonthNamesEn, $wgContLang; + if( get_class( $wgContLang ) == get_class( $this ) ) + return wfMsgForContent($wgMonthNamesEn[$key-1]); + else + return wfMsg($wgMonthNamesEn[$key-1]); } /* by default we just return base form */ @@ -1753,13 +1756,19 @@ class Language { } function getMonthAbbreviation( $key ) { - global $wgMonthAbbreviationsEn; - return wfMsg(@$wgMonthAbbreviationsEn[$key-1]); + global $wgMonthAbbreviationsEn, $wgContLang; + if( get_class( $wgContLang ) == get_class( $this ) ) + return wfMsgForContent(@$wgMonthAbbreviationsEn[$key-1]); + else + return wfMsg(@$wgMonthAbbreviationsEn[$key-1]); } function getWeekdayName( $key ) { - global $wgWeekdayNamesEn; - return wfMsg($wgWeekdayNamesEn[$key-1]); + global $wgWeekdayNamesEn, $wgContLang; + if( get_class( $wgContLang ) == get_class( $this ) ) + return wfMsgForContent($wgWeekdayNamesEn[$key-1]); + else + return wfMsg($wgWeekdayNamesEn[$key-1]); } function userAdjust( $ts ) { -- 2.20.1