Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/53037
Change subject: PageTranslation with ULS
......................................................................
PageTranslation with ULS
Possibility for ULS to also control content language
Change-Id: I05948032c637abc777e4ccc29aca909ee3ac77a2
---
M Translate.php
M tag/PageTranslationHooks.php
2 files changed, 23 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
refs/changes/37/53037/1
diff --git a/Translate.php b/Translate.php
index ebc809a..be1fafd 100644
--- a/Translate.php
+++ b/Translate.php
@@ -489,6 +489,14 @@
),
) + $resourcePaths;
+$wgResourceModules['ext.translate.pagetranslation.uls'] = array(
+ 'scripts' => 'resources/js/ext.translate.pagetranslation.uls.js',
+ 'dependencies' => array(
+ 'ext.uls.init',
+ 'mediawiki.util',
+ ),
+) + $resourcePaths;
+
$wgResourceModules['jquery.autoresize'] = array(
'scripts' => 'resources/js/jquery.autoresize.js',
) + $resourcePaths;
@@ -654,6 +662,13 @@
*/
$wgPageTranslationNamespace = 1198;
+/**
+ * When user changes interface language via ULS, should we also switch the
+ * language of the translatable page.
+ * @since 2013-03-10
+ */
+$wgTranslatePageTranslationULS = false;
+
# </source>
# === Message group configuration ===
# <source lang=php>
diff --git a/tag/PageTranslationHooks.php b/tag/PageTranslationHooks.php
index 283d57f..6de0d45 100644
--- a/tag/PageTranslationHooks.php
+++ b/tag/PageTranslationHooks.php
@@ -68,8 +68,14 @@
}
/// Hook: OutputPageBeforeHTML
- public static function injectCss( OutputPage $outputpage, /*string*/
$text ) {
- $outputpage->addModules( 'ext.translate' );
+ public static function injectCss( OutputPage $out, /*string*/ $text ) {
+ $title = $out->getTitle();
+ if ( TranslatablePage::isSourcePage( $title ) ||
TranslatablePage::isTranslationPage( $title ) ) {
+ $out->addModules( 'ext.translate' );
+ if ( $wgTranslatePageTranslationULS ) {
+ $out->addModules(
'ext.translate.pagetranslation.uls' );
+ }
+ }
return true;
}
--
To view, visit https://gerrit.wikimedia.org/r/53037
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I05948032c637abc777e4ccc29aca909ee3ac77a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits