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

Change subject: Edit summary in content language at Special:PagePreparation and 
Special:PageMigration
......................................................................


Edit summary in content language at Special:PagePreparation and 
Special:PageMigration

The edit summary used at both the special pages is now in the
content language, i.e, the language of the wiki. Previously, it was
appearing in the user interface language in case of PagePreparation
and was hardcoded to English in case of PageMigration.

Bug: 69592
Change-Id: I91b2d4e25f7852d2bc0bfa26e934a31bf20a42ba
---
M Resources.php
M i18n/pagetranslation/en.json
M i18n/pagetranslation/qqq.json
M resources/js/ext.translate.pagepreparation.js
M resources/js/ext.translate.special.pagemigration.js
M specials/SpecialPageMigration.php
M specials/SpecialPagePreparation.php
7 files changed, 10 insertions(+), 3 deletions(-)

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



diff --git a/Resources.php b/Resources.php
index a863591..c4e3f94 100644
--- a/Resources.php
+++ b/Resources.php
@@ -381,7 +381,8 @@
                'pm-add-icon-hover-text',
                'pm-swap-icon-hover-text',
                'pm-delete-icon-hover-text',
-               'pm-pagetitle-invalid'
+               'pm-pagetitle-invalid',
+               'pm-summary-import',
        ),
 ) + $resourcePaths;
 
diff --git a/i18n/pagetranslation/en.json b/i18n/pagetranslation/en.json
index 3ae170d..59b555e 100644
--- a/i18n/pagetranslation/en.json
+++ b/i18n/pagetranslation/en.json
@@ -179,6 +179,7 @@
     "pm-swap-icon-hover-text": "Swap with unit below",
     "pm-delete-icon-hover-text": "Delete unit",
     "pm-pagetitle-invalid": "Please enter a valid page title",
+    "pm-summary-import": "Imported translation using 
[[Special:PageMigration|page migration]]",
     "tpt-translate-title": "Allow translation of page title",
     "pp-save-summary": "Prepared the page for translation",
     "pagepreparation": "Prepare page for translation",
diff --git a/i18n/pagetranslation/qqq.json b/i18n/pagetranslation/qqq.json
index 70a082e..3481a38 100644
--- a/i18n/pagetranslation/qqq.json
+++ b/i18n/pagetranslation/qqq.json
@@ -179,6 +179,7 @@
        "pm-swap-icon-hover-text": "Hover text for swap with unit below icon",
        "pm-delete-icon-hover-text": "Hover text for delete unit icon",
        "pm-pagetitle-invalid": "Error message given when an invalid page title 
is entered",
+       "pm-summary-import": "Edit summary used while creating translation 
pages which were imported using Special:PageMigration",
        "tpt-translate-title": "Checkbox on Special:PageTranslation to mark 
title for translation",
        "pp-save-summary": "Edit summary for saving a page prepared for 
translation by the tool",
        "pagepreparation": "{{doc-special|PageMigration}}",
diff --git a/resources/js/ext.translate.pagepreparation.js 
b/resources/js/ext.translate.pagepreparation.js
index 64d0449..538fefc 100644
--- a/resources/js/ext.translate.pagepreparation.js
+++ b/resources/js/ext.translate.pagepreparation.js
@@ -15,7 +15,7 @@
                        format: 'json',
                        title: pageName,
                        text: pageContent,
-                       summary: mw.msg( 'pp-save-summary' ),
+                       summary: $( '#pp-summary' ).val(),
                } ).promise();
        }
 
diff --git a/resources/js/ext.translate.special.pagemigration.js 
b/resources/js/ext.translate.special.pagemigration.js
index d318d14..90def74 100644
--- a/resources/js/ext.translate.special.pagemigration.js
+++ b/resources/js/ext.translate.special.pagemigration.js
@@ -18,7 +18,7 @@
 
                        identifier = sourceUnits[i].identifier;
                        title = 'Translations:' + pageName + '/' + identifier + 
'/' + langCode;
-                       summary = 'imported translation using 
[[Special:PageMigration]]';
+                       summary = $( '#pm-summary' ).val();
 
                        deferred = api.postWithEditToken( {
                                action: 'edit',
diff --git a/specials/SpecialPageMigration.php 
b/specials/SpecialPageMigration.php
index 57a82b7..098c056 100644
--- a/specials/SpecialPageMigration.php
+++ b/specials/SpecialPageMigration.php
@@ -33,6 +33,8 @@
                $out .= Html::closeElement( 'div' );
                $out .= Html::openElement( 'form', array( 'class' => 
'mw-tpm-sp-form row',
                        'id' => 'mw-tpm-sp-primary-form' ) );
+               $out .= Html::element( 'input', array( 'id' => 'pm-summary', 
'type' => 'hidden',
+                       'value' => $this->msg( 'pm-summary-import' 
)->inContentLanguage()->text() ) );
                $out .= Html::element( 'input', array( 'id' => 'title', 'class' 
=> 'mw-searchInput',
                        'placeholder' => $this->msg( 'pm-pagename-placeholder' 
)->text() ) );
                $out .= Html::element( 'input', array( 'id' => 'language', 
'type' => 'text',
diff --git a/specials/SpecialPagePreparation.php 
b/specials/SpecialPagePreparation.php
index 6b05634..e355626 100644
--- a/specials/SpecialPagePreparation.php
+++ b/specials/SpecialPagePreparation.php
@@ -21,6 +21,7 @@
                $pagenamePlaceholder = $this->msg( 'pp-pagename-placeholder' 
)->escaped();
                $prepareButtonValue = $this->msg( 'pp-prepare-button-label' 
)->escaped();
                $saveButtonValue = $this->msg( 'pp-save-button-label' 
)->escaped();
+               $summaryValue = $this->msg( 'pp-save-summary' 
)->inContentLanguage();
                $output->addModules( 'ext.translate.pagepreparation' );
                $output->addModuleStyles( 'jquery.uls.grid' );
                $param = $request->getText( 'param' );
@@ -33,6 +34,7 @@
                $out = <<<HTML
 <div class="grid">
        <form class="mw-tpp-sp-form row" name="mw-tpp-sp-input-form">
+               <input id="pp-summary" type="hidden" value="{$summaryValue}" />
                <input name="title" id="title" class="mw-searchInput 
mw-ui-input"
                        placeholder="{$pagenamePlaceholder}" />
                <button id="action-prepare" class="mw-ui-button mw-ui-primary" 
type="button">

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I91b2d4e25f7852d2bc0bfa26e934a31bf20a42ba
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: BPositive <[email protected]>
Gerrit-Reviewer: BPositive <[email protected]>
Gerrit-Reviewer: Nemo bis <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to