$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' );
/**
* Get a message from anywhere
*/
-function wfMsg( $key ) {
+function wfMsg( $key, $convert=true ) {
global $wgRequest;
if ( $wgRequest->getVal( 'debugmsg' ) ) {
if ( $key == 'linktrail' /* a special case where we want to return something specific */ )
if ( count( $args ) ) {
array_shift( $args );
}
- return wfMsgReal( $key, $args, true );
+ return wfMsgReal( $key, $args, true, $convert );
}
/**
* Get a message from the language file
*/
-function wfMsgNoDB( $key ) {
+function wfMsgNoDB( $key, $convert=true ) {
$args = func_get_args();
if ( count( $args ) ) {
array_shift( $args );
}
- return wfMsgReal( $key, $args, false );
+ return wfMsgReal( $key, $args, false, $convert );
}
/**
* Really get a message
*/
-function wfMsgReal( $key, $args, $useDB ) {
- global $wgReplacementKeys, $wgMessageCache, $wgLang, $wgLanguageCode;
- global $wgDoZhMessageConversion;
+function wfMsgReal( $key, $args, $useDB, $convert=true ) {
+ global $wgReplacementKeys, $wgMessageCache, $wgLang;
+
$fname = 'wfMsg';
wfProfileIn( $fname );
if ( $wgMessageCache ) {
$message = "<$key>";
}
- if(strtolower($wgLanguageCode) == "zh" && $wgDoZhMessageConversion) {
- $message = $wgLang->convert($message);
- }
+ if ( $convert ) {
+ $message = $wgLang->convert($message);
+ }
+
# Replace arguments
if( count( $args ) ) {
$message = str_replace( $wgReplacementKeys, $args, $message );
*/
function wfSpecialAllmessages() {
global $wgOut, $wgAllMessagesEn, $wgRequest, $wgMessageCache, $wgTitle;
- global $wgDoZhMessageConversion, $wgLanguageCode;
$fname = "wfSpecialAllMessages";
wfProfileIn( $fname );
$messages = array();
$wgMessageCache->disableTransform();
- if(strtolower($wgLanguageCode) == "zh")
- $wgDoZhMessageConversion = false;
-
foreach ( $sortedArray as $key => $enMsg ) {
$messages[$key]['enmsg'] = $enMsg;
- $messages[$key]['statmsg'] = wfMsgNoDb( $key );
- $messages[$key]['msg'] = wfMsg ( $key );
+ $messages[$key]['statmsg'] = wfMsgNoDb( $key, false );
+ $messages[$key]['msg'] = wfMsg ( $key, false );
}
- if(strtolower($wgLanguageCode) == "zh")
- $wgDoZhMessageConversion = true;
-
$wgMessageCache->enableTransform();
wfProfileOut( "$fname-setup" );