jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/351624 )
Change subject: Reuse i18n messages and use right submit label
......................................................................
Reuse i18n messages and use right submit label
The label of the submit button can differ depending on a conf setting.
The extension should use the label fitting that setting.
Bug: T164151
Bug: T162775
Change-Id: Ib09c4c6af39067d783442f0a7d229634d835a6b3
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/TwoColConflictPage.php
M modules/ext.TwoColConflict.HelpDialog.js
M modules/ext.TwoColConflict.init.js
6 files changed, 35 insertions(+), 22 deletions(-)
Approvals:
Tobias Gritschacher: Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index 03c33ce..89e4ab6 100644
--- a/extension.json
+++ b/extension.json
@@ -122,6 +122,7 @@
"twoColConflict-help-dialog-slide3",
"twoColConflict-help-dialog-slide4",
"twoColConflict-help-dialog-slide5",
+ "twoColConflict-label-show",
"twoColConflict-tutorial",
"twoColConflict-previous-dialog",
"twoColConflict-next-dialog",
diff --git a/i18n/en.json b/i18n/en.json
index 6aac1bf..09d5e4d 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -17,10 +17,10 @@
"twoColConflict-history-link": "revision history",
"twoColConflict-editor-col-title": "Editor with version to be
published",
"twoColConflict-editor-col-desc-1": "Initially, the editor's content is
the currently published version.",
- "twoColConflict-editor-col-desc-2": "Add your changes to the text in
the editor and click on \"Publish changes\".",
+ "twoColConflict-editor-col-desc-2": "Add your changes to the text in
the editor and click on \"$1\".",
"twoColConflict-base-selection-desc-1": "1) Choose the base version in
the popup below.",
"twoColConflict-base-selection-desc-2": "2) Adjust the text to combine
both versions.",
- "twoColConflict-base-selection-desc-3": "3) Click on \"publish
changes\". Only what is in the editor will be published.",
+ "twoColConflict-base-selection-desc-3": "3) Click on \"$1\". Only what
is in the editor will be published.",
"twoColConflict-base-selection-dialog-text": "What should initially be
in the editor and serve as a basis for combining the conflict versions?",
"twoColConflict-base-selection-own-label": "My text",
"twoColConflict-base-selection-foreign-label": "The currently published
version",
@@ -35,9 +35,9 @@
"twoColConflict-show-help-tooltip": "Show help text",
"twoColConflict-help-dialog-slide1": "This page helps you to resolve an
edit conflict. There are two columns: The first shows the conflicting changes
and the second is a text editor, whose content will be published.\n\nFeedback
is very much appreciated
[//www.mediawiki.org/wiki/Help_talk:Two_Column_Edit_Conflict_View here].",
"twoColConflict-help-dialog-slide2": "The first column shows the
changes in your version and the changes in the currently saved version. The
differences between both versions are highlighted.",
- "twoColConflict-help-dialog-slide3": "At the top of the first column
you can click on “show” to see unchanged text. This might help to understand
the context of changes. By default, unchanged text is greyed out and
collapsed.",
+ "twoColConflict-help-dialog-slide3": "At the top of the first column
you can click on \"{{int:twoColConflict-label-show}}\" to see unchanged text.
This might help to understand the context of changes. By default, unchanged
text is greyed out and collapsed.",
"twoColConflict-help-dialog-slide4": "The second column is an editor.
When the page is opened, there is a selection box on top of the editor. It lets
you decide which version should be in the editor. This is often the version
where more changes were made.",
- "twoColConflict-help-dialog-slide5": "Copy and paste the desired parts
of the other version into the text in the editor. Only what is in the editor
will be published, when you click the \"Publish changes\" button.",
+ "twoColConflict-help-dialog-slide5": "Copy and paste the desired parts
of the other version into the text in the editor. Only what is in the editor
will be published, when you click the \"$1\" button.",
"twoColConflict-tutorial": "Edit conflict solving tutorial",
"twoColConflict-previous-dialog": "Previous",
"twoColConflict-next-dialog": "Next",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index c755360..fb551be 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -21,10 +21,10 @@
"twoColConflict-history-link": "Text for the link the revision history
of the article.",
"twoColConflict-editor-col-title": "{{doc-important|The \"editor\" here
refers to the editor softwares/extensions/features such as Wikitext editor,
VisualEditor, ... etc. Not a person who edits pages.}}\nHeader for the editor
column.",
"twoColConflict-editor-col-desc-1": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a person who edits pages.}}\nFirst half of
the description for the editor column.",
- "twoColConflict-editor-col-desc-2": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a person who edits pages.}}\nSecond half of
the description for the editor column.\n\n\"Publish changes\" is
{{msg-mw|Publishchanges}}.",
+ "twoColConflict-editor-col-desc-2": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a person who edits pages.}}\nSecond half of
the description for the editor column.\n\nParameters:\n$1 - Label of the save
button. Either {{msg-mw|savechanges}} or {{msg-mw|publishchanges}}.",
"twoColConflict-base-selection-desc-1": "The first point describing the
steps to be taken in the base version selection for the editor.",
"twoColConflict-base-selection-desc-2": "The second point describing
the steps to be taken after the base version was selected.",
- "twoColConflict-base-selection-desc-3": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a person who edits pages.}}\nThe third point
describing the steps to be taken after the base version was selected and the
content was merged.\n\n\"Publish changes\" is {{msg-mw|Publishchanges}}.",
+ "twoColConflict-base-selection-desc-3": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a person who edits pages.}}\nThe third point
describing the steps to be taken after the base version was selected and the
content was merged.\n\nParameters:\n$1 - Label of the save button. Either
{{msg-mw|savechanges}} or {{msg-mw|publishchanges}}.",
"twoColConflict-base-selection-dialog-text": "{{doc-important|The
\"editor\" here refers to the editor softwares/extensions/features such as
Wikitext editor, VisualEditor, ... etc. Not a person who edits pages.}}\nThe
text shown in the dialog when selecting a base version to solve a conflict.",
"twoColConflict-base-selection-own-label": "The label for the option in
the base version selection dialog to select your own text as base.",
"twoColConflict-base-selection-foreign-label": "The label for the
option in the base version selection dialog to select the foreign version as
base.",
@@ -39,9 +39,9 @@
"twoColConflict-show-help-tooltip": "Text shown in a tooltip for the
\"Show help\" button.",
"twoColConflict-help-dialog-slide1": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a person who edits pages.}}\nText shown on
the first slide of the help dialog.",
"twoColConflict-help-dialog-slide2": "Text shown on the second slide of
the help dialog.",
- "twoColConflict-help-dialog-slide3": "Text shown on the third slide of
the help dialog.\n\n\"show\" is {{msg-mw|twoColConflict-label-show}} and
\"mine\" is {{msg-mw|twoColConflict-label-mine}}.",
- "twoColConflict-help-dialog-slide4": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a person who edits pages.}}\nText shown on
the fourth slide of the help dialog.",
- "twoColConflict-help-dialog-slide5": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a person who edits pages.}}\nText shown on
the fifth slide of the help dialog.",
+ "twoColConflict-help-dialog-slide3": "Text shown on the third slide of
the help dialog.\n\n See also:\n{{msg-mw|twoColConflict-label-show}}.",
+ "twoColConflict-help-dialog-slide4": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a random user who edited some pages.}}\nText
shown on the fourth slide of the help dialog.",
+ "twoColConflict-help-dialog-slide5": "{{doc-important|The \"editor\"
here refers to the editor softwares/extensions/features such as Wikitext
editor, VisualEditor, ... etc. Not a random user who edited some pages.}}\nText
shown on the fifth slide of the help dialog.\n\nParameters:\n$1 - Label of the
save button. Either {{msg-mw|savechanges}} or {{msg-mw|publishchanges}}.",
"twoColConflict-tutorial": "Text shown above the TwoColConflict
tutorial. This should contain as few words as possible to avoid being
truncated.",
"twoColConflict-previous-dialog": "Label of the button to go to the
previous tutorial slide.\n{{Identical|Previous}}",
"twoColConflict-next-dialog": "Label of the button to go to the next
tutorial slide.\n{{Identical|Next}}",
diff --git a/includes/TwoColConflictPage.php b/includes/TwoColConflictPage.php
index a0a19e0..dc4ae50 100644
--- a/includes/TwoColConflictPage.php
+++ b/includes/TwoColConflictPage.php
@@ -24,19 +24,21 @@
protected function addExplainConflictHeader( OutputPage $out ) {
// don't show conflict message when coming from VisualEditor
if ( $this->getContext()->getRequest()->getVal( 'veswitched' )
!== "1" ) {
- $labelAsPublish = $this->context->getConfig()->get(
- 'EditSubmitButtonLabelPublish'
- );
-
- $buttonLabel = $this->context->msg(
- $labelAsPublish ? 'publishchanges' :
'savechanges'
- )->text();
-
$out->wrapWikiMsg(
"<div class='mw-twocolconflict-explainconflict
warningbox'>\n$1\n</div>",
- [ 'twoColConflict-explainconflict',
$buttonLabel ]
+ [ 'twoColConflict-explainconflict',
$this->getSubmitButtonLabel() ]
);
}
+ }
+
+ private function getSubmitButtonLabel() {
+ $labelAsPublish = $this->context->getConfig()->get(
+ 'EditSubmitButtonLabelPublish'
+ );
+
+ return $this->context->msg(
+ $labelAsPublish ? 'publishchanges' : 'savechanges'
+ )->text();
}
/**
@@ -283,12 +285,14 @@
$out .= '<div class="mw-twocolconflict-col-desc">';
$out .= '<div class="mw-twocolconflict-edit-desc">';
$out .= '<p>' . $this->getContext()->msg(
'twoColConflict-editor-col-desc-1' ) . '</p>';
- $out .= '<p>' . $this->getContext()->msg(
'twoColConflict-editor-col-desc-2' ) . '</p>';
+ $out .= '<p>'
+ . $this->getContext()->msg(
'twoColConflict-editor-col-desc-2', $this->getSubmitButtonLabel() ) . '</p>';
$out .= '</div>';
$out .= '<ol class="mw-twocolconflict-base-selection-desc">';
$out .= '<li>' . $this->getContext()->msg(
'twoColConflict-base-selection-desc-1' ) . '</li>';
$out .= '<li>' . $this->getContext()->msg(
'twoColConflict-base-selection-desc-2' ) . '</li>';
- $out .= '<li>' . $this->getContext()->msg(
'twoColConflict-base-selection-desc-3' ) . '</li>';
+ $out .= '<li>'
+ . $this->getContext()->msg(
'twoColConflict-base-selection-desc-3', $this->getSubmitButtonLabel() ) .
'</li>';
$out .= '</ol></div></div>';
return $out;
@@ -575,6 +579,7 @@
private function addJS() {
$this->context->getOutput()->addJsConfigVars(
'wgTwoColConflict', 'true' );
$this->context->getOutput()->addJsConfigVars(
'wgTwoColConflictWikiEditor', $this->wikiEditorIsEnabled() );
+ $this->context->getOutput()->addJsConfigVars(
'wgTwoColConflictSubmitLabel', $this->getSubmitButtonLabel() );
$this->context->getOutput()->addModules( [
'ext.TwoColConflict.initJs',
diff --git a/modules/ext.TwoColConflict.HelpDialog.js
b/modules/ext.TwoColConflict.HelpDialog.js
index 228408a..fe5ca54 100644
--- a/modules/ext.TwoColConflict.HelpDialog.js
+++ b/modules/ext.TwoColConflict.HelpDialog.js
@@ -37,6 +37,7 @@
this.slides.push(
this.getSlide(
this.config.slides[ i ].message,
+ this.config.slides[ i
].parameters,
this.config.slides[ i
].imageClass,
this.config.slides[ i
].imageMode
)
@@ -59,13 +60,14 @@
/**
* @param {string} message to be parse by mw.message
+ * @param {Object[]} parameters array of message parameters
* @param {string} imageClass class of image to show
* @param {string} imageMode how the image should be displayed,
possible values:
* - "landscape"
* - "portrait"
* @return {OO.ui.PanelLayout}
*/
- getSlide: function ( message, imageClass, imageMode ) {
+ getSlide: function ( message, parameters, imageClass, imageMode
) {
var slide = new OO.ui.PanelLayout( { $: this.$, padded:
true, expanded: false } );
slide.$element
@@ -77,7 +79,7 @@
)
.append(
$( '<p>' ).addClass(
this.getCssPrefix() + '-help-dialog-text' )
- .html( mw.message( message
).parse() )
+ .html( mw.message( message,
parameters ).parse() )
);
slide.$element.find( 'a' ).attr( 'target', '_blank' );
diff --git a/modules/ext.TwoColConflict.init.js
b/modules/ext.TwoColConflict.init.js
index 09b0585..d8413d5 100644
--- a/modules/ext.TwoColConflict.init.js
+++ b/modules/ext.TwoColConflict.init.js
@@ -33,26 +33,31 @@
slides: [
{
message:
'twoColConflict-help-dialog-slide1',
+ parameters: [],
imageClass:
'mw-twocolconflict-help-dialog-slide-1',
imageMode: 'landscape'
},
{
message:
'twoColConflict-help-dialog-slide2',
+ parameters: [],
imageClass:
'mw-twocolconflict-help-dialog-slide-2',
imageMode: 'landscape'
},
{
message:
'twoColConflict-help-dialog-slide3',
+ parameters: [],
imageClass:
'mw-twocolconflict-help-dialog-slide-3',
imageMode: 'landscape'
},
{
message:
'twoColConflict-help-dialog-slide4',
+ parameters: [],
imageClass:
'mw-twocolconflict-help-dialog-slide-4',
imageMode: 'landscape'
},
{
message:
'twoColConflict-help-dialog-slide5',
+ parameters: [ mw.config.get(
'wgTwoColConflictSubmitLabel' ) ],
imageClass:
'mw-twocolconflict-help-dialog-slide-5',
imageMode: 'landscape'
}
--
To view, visit https://gerrit.wikimedia.org/r/351624
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib09c4c6af39067d783442f0a7d229634d835a6b3
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/TwoColConflict
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Andrew-WMDE <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits