r5249 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5248‎ | r5249 | r5250 >
Date:04:47, 17 September 2004
Author:zhengzhu
Status:old
Tags:
Comment:
Do Simplified/Traditional Chinese conversion in wfMsgReal() when the language code is zh
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -26,6 +26,12 @@
2727 */
2828 $wgTotalEdits = -1;
2929
 30+
 31+/**
 32+ * in "zh", whether conversion of messages should take place
 33+ */
 34+$wgDoZhMessageConversion = true;
 35+
3036 require_once( 'DatabaseFunctions.php' );
3137 require_once( 'UpdateClasses.php' );
3238 require_once( 'LogPage.php' );
@@ -384,8 +390,8 @@
385391 * Really get a message
386392 */
387393 function wfMsgReal( $key, $args, $useDB ) {
388 - global $wgReplacementKeys, $wgMessageCache, $wgLang;
389 -
 394+ global $wgReplacementKeys, $wgMessageCache, $wgLang, $wgLanguageCode;
 395+ global $wgDoZhMessageConversion;
390396 $fname = 'wfMsg';
391397 wfProfileIn( $fname );
392398 if ( $wgMessageCache ) {
@@ -397,6 +403,9 @@
398404 $message = "<$key>";
399405 }
400406
 407+ if(strtolower($wgLanguageCode) == "zh" && $wgDoZhMessageConversion) {
 408+ $message = $wgLang->convert($message);
 409+ }
401410 # Replace arguments
402411 if( count( $args ) ) {
403412 $message = str_replace( $wgReplacementKeys, $args, $message );
@@ -405,6 +414,8 @@
406415 return $message;
407416 }
408417
 418+
 419+
409420 /**
410421 * Just like exit() but makes a note of it.
411422 * Commits open transactions except if the error parameter is set

Status & tagging log