Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -1632,7 +1632,7 @@ |
1633 | 1633 | * @return string |
1634 | 1634 | */ |
1635 | 1635 | function getPreviewText() { |
1636 | | - global $wgOut, $wgUser, $wgTitle, $wgParser, $wgLang, $wgContLang; |
| 1636 | + global $wgOut, $wgUser, $wgTitle, $wgParser, $wgLang, $wgContLang, $wgMessageCache; |
1637 | 1637 | |
1638 | 1638 | wfProfileIn( __METHOD__ ); |
1639 | 1639 | |
— | — | @@ -1684,19 +1684,9 @@ |
1685 | 1685 | |
1686 | 1686 | // Parse mediawiki messages with correct target language |
1687 | 1687 | if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { |
1688 | | - $pos = strrpos( $this->mTitle->getText(), '/' ); |
1689 | | - if ( $pos !== false ) { |
1690 | | - $code = substr( $this->mTitle->getText(), $pos+1 ); |
1691 | | - switch ($code) { |
1692 | | - case $wgLang->getCode(): |
1693 | | - $obj = $wgLang; break; |
1694 | | - case $wgContLang->getCode(): |
1695 | | - $obj = $wgContLang; break; |
1696 | | - default: |
1697 | | - $obj = Language::factory( $code ); |
1698 | | - } |
1699 | | - $parserOptions->setTargetLanguage( $obj ); |
1700 | | - } |
| 1688 | + list( /* $unused */, $lang ) = $wgMessageCache->figureMessage( $this->mTitle->getText() ); |
| 1689 | + $obj = wfGetLangObj( $lang ); |
| 1690 | + $parserOptions->setTargetLanguage( $obj ); |
1701 | 1691 | } |
1702 | 1692 | |
1703 | 1693 | |