Template dialog button title toggles between Insert/Edit

Depends on whether this is a new or existing template transclusion.

Split from Ib9b76cac7cd57245e8db2ef10879069a86a6269e

Bug: T276568
Change-Id: I4d22e32fef067b640e9a9389deffaace736c3405
This commit is contained in:
Adam Wight 2021-06-02 11:59:38 +02:00
parent 42b9c3b21d
commit c49478de60
4 changed files with 9 additions and 1 deletions

View file

@ -2178,6 +2178,7 @@
"templatedata-doc-subpage",
"visualeditor-changedesc-mwtransclusion",
"visualeditor-dialog-template-title",
"visualeditor-dialog-transclusion-action-save",
"visualeditor-dialog-transclusion-add-content",
"visualeditor-dialog-transclusion-add-param",
"visualeditor-dialog-transclusion-add-template",

View file

@ -168,6 +168,7 @@
"visualeditor-dialog-table-sortable": "Sortable",
"visualeditor-dialog-table-wikitable": "Styled (wikitable)",
"visualeditor-dialog-template-title": "Template",
"visualeditor-dialog-transclusion-action-save": "Save",
"visualeditor-dialog-transclusion-absent-template": "The \"$1\" template doesn't yet exist.",
"visualeditor-dialog-transclusion-add-content": "Add content",
"visualeditor-dialog-transclusion-add-param": "Add more information",

View file

@ -186,6 +186,7 @@
"visualeditor-dialog-table-sortable": "Label for toggle to make a table sortable",
"visualeditor-dialog-table-wikitable": "Label for toggle to make a table a wikitable",
"visualeditor-dialog-template-title": "{{Identical|Template}}",
"visualeditor-dialog-transclusion-action-save": "Label for button that saves changes when editing an existing transclusion in the transclusion dialog.",
"visualeditor-dialog-transclusion-absent-template": "Message to user that the template they have selected does not exist on this wiki.\n\nParameters:\n* $1 - the title of the template",
"visualeditor-dialog-transclusion-add-content": "Label for button that adds parameter content to a transclusion.",
"visualeditor-dialog-transclusion-add-param": "Label for button that adds a parameter to a transcluded template.",

View file

@ -412,7 +412,12 @@ ve.ui.MWTransclusionDialog.prototype.getActionProcess = function ( action ) {
*/
ve.ui.MWTransclusionDialog.prototype.updateActionSet = function () {
var veConfig = mw.config.get( 'wgVisualEditorConfig' ),
backButton = this.actions.get( { flags: [ 'back' ] } ).pop();
backButton = this.actions.get( { flags: [ 'back' ] } ).pop(),
saveButton = this.actions.get( { actions: [ 'done' ] } ).pop();
if ( saveButton && this.getMode() === 'edit' ) {
saveButton.setLabel( ve.msg( 'visualeditor-dialog-transclusion-action-save' ) );
}
if ( backButton ) {
// Todo: this won't be needed if https://gerrit.wikimedia.org/r/c/oojs/ui/+/686439 is resolved