Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -31,22 +31,16 @@ |
32 | 32 | |
33 | 33 | // Set display title |
34 | 34 | $page = TranslatablePage::isTranslationPage( $title ); |
35 | | - if ( $page ) { |
36 | | - list( , $code ) = TranslateUtils::figureMessage( $title->getText() ); |
37 | | - $name = $page->getPageDisplayTitle( $code ); |
| 35 | + if ( !$page ) { |
| 36 | + return true; |
| 37 | + } |
38 | 38 | |
39 | | - if ( $name ) { |
40 | | - $realFunction = array( 'MessageCache', 'singleton' ); |
| 39 | + list( , $code ) = TranslateUtils::figureMessage( $title->getText() ); |
| 40 | + $name = $page->getPageDisplayTitle( $code ); |
41 | 41 | |
42 | | - if ( is_callable( $realFunction ) ) { |
43 | | - $cache = MessageCache::singleton(); |
44 | | - } else { |
45 | | - global $wgMessageCache; |
46 | | - $cache = $wgMessageCache; |
47 | | - } |
48 | | - $name = $cache->transform( $name, false, Language::factory( $code ) ); |
49 | | - $parser->getOutput()->setDisplayTitle( $name ); |
50 | | - } |
| 42 | + if ( $name ) { |
| 43 | + $name = $parser->recursivePreprocess( $name ); |
| 44 | + $parser->getOutput()->setDisplayTitle( $name ); |
51 | 45 | } |
52 | 46 | |
53 | 47 | return true; |