Index: trunk/phase3/includes/MessageCache.php |
— | — | @@ -576,6 +576,15 @@ |
577 | 577 | return false; |
578 | 578 | } |
579 | 579 | |
| 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 | + |
580 | 589 | # Normalise title-case input (with some inlining) |
581 | 590 | $lckey = str_replace( ' ', '_', $key ); |
582 | 591 | if ( ord( $key ) < 128 ) { |
— | — | @@ -586,32 +595,7 @@ |
587 | 596 | $uckey = $wgContLang->ucfirst( $lckey ); |
588 | 597 | } |
589 | 598 | |
590 | | - $lang = wfGetLangObj( $langcode ); |
591 | | - if ( !$lang ) { |
592 | | - throw new MWException( "Bad lang code $langcode given" ); |
593 | | - } |
594 | | - |
595 | 599 | /** |
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 | | - /** |
616 | 600 | * Record each message request, but only once per request. |
617 | 601 | * This information is not used unless $wgAdaptiveMessageCache |
618 | 602 | * is enabled. |