Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -473,4 +473,13 @@ |
474 | 474 | } |
475 | 475 | return true; |
476 | 476 | } |
| 477 | + |
| 478 | + public static function disablePreSaveTransform( $article, $popts ) { |
| 479 | + global $wgTranslateMessageNamespaces, $wgTranslateDocumentationLanguageCode; |
| 480 | + if( in_array( $article->getTitle()->getNamespace(), $wgTranslateMessageNamespaces ) |
| 481 | + && $article->getTitle()->getSubpageText() !== $wgTranslateDocumentationLanguageCode ) { |
| 482 | + $popts->setPreSaveTransform( false ); |
| 483 | + } |
| 484 | + return true; |
| 485 | + } |
477 | 486 | } |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -92,6 +92,7 @@ |
93 | 93 | $wgHooks['ArticleAfterFetchContent'][] = 'TranslateEditAddons::customDisplay'; |
94 | 94 | $wgHooks['ParserBeforeStrip'][] = 'TranslateEditAddons::injectTranslationDisplayJs'; |
95 | 95 | $wgHooks['LanguageGetTranslatedLanguageNames'][] = 'TranslateEditAddons::translateMessageDocumentationLanguage'; |
| 96 | +$wgHooks['ArticlePrepareTextForEdit'][] = 'TranslateEditAddons::disablePreSaveTransform'; |
96 | 97 | |
97 | 98 | // Custom preferences |
98 | 99 | $wgDefaultUserOptions['translate'] = 0; |