[MediaWiki-commits] [Gerrit] Allow continuing a translation that was published - change (mediawiki...ContentTranslation)

2016-03-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Allow continuing a translation that was published
..


Allow continuing a translation that was published

Translator need to decide on overwrite or not. Warnings will be shown
about this before continuing translation and before publishing.

Bug: T102966
Change-Id: I7aa6a23d7caf521fa236b60b2be0b12f5ac6136d
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/dashboard/ext.cx.translationlist.js
A modules/dashboard/images/edit.png
A modules/dashboard/images/edit.svg
M modules/dashboard/styles/ext.cx.translationlist.less
7 files changed, 53 insertions(+), 33 deletions(-)

Approvals:
  Nikerabbit: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 0959b2b..bc42c1c 100644
--- a/extension.json
+++ b/extension.json
@@ -890,6 +890,7 @@
"messages": [
"cx-dashboard-header",
"cx-discard-translation",
+   "cx-continue-translation",
"cx-translation-status-draft",
"cx-translation-status-deleted",
"cx-translation-status-published",
diff --git a/i18n/en.json b/i18n/en.json
index 460e78a..588ff8f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -215,5 +215,6 @@
"cx-translator-total-translations-label": "Total",
"cx-page-old-revision-loaded": "This translation is based on an older 
version of the content. The source page may have [$1 changed significantly]. 
You can continue this translation or start it again to use the updated 
content.",
"cx-tools-mt-new-provider": "new",
-   "cx-tools-mt-new-providers-available": "with new options"
+   "cx-tools-mt-new-providers-available": "with new options",
+   "cx-continue-translation": "Continue translation"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 3ebf8d2..5af6889 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -221,5 +221,6 @@
"cx-translator-total-translations-label": "Label displayed in the 
translation statistics of current user.\n{{Identical|Total}}",
"cx-page-old-revision-loaded": "Warning message shown when the older 
revision of source page loaded",
"cx-tools-mt-new-provider": "Label indicating the machine translation 
provider is a new option\n{{Identical|New}}",
-   "cx-tools-mt-new-providers-available": "Label shown in machine 
translation card when there are new provider options"
+   "cx-tools-mt-new-providers-available": "Label shown in machine 
translation card when there are new provider options",
+   "cx-continue-translation": "Menu item label shown for published 
translations to continue translations"
 }
diff --git a/modules/dashboard/ext.cx.translationlist.js 
b/modules/dashboard/ext.cx.translationlist.js
index 9977372..a151828 100644
--- a/modules/dashboard/ext.cx.translationlist.js
+++ b/modules/dashboard/ext.cx.translationlist.js
@@ -198,29 +198,23 @@
 *
 * @param {Object} translation
 */
