Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -514,4 +514,15 @@ |
515 | 515 | |
516 | 516 | return true; |
517 | 517 | } |
| 518 | + |
| 519 | + public static function preventCategorization( $updater ) { |
| 520 | + global $wgTranslateDocumentationLanguageCode; |
| 521 | + $title = $updater->getTitle(); |
| 522 | + list( , $code ) = TranslateUtils::figureMessage( $title ); |
| 523 | + if ( $title->getNamespace() == NS_TRANSLATIONS && $code !== $wgTranslateDocumentationLanguageCode ) { |
| 524 | + $updater->mCategories = array(); |
| 525 | + } |
| 526 | + return true; |
| 527 | + } |
| 528 | + |
518 | 529 | } |
Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -150,6 +150,8 @@ |
151 | 151 | } |
152 | 152 | |
153 | 153 | static function buttonHack( $editpage, &$buttons, $tabindex ) { |
| 154 | + global $wgTranslateDocumentationLanguageCode; |
| 155 | + |
154 | 156 | if ( !self::isMessageNamespace( $editpage->mTitle ) ) { |
155 | 157 | return true; |
156 | 158 | } |
— | — | @@ -158,7 +160,7 @@ |
159 | 161 | |
160 | 162 | list( , $code ) = self::figureMessage( $editpage->mTitle ); |
161 | 163 | |
162 | | - if ( $code !== 'qqq' ) { |
| 164 | + if ( $code !== $wgTranslateDocumentationLanguageCode ) { |
163 | 165 | return true; |
164 | 166 | } |
165 | 167 | |
— | — | @@ -231,10 +233,8 @@ |
232 | 234 | global $wgTranslateDocumentationLanguageCode, $wgOut, $wgRequest; |
233 | 235 | |
234 | 236 | $th = new TranslationHelpers( $object->mTitle ); |
235 | | - |
236 | 237 | if ( $object->firsttime && !$wgRequest->getCheck( 'oldid' ) && !$wgRequest->getCheck( 'undo' ) ) { |
237 | | - } else { |
238 | | - $th->setTranslation( $object->textbox1 ); |
| 238 | + $object->textbox1 = $th->getTranslation(); |
239 | 239 | } |
240 | 240 | |
241 | 241 | TranslateUtils::injectCSS(); |
— | — | @@ -394,4 +394,12 @@ |
395 | 395 | |
396 | 396 | return true; |
397 | 397 | } |
| 398 | + |
| 399 | + public static function customDisplay( $article, &$content ) { |
| 400 | + if ( self::isMessageNamespace( $article->getTitle() ) ) { |
| 401 | + $content = "<pre><nowiki>$content</nowiki></pre>"; |
| 402 | + } |
| 403 | + return true; |
| 404 | + } |
| 405 | + |
398 | 406 | } |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -58,6 +58,7 @@ |
59 | 59 | $wgHooks['EditPageBeforeEditButtons'][] = 'TranslateEditAddons::buttonHack'; |
60 | 60 | $wgHooks['EditPage::showEditForm:fields'][] = 'TranslateEditAddons::keepFields'; |
61 | 61 | $wgHooks['SkinTemplateTabs'][] = 'TranslateEditAddons::tabs'; |
| 62 | +#$wgHooks['ArticleAfterFetchContent'][] = 'TranslateEditAddons::customDisplay'; |
62 | 63 | |
63 | 64 | # Custom preferences |
64 | 65 | $wgDefaultUserOptions['translate'] = 0; |
— | — | @@ -291,6 +292,8 @@ |
292 | 293 | $wgHooks['ParserTestTables'][] = 'PageTranslationHooks::parserTestTables'; |
293 | 294 | |
294 | 295 | $wgHooks['SkinTemplateToolboxEnd'][] = 'PageTranslationHooks::exportToolbox'; |
| 296 | + |
| 297 | + $wgHooks['LinksUpdate'][] = 'PageTranslationHooks::preventCategorization'; |
295 | 298 | } |
296 | 299 | } |
297 | 300 | |