Text improvements for unkown parameter input

- Change description text according to ticket
- Make sure link to template page opens in new tab
- Add missing placeholder text

Bug: T272487
Change-Id: Ie8189e9cb9db5908e8fc5fc8bf7ff20df5595094
This commit is contained in:
WMDE-Fisch 2021-08-31 12:18:19 +02:00
parent ebb94a47ea
commit 14d3e8144c
4 changed files with 15 additions and 6 deletions

View file

@ -2203,6 +2203,7 @@
"visualeditor-dialog-transclusion-add-wikitext",
"visualeditor-dialog-transclusion-add-param",
"visualeditor-dialog-transclusion-add-param-help",
"visualeditor-dialog-transclusion-add-param-placeholder",
"visualeditor-dialog-transclusion-add-param-save",
"visualeditor-dialog-transclusion-add-template",
"visualeditor-dialog-transclusion-add-undocumented-param",

View file

@ -174,7 +174,8 @@
"visualeditor-dialog-transclusion-add-content": "Add content",
"visualeditor-dialog-transclusion-add-wikitext": "Add wikitext",
"visualeditor-dialog-transclusion-add-param": "Add more information",
"visualeditor-dialog-transclusion-add-param-help": "If known, enter undocumented parameter names. If the parameter is not already part of the template, adding it will have no effect. You may find information about existing parameters on the [[$1|template's page]].",
"visualeditor-dialog-transclusion-add-param-help": "If known, enter undocumented parameter names. Note that only parameters known by the template will have an effect. You may find information about existing parameters on the [[$1|template's page]].",
"visualeditor-dialog-transclusion-add-param-placeholder": "Parameter name",
"visualeditor-dialog-transclusion-add-param-save": "Add parameter",
"visualeditor-dialog-transclusion-add-template": "Add template",
"visualeditor-dialog-transclusion-add-undocumented-param": "Add undocumented parameter",

View file

@ -193,6 +193,7 @@
"visualeditor-dialog-transclusion-add-wikitext": "Label for button that adds parameter wikitext to a transclusion.",
"visualeditor-dialog-transclusion-add-param": "Label for button that adds a parameter to a transcluded template.",
"visualeditor-dialog-transclusion-add-param-help": "Help text for new undocumented parameter input field.\n\nParameters:\n* $1 - The title of the template.",
"visualeditor-dialog-transclusion-add-param-placeholder": "Placeholder in the input field that adds a new undocumented parameter to a transcluded template.",
"visualeditor-dialog-transclusion-add-param-save": "Label for save button that adds a new undocumented parameter to a transcluded template.",
"visualeditor-dialog-transclusion-add-template": "Label for button that adds the specified template to the page.\n{{Identical|Add template}}",
"visualeditor-dialog-transclusion-add-undocumented-param": "Label for button that adds a new undocumented parameter to a transcluded template.",

View file

@ -32,7 +32,10 @@ ve.ui.MWAddParameterPage = function VeUiMWAddParameterPage( parameter, name, con
.connect( this, { click: 'togglePlaceholder' } );
// Input field and button
this.paramInputField = new OO.ui.TextInputWidget().connect( this, { enter: 'onParameterInput' } );
this.paramInputField = new OO.ui.TextInputWidget( {
placeholder: ve.msg( 'visualeditor-dialog-transclusion-add-param-placeholder' )
} )
.connect( this, { enter: 'onParameterInput' } );
var saveButton = new OO.ui.ButtonWidget( {
label: ve.msg( 'visualeditor-dialog-transclusion-add-param-save' ),
flags: [ 'primary', 'progressive' ]
@ -45,17 +48,20 @@ ve.ui.MWAddParameterPage = function VeUiMWAddParameterPage( parameter, name, con
{ classes: [ 've-ui-mwTransclusionDialog-addParameterFieldset-input' ] }
);
var $helpText = mw.message(
'visualeditor-dialog-transclusion-add-param-help',
this.template.getTitle() || this.template.getTarget().wt
).parseDom();
this.addParameterFieldset = new OO.ui.FieldsetLayout( {
label: this.addParameterInputHeader.$element,
helpInline: true,
help: mw.message(
'visualeditor-dialog-transclusion-add-param-help',
this.template.getTitle() || this.template.getTarget().wt
).parseDom(),
help: $helpText,
classes: [ 've-ui-mwTransclusionDialog-addParameterFieldset' ],
$content: this.addParameterInputField.$element
} );
ve.targetLinksToNewWindow( this.addParameterFieldset.$element[ 0 ] );
// Init visibility
this.togglePlaceholder( false );