-   CXTranslationList.prototype.startTranslation = function ( translation ) 
{
+   CXTranslationList.prototype.continueTranslation = function ( 
translation ) {
if ( translation.status === 'deleted' ) {
return false;
}
 
-   if ( translation.status === 'draft' ) {
-   // Set CX token as cookie.
-   mw.cx.siteMapper.setCXToken(
-   translation.sourceLanguage,
-   translation.targetLanguage,
-   translation.sourceTitle
-   );
-   location.href = new mw.Uri( mw.cx.siteMapper.getCXUrl(
-   translation.sourceTitle,
-   translation.targetTitle,
-   translation.sourceLanguage,
-   translation.targetLanguage
-   ) ).toString();
-   }
-
-   if ( translation.status === 'published' ) {
-   location.href = translation.targetURL;
-   }
+   // Set CX token as cookie.
+   mw.cx.siteMapper.setCXToken(
+   translation.sourceLanguage,
+   translation.targetLanguage,
+   translation.sourceTitle
+   );
+   location.href = new mw.Uri( mw.cx.siteMapper.getCXUrl(
+   translation.sourceTitle,
+   translation.targetTitle,
+   translation.sourceLanguage,
+   translation.targetLanguage
+   ) ).toString();
};
 
/**
@@ -233,6 +227,7 @@

[MediaWiki-commits] [Gerrit] Allow continuing a translation that was published - change (mediawiki...ContentTranslation)

2016-03-08 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/276101

Change subject: Allow continuing a translation that was published
..

Allow continuing a translation that was published

Translator need to decide on overwrite or not. Warnings will be shown
about this before continuing translation and before publishing.

Bug: T102966
Change-Id: I7aa6a23d7caf521fa236b60b2be0b12f5ac6136d
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M modules/dashboard/ext.cx.translationlist.js
A modules/dashboard/images/continue.png
A modules/dashboard/images/continue.svg
M modules/dashboard/styles/ext.cx.translationlist.less
7 files changed, 53 insertions(+), 33 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/01/276101/1

diff --git a/extension.json b/extension.json
index 72d8d65..1de3f29 100644
--- a/extension.json
+++ b/extension.json
@@ -888,6 +888,7 @@
"messages": [
"cx-dashboard-header",
"cx-discard-translation",
+   "cx-continue-translation",
"cx-translation-status-draft",
"cx-translation-status-deleted",
"cx-translation-status-published",
diff --git a/i18n/en.json b/i18n/en.json
index 065af70..94b9625 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -213,5 +213,6 @@
"cx-tools-linter-hide-details": "Hide details",
"cx-translator-month-stats-label": "This month",
"cx-translator-total-translations-label": "Total",
-   "cx-page-old-revision-loaded": "This translation is based on an older 
version of the content. The source page may have [$1 changed significantly]. 
You can continue this translation or start it again to use the updated content."
+   "cx-page-old-revision-loaded": "This translation is based on an older 
version of the content. The source page may have [$1 changed significantly]. 
You can continue this translation or start it again to use the updated 
content.",
+   "cx-continue-translation": "Continue translation"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 7f0a3ee..28d5bef 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -219,5 +219,6 @@
"cx-tools-linter-hide-details": "Label for abusefilter error 
hide/collapse link in linter card",
"cx-translator-month-stats-label": "Label displayed in the translation 
statistics of current user.",
"cx-translator-total-translations-label": "Label displayed in the 
translation statistics of current user.\n{{Identical|Total}}",
-   "cx-page-old-revision-loaded": "Warning message shown when the older 
revision of source page loaded"
+   "cx-page-old-revision-loaded": "Warning message shown when the older 
revision of source page loaded",
+   "cx-continue-translation": "Menu item label shown for published 
translations to continue translations"
 }
diff --git a/modules/dashboard/ext.cx.translationlist.js 
b/modules/dashboard/ext.cx.translationlist.js
index 9977372..a151828 100644
--- a/modules/dashboard/ext.cx.translationlist.js
+++ b/modules/dashboard/ext.cx.translationlist.js
@@ -198,29 +198,23 @@
 *
 * @param {Object} translation
 */
-   CXTranslationList.prototype.startTranslation = function ( translation ) 
{
+   CXTranslationList.prototype.continueTranslation = function ( 
translation ) {
if ( translation.status === 'deleted' ) {
return false;
}
 
-   if ( translation.status === 'draft' ) {
-   // Set CX token as cookie.
-   mw.cx.siteMapper.setCXToken(
-   translation.sourceLanguage,
-   translation.targetLanguage,
-   translation.sourceTitle
-   );
-   location.href = new mw.Uri( mw.cx.siteMapper.getCXUrl(
-   translation.sourceTitle,
-   translation.targetTitle,
-   translation.sourceLanguage,
-   translation.targetLanguage
-   ) ).toString();
-   }
-
-   if ( translation.status === 'published' ) {
-   location.href = translation.targetURL;
-   }
+   // Set CX token as cookie.
+   mw.cx.siteMapper.setCXToken(
+   translation.sourceLanguage,
+   translation.targetLanguage,
+   translation.sourceTitle
+   );
+   location.href = new mw.Uri( mw.cx.siteMapper.getCXUrl(
+   translation.sourceTitle,
+   translation.targetTitle,
+