Index: trunk/phase3/includes/SpecialAllmessages.php |
— | — | @@ -10,7 +10,6 @@ |
11 | 11 | */ |
12 | 12 | function wfSpecialAllmessages() { |
13 | 13 | global $wgOut, $wgAllMessagesEn, $wgRequest, $wgMessageCache, $wgTitle; |
14 | | - global $wgDoZhMessageConversion, $wgLanguageCode; |
15 | 14 | |
16 | 15 | $fname = "wfSpecialAllMessages"; |
17 | 16 | wfProfileIn( $fname ); |
— | — | @@ -26,18 +25,12 @@ |
27 | 26 | $messages = array(); |
28 | 27 | $wgMessageCache->disableTransform(); |
29 | 28 | |
30 | | - if(strtolower($wgLanguageCode) == "zh") |
31 | | - $wgDoZhMessageConversion = false; |
32 | | - |
33 | 29 | foreach ( $sortedArray as $key => $enMsg ) { |
34 | 30 | $messages[$key]['enmsg'] = $enMsg; |
35 | | - $messages[$key]['statmsg'] = wfMsgNoDb( $key ); |
36 | | - $messages[$key]['msg'] = wfMsg ( $key ); |
| 31 | + $messages[$key]['statmsg'] = wfMsgNoDb( $key, false ); |
| 32 | + $messages[$key]['msg'] = wfMsg ( $key, false ); |
37 | 33 | } |
38 | 34 | |
39 | | - if(strtolower($wgLanguageCode) == "zh") |
40 | | - $wgDoZhMessageConversion = true; |
41 | | - |
42 | 35 | $wgMessageCache->enableTransform(); |
43 | 36 | wfProfileOut( "$fname-setup" ); |
44 | 37 | |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -27,11 +27,6 @@ |
28 | 28 | $wgTotalEdits = -1; |
29 | 29 | |
30 | 30 | |
31 | | -/** |
32 | | - * in "zh", whether conversion of messages should take place |
33 | | - */ |
34 | | -$wgDoZhMessageConversion = true; |
35 | | - |
36 | 31 | require_once( 'DatabaseFunctions.php' ); |
37 | 32 | require_once( 'UpdateClasses.php' ); |
38 | 33 | require_once( 'LogPage.php' ); |
— | — | @@ -360,7 +355,7 @@ |
361 | 356 | /** |
362 | 357 | * Get a message from anywhere |
363 | 358 | */ |
364 | | -function wfMsg( $key ) { |
| 359 | +function wfMsg( $key, $convert=true ) { |
365 | 360 | global $wgRequest; |
366 | 361 | if ( $wgRequest->getVal( 'debugmsg' ) ) { |
367 | 362 | if ( $key == 'linktrail' /* a special case where we want to return something specific */ ) |
— | — | @@ -372,26 +367,26 @@ |
373 | 368 | if ( count( $args ) ) { |
374 | 369 | array_shift( $args ); |
375 | 370 | } |
376 | | - return wfMsgReal( $key, $args, true ); |
| 371 | + return wfMsgReal( $key, $args, true, $convert ); |
377 | 372 | } |
378 | 373 | |
379 | 374 | /** |
380 | 375 | * Get a message from the language file |
381 | 376 | */ |
382 | | -function wfMsgNoDB( $key ) { |
| 377 | +function wfMsgNoDB( $key, $convert=true ) { |
383 | 378 | $args = func_get_args(); |
384 | 379 | if ( count( $args ) ) { |
385 | 380 | array_shift( $args ); |
386 | 381 | } |
387 | | - return wfMsgReal( $key, $args, false ); |
| 382 | + return wfMsgReal( $key, $args, false, $convert ); |
388 | 383 | } |
389 | 384 | |
390 | 385 | /** |
391 | 386 | * Really get a message |
392 | 387 | */ |
393 | | -function wfMsgReal( $key, $args, $useDB ) { |
394 | | - global $wgReplacementKeys, $wgMessageCache, $wgLang, $wgLanguageCode; |
395 | | - global $wgDoZhMessageConversion; |
| 388 | +function wfMsgReal( $key, $args, $useDB, $convert=true ) { |
| 389 | + global $wgReplacementKeys, $wgMessageCache, $wgLang; |
| 390 | + |
396 | 391 | $fname = 'wfMsg'; |
397 | 392 | wfProfileIn( $fname ); |
398 | 393 | if ( $wgMessageCache ) { |
— | — | @@ -403,9 +398,10 @@ |
404 | 399 | $message = "<$key>"; |
405 | 400 | } |
406 | 401 | |
407 | | - if(strtolower($wgLanguageCode) == "zh" && $wgDoZhMessageConversion) { |
408 | | - $message = $wgLang->convert($message); |
409 | | - } |
| 402 | + if ( $convert ) { |
| 403 | + $message = $wgLang->convert($message); |
| 404 | + } |
| 405 | + |
410 | 406 | # Replace arguments |
411 | 407 | if( count( $args ) ) { |
412 | 408 | $message = str_replace( $wgReplacementKeys, $args, $message ); |