From: Philip Tzou Date: Wed, 16 Feb 2011 16:07:58 +0000 (+0000) Subject: revert r77452, r80492 and r82246. X-Git-Tag: 1.31.0-rc.0~31973 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=ea02974cb6d3a902a398226720e892caf30e02cf;p=lhc%2Fweb%2Fwiklou.git revert r77452, r80492 and r82246. --- diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 69cffe45c6..d66e710c90 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -576,6 +576,15 @@ class MessageCache { return false; } + $lang = wfGetLangObj( $langcode ); + if ( !$lang ) { + throw new MWException( "Bad lang code $langcode given" ); + } + + $langcode = $lang->getCode(); + + $message = false; + # Normalise title-case input (with some inlining) $lckey = str_replace( ' ', '_', $key ); if ( ord( $key ) < 128 ) { @@ -586,31 +595,6 @@ class MessageCache { $uckey = $wgContLang->ucfirst( $lckey ); } - $lang = wfGetLangObj( $langcode ); - if ( !$lang ) { - throw new MWException( "Bad lang code $langcode given" ); - } - - /** - * Find a suitable sub-language to present the message to user, - * but prevent doing it if the message is for css/js. - * - * Some language like Chinese has multiple variant languages. Only - * getPreferredVariant() (in LanguageConverter) could return such - * sub-language. It won't effect other languages without variants. - */ - $title = Title::newFromText( $uckey, NS_MEDIAWIKI ); - if ( !$title->isCssOrJsPage() ) { - $langcode = $lang->getPreferredVariant(); - if ( $langcode != $lang->getCode() ) { - $lang = wfGetLangObj( $langcode ); - } - } else { - $langcode = $lang->getCode(); - } - - $message = false; - /** * Record each message request, but only once per request. * This information is not used unless $wgAdaptiveMessageCache