revert r77452, r80492 and r82246.
authorPhilip Tzou <philip@users.mediawiki.org>
Wed, 16 Feb 2011 16:07:58 +0000 (16:07 +0000)
committerPhilip Tzou <philip@users.mediawiki.org>
Wed, 16 Feb 2011 16:07:58 +0000 (16:07 +0000)
includes/MessageCache.php

index 69cffe4..d66e710 100644 (file)
@@ -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