From: Zheng Zhu Date: Fri, 17 Sep 2004 04:47:01 +0000 (+0000) Subject: Do Simplified/Traditional Chinese conversion in wfMsgReal() when the language code... X-Git-Tag: 1.5.0alpha1~1996 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=f1cc6051330c2f40fe16ffa660b0e3587cd0bd07;p=lhc%2Fweb%2Fwiklou.git Do Simplified/Traditional Chinese conversion in wfMsgReal() when the language code is zh --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index f84568fdb8..d021a959e7 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -26,6 +26,12 @@ $wgTotalViews = -1; */ $wgTotalEdits = -1; + +/** + * in "zh", whether conversion of messages should take place + */ +$wgDoZhMessageConversion = true; + require_once( 'DatabaseFunctions.php' ); require_once( 'UpdateClasses.php' ); require_once( 'LogPage.php' ); @@ -384,8 +390,8 @@ function wfMsgNoDB( $key ) { * Really get a message */ function wfMsgReal( $key, $args, $useDB ) { - global $wgReplacementKeys, $wgMessageCache, $wgLang; - + global $wgReplacementKeys, $wgMessageCache, $wgLang, $wgLanguageCode; + global $wgDoZhMessageConversion; $fname = 'wfMsg'; wfProfileIn( $fname ); if ( $wgMessageCache ) { @@ -397,6 +403,9 @@ function wfMsgReal( $key, $args, $useDB ) { $message = "<$key>"; } + if(strtolower($wgLanguageCode) == "zh" && $wgDoZhMessageConversion) { + $message = $wgLang->convert($message); + } # Replace arguments if( count( $args ) ) { $message = str_replace( $wgReplacementKeys, $args, $message ); @@ -405,6 +414,8 @@ function wfMsgReal( $key, $args, $useDB ) { return $message; } + + /** * Just like exit() but makes a note of it. * Commits open transactions except if the error parameter is set