Update template dialog help messages

* New help text for the case where TemplateData is present, whether
  or not it includes a description.
* Remove help text when TemplateData is missing.

Bug: T288465
Change-Id: I0668ccae8eeb5ffffc626e3b7d24c1d7ed99bbed
This commit is contained in:
Adam Wight 2021-08-30 14:17:04 +02:00
parent 1673f9f8bf
commit d8dcc89fa0
3 changed files with 18 additions and 8 deletions

View file

@ -211,6 +211,7 @@
"visualeditor-dialog-transclusion-required-parameter-dialog-ok": "Continue anyway",
"visualeditor-dialog-transclusion-required-parameter-dialog-title": "Required {{PLURAL:$1|field|fields}} missing",
"visualeditor-dialog-transclusion-required-parameter-is-blank": "Are you sure you want to continue without filling the $1 {{PLURAL:$2|field|fields}}?",
"visualeditor-dialog-transclusion-see-template": "Templates are user-generated and may lack complete descriptions. There might be additional information on this [[$1|template's page]].",
"visualeditor-dialog-transclusion-suggestedvalues-warning": "This is not one of the suggested values and may not work with the template.",
"visualeditor-dialog-transclusion-title-insert-template": "Insert a template",
"visualeditor-dialog-transclusion-title-insert-known-template": "Insert: $1",

View file

@ -229,6 +229,7 @@
"visualeditor-dialog-transclusion-required-parameter-dialog-ok": "Label for the OK button on the confirmation dialog opened if the user tries to insert/edit a template without filling all required fields.\n{{Identical|Continue anyway}}",
"visualeditor-dialog-transclusion-required-parameter-dialog-title": "Title for the confirmation dialog opened if the user tries to insert/edit a template without filling all required fields.\n\nParameters:\n* $1 - Number of parameters missing, for PLURAL support.",
"visualeditor-dialog-transclusion-required-parameter-is-blank": "Label for the confirmation dialog opened if the user tries to insert/edit a template without filling all required fields.\n\nParameters:\n* $1 - Parameters missing, as a list using {{msg-mw|and}}, {{msg-mw|comma-separator}} and {{msg-mw|word-separator}}.\n* $2 - Number of parameters missing, for PLURAL support.",
"visualeditor-dialog-transclusion-see-template": "Message to user that additional template information might be available for a template.\n\nParameters:\n* $1 - The title of the template.",
"visualeditor-dialog-transclusion-suggestedvalues-warning": "Message shown to an editor when they manually add a value that is not a suggested value for a parameter.",
"visualeditor-dialog-transclusion-title-insert-template": "Label for the transclusion dialog when selecting a transclusion to insert.",
"visualeditor-dialog-transclusion-title-insert-known-template": "Label for the transclusion dialog when editing a transclusion to insert.\n\nParameters:\n* $1 - Transclusion name.",

View file

@ -58,18 +58,26 @@ ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
$( '<hr>' ),
$( '<span>' )
.addClass( 've-ui-mwTemplatePage-description-extra' )
.append( mw.message(
'visualeditor-dialog-transclusion-more-template-description',
this.spec.getLabel(),
link
).parseDom() )
.append(
veConfig.transclusionDialogNewSidebar ?
mw.message( 'visualeditor-dialog-transclusion-more-template-description',
this.spec.getLabel(), link ).parseDom() :
mw.message( 'visualeditor-dialog-transclusion-see-template',
link ).parseDom()
)
);
} else {
} else if ( pageMissing ) {
this.$description
.addClass( 've-ui-mwTemplatePage-description-missing' )
.append( mw.message(
pageMissing ? 'visualeditor-dialog-transclusion-absent-template' :
'visualeditor-dialog-transclusion-no-template-description',
'visualeditor-dialog-transclusion-absent-template',
this.spec.getLabel()
).parseDom() );
} else if ( !veConfig.transclusionDialogNewSidebar || this.spec.isDocumented() ) {
this.$description
.addClass( 've-ui-mwTemplatePage-description-missing' )
.append( mw.message(
'visualeditor-dialog-transclusion-no-template-description',
this.spec.getLabel(), link
).parseDom() );
}