Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -26,6 +26,12 @@ |
27 | 27 | */ |
28 | 28 | $wgTotalEdits = -1; |
29 | 29 | |
| 30 | + |
| 31 | +/** |
| 32 | + * in "zh", whether conversion of messages should take place |
| 33 | + */ |
| 34 | +$wgDoZhMessageConversion = true; |
| 35 | + |
30 | 36 | require_once( 'DatabaseFunctions.php' ); |
31 | 37 | require_once( 'UpdateClasses.php' ); |
32 | 38 | require_once( 'LogPage.php' ); |
— | — | @@ -384,8 +390,8 @@ |
385 | 391 | * Really get a message |
386 | 392 | */ |
387 | 393 | function wfMsgReal( $key, $args, $useDB ) { |
388 | | - global $wgReplacementKeys, $wgMessageCache, $wgLang; |
389 | | - |
| 394 | + global $wgReplacementKeys, $wgMessageCache, $wgLang, $wgLanguageCode; |
| 395 | + global $wgDoZhMessageConversion; |
390 | 396 | $fname = 'wfMsg'; |
391 | 397 | wfProfileIn( $fname ); |
392 | 398 | if ( $wgMessageCache ) { |
— | — | @@ -397,6 +403,9 @@ |
398 | 404 | $message = "<$key>"; |
399 | 405 | } |
400 | 406 | |
| 407 | + if(strtolower($wgLanguageCode) == "zh" && $wgDoZhMessageConversion) { |
| 408 | + $message = $wgLang->convert($message); |
| 409 | + } |
401 | 410 | # Replace arguments |
402 | 411 | if( count( $args ) ) { |
403 | 412 | $message = str_replace( $wgReplacementKeys, $args, $message ); |
— | — | @@ -405,6 +414,8 @@ |
406 | 415 | return $message; |
407 | 416 | } |
408 | 417 | |
| 418 | + |
| 419 | + |
409 | 420 | /** |
410 | 421 | * Just like exit() but makes a note of it. |
411 | 422 | * Commits open transactions except if the error parameter is set |