r82253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82252‎ | r82253 | r82254 >
Date:16:07, 16 February 2011
Author:philip
Status:ok (Comments)
Tags:
Comment:
revert r77452, r80492 and r82246.
Modified paths:
  • /trunk/phase3/includes/MessageCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MessageCache.php
@@ -576,6 +576,15 @@
577577 return false;
578578 }
579579
 580+ $lang = wfGetLangObj( $langcode );
 581+ if ( !$lang ) {
 582+ throw new MWException( "Bad lang code $langcode given" );
 583+ }
 584+
 585+ $langcode = $lang->getCode();
 586+
 587+ $message = false;
 588+
580589 # Normalise title-case input (with some inlining)
581590 $lckey = str_replace( ' ', '_', $key );
582591 if ( ord( $key ) < 128 ) {
@@ -586,32 +595,7 @@
587596 $uckey = $wgContLang->ucfirst( $lckey );
588597 }
589598
590 - $lang = wfGetLangObj( $langcode );
591 - if ( !$lang ) {
592 - throw new MWException( "Bad lang code $langcode given" );
593 - }
594 -
595599 /**
596 - * Find a suitable sub-language to present the message to user,
597 - * but prevent doing it if the message is for css/js.
598 - *
599 - * Some language like Chinese has multiple variant languages. Only
600 - * getPreferredVariant() (in LanguageConverter) could return such
601 - * sub-language. It won't effect other languages without variants.
602 - */
603 - $title = Title::newFromText( $uckey, NS_MEDIAWIKI );
604 - if ( !$title->isCssOrJsPage() ) {
605 - $langcode = $lang->getPreferredVariant();
606 - if ( $langcode != $lang->getCode() ) {
607 - $lang = wfGetLangObj( $langcode );
608 - }
609 - } else {
610 - $langcode = $lang->getCode();
611 - }
612 -
613 - $message = false;
614 -
615 - /**
616600 * Record each message request, but only once per request.
617601 * This information is not used unless $wgAdaptiveMessageCache
618602 * is enabled.

Follow-up revisions

RevisionCommit summaryAuthorDate
r822551.17wmf1: MFT r82253catrope16:29, 16 February 2011
r85151MFT: r82000, r82004, r82020, r82025, r82038, r82039, r82048, r82070, r82081, ...demon20:39, 1 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77452Select a friendly sub-language while acquiring system messages if the uselang...philip03:04, 30 November 2010
r80492Follow up r77452. Follow mark's suggest to remove getCodeForMessage() and exp...philip07:59, 18 January 2011
r82246Follow r77452, r80492. Avoid to find sub-languages when load css/js messages.philip14:18, 16 February 2011

Comments

#Comment by Catrope (talk | contribs)   16:30, 16 February 2011

This is not a full revert of r77452 (reverted one file only), was that intended?

#Comment by PhiLiP (talk | contribs)   16:33, 16 February 2011

part of r77452 has been reverted at r82255 in fact.

#Comment by PhiLiP (talk | contribs)   16:33, 16 February 2011
#Comment by Catrope (talk | contribs)   16:35, 16 February 2011

Right, got it.

Status & tagging log