jenkins-bot has submitted this change and it was merged.

Change subject: Make it possible to choose source and target languages
......................................................................


Make it possible to choose source and target languages

* URL param 'from' to specify source language. Default value is 
wgContentLanguage
* URL param 'to' to specify target language. Default value is wgUserLanguage

Change-Id: I12b1d158d19a934cf69aacae80c8f9a906c8e2b1
---
M modules/entrypoint/ext.cx.entrypoint.js
M modules/source/ext.cx.source.js
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Amire80: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/entrypoint/ext.cx.entrypoint.js 
b/modules/entrypoint/ext.cx.entrypoint.js
index 1bd1a67..d8377a0 100644
--- a/modules/entrypoint/ext.cx.entrypoint.js
+++ b/modules/entrypoint/ext.cx.entrypoint.js
@@ -41,7 +41,7 @@
                window.location.href = mw.util.getUrl(
                        'Special:ContentTranslation', {
                                page: sourceTitle,
-                               lang: targetLanguage,
+                               to: targetLanguage,
                                targettitle: targetTitle
                        }
                );
diff --git a/modules/source/ext.cx.source.js b/modules/source/ext.cx.source.js
index 8d2d4c1..9e4dc11 100644
--- a/modules/source/ext.cx.source.js
+++ b/modules/source/ext.cx.source.js
@@ -45,8 +45,8 @@
 
        ContentTranslationSource.prototype.init = function () {
                mw.cx.sourceTitle = new mw.Uri().query.page;
-               mw.cx.targetLanguage = new mw.Uri().query.lang || '';
-               mw.cx.sourceLanguage = mw.config.get( 'wgContentLanguage' );
+               mw.cx.targetLanguage = new mw.Uri().query.to || mw.config.get( 
'wgUserLanguage' );
+               mw.cx.sourceLanguage = new mw.Uri().query.from || 
mw.config.get( 'wgContentLanguage' );
                this.render();
                mw.cx.fetchPage( mw.cx.sourceTitle, mw.cx.sourceLanguage );
                this.listen();

-- 
To view, visit https://gerrit.wikimedia.org/r/136978
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I12b1d158d19a934cf69aacae80c8f9a906c8e2b1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>
Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il>
Gerrit-Reviewer: KartikMistry <kartik.mis...@gmail.com>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to