From: Zheng Zhu Date: Mon, 11 Oct 2004 02:15:55 +0000 (+0000) Subject: For content language, removed language code suffix from the message keys in the media... X-Git-Tag: 1.5.0alpha1~1605 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=9aae1d5065cee553d93882c20a755e58efabe2d8;p=lhc%2Fweb%2Fwiklou.git For content language, removed language code suffix from the message keys in the mediawiki: namespace. This way languages that do not support multiple variants will see no change in the way the namespace works. --- diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 9b4c3d7b7c..2a31c0d92e 100755 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -207,8 +207,9 @@ class MessageCache } function get( $key, $useDB, $forcontent=true ) { + global $wgContLanguageCode; if($forcontent) { - global $wgContLang, $wgContLanguageCode; + global $wgContLang; $lang = $wgContLang; $langcode = $wgContLanguageCode; } @@ -224,8 +225,9 @@ class MessageCache $message = false; if ( !$this->mDisable && $useDB ) { - $title = $lang->ucfirst( $key )."/$langcode"; - + $title = $lang->ucfirst( $key ); + if($langcode!=$wgContLanguageCode) + $title.="/$langcode"; # Try the cache if ( $this->mUseCache && $this->mCache && array_key_exists( $title, $this->mCache ) ) { diff --git a/includes/SpecialAllmessages.php b/includes/SpecialAllmessages.php index ea5a6206d4..2001c414c0 100644 --- a/includes/SpecialAllmessages.php +++ b/includes/SpecialAllmessages.php @@ -94,7 +94,7 @@ function makePhp($messages) { * */ function makeHTMLText( $messages ) { - global $wgLang, $wgUser, $wgLanguageCode; + global $wgLang, $wgUser, $wgLanguageCode, $wgContLanguageCode; $fname = "makeHTMLText"; wfProfileIn( $fname ); @@ -130,7 +130,9 @@ function makeHTMLText( $messages ) { wfProfileIn( "$fname-output" ); foreach( $messages as $key => $m ) { - $title = $wgLang->ucfirst( $key )."/$wgLanguageCode"; + $title = $wgLang->ucfirst( $key ); + if($wgLanguageCode != $wgContLanguageCode) + $title.="/$wgLanguageCode"; $titleObj =& Title::makeTitle( NS_MEDIAWIKI, $title ); $talkPage =& Title::makeTitle( NS_MEDIAWIKI_TALK, $title ); diff --git a/maintenance/InitialiseMessages.inc b/maintenance/InitialiseMessages.inc index da172fc882..9d5c94892b 100755 --- a/maintenance/InitialiseMessages.inc +++ b/maintenance/InitialiseMessages.inc @@ -41,8 +41,12 @@ function initialiseMessages( $overwrite = false, $messageArray = false ) { if(!is_object($lang)) { die ("class $langclass not defined. perhaps you need to include the file $langclass.php in $wgContLangClass.php?"); } + if($v==$wgContLanguageCode) + $suffix=''; + else + $suffix="/$v"; foreach ($sortedArray as $key => $msg) { - $messages[$key."/$v"] = $lang->getMessage($key); + $messages[$key.$suffix] = $lang->getMessage($key); } }