Vary the 'save' labels to 'publish' for public wikis

Bug: T131132
Change-Id: I4a497265661d5ce0f6144988b514509dfa1bddfd
Depends-On: I56634ed223778a0650cf36ac7256151b13c494f1
This commit is contained in:
James D. Forrester 2016-06-30 15:04:51 +01:00
parent b7c7d06968
commit deef47414a
7 changed files with 20 additions and 3 deletions

View file

@ -54,6 +54,11 @@ class VisualEditorHooks {
$toolbarScrollOffset = $skinsToolbarScrollOffset[$skinName];
}
$output->addJsConfigVars( 'wgVisualEditorToolbarScrollOffset', $toolbarScrollOffset );
$output->addJsConfigVars(
'wgEditButtonPublishNotSave',
$veConfig->get( 'EditButtonPublishNotSave' )
);
return true;
}

View file

@ -1190,6 +1190,8 @@
"colon-separator",
"hidetoc",
"ooui-dialog-process-continue",
"publishchanges",
"publishpage",
"savearticle",
"savechanges",
"showtoc",

View file

@ -320,6 +320,7 @@
"visualeditor-savedialog-identify-user": "You are now logged in as [[User:$1|$1]]. Your edit will be associated with this account if you save this edit.",
"visualeditor-savedialog-label-create": "Create page",
"visualeditor-savedialog-label-error": "Error",
"visualeditor-savedialog-label-publish-short": "Publish",
"visualeditor-savedialog-label-report": "Report problem",
"visualeditor-savedialog-label-resolve-conflict": "Resolve conflict",
"visualeditor-savedialog-label-resume-editing": "Resume editing",

View file

@ -331,12 +331,13 @@
"visualeditor-savedialog-identify-user": "Displayed in the save dialog if saving failed because the session expired and the session is now for a different user account.\n{{format|jquerymsg}}\nParameters:\n* $1 - username",
"visualeditor-savedialog-label-create": "Label text for save button when the user is creating a new page\n{{Identical|Create page}}",
"visualeditor-savedialog-label-error": "Label in front of a save dialog error sentence, separated by {{msg-mw|colon-separator}}.\n{{Identical|Error}}",
"visualeditor-savedialog-label-publish-short": "Short label text for save button on public wikis for use on width-restricted devices like mobile phones. This should be as short as possible.\n{{Identical|Publish}}",
"visualeditor-savedialog-label-report": "Label for button to trigger report",
"visualeditor-savedialog-label-resolve-conflict": "Label for button to start resoliving an edit conflict",
"visualeditor-savedialog-label-resume-editing": "Label for button to exit the save dialog without saving, and return to editing.",
"visualeditor-savedialog-label-review": "Label for button to go to the review dialog to review the diff",
"visualeditor-savedialog-label-review-good": "Label for button to go back to a page in order to save form",
"visualeditor-savedialog-label-save-short": "Short label text for save button when the user is editing a current revision of an extant page on width-restricted devices.\n{{Identical|Save}}",
"visualeditor-savedialog-label-save-short": "Short label text for save button on private wikis for use on width-restricted devices like mobile phones. This should be as short as possible.\n{{Identical|Save}}",
"visualeditor-savedialog-label-warning": "Label in front of a save dialog warning sentence, separated by {{msg-mw|colon-separator}}.\n{{Identical|Warning}}",
"visualeditor-savedialog-title-conflict": "Title for save dialog slide if there is an edit conflict\n{{Identical|Conflict}}",
"visualeditor-savedialog-title-nochanges": "Title for save dialog slide for the wikitext diff if there are no changes",

View file

@ -120,6 +120,10 @@ ve.init.mw.MobileArticleTarget.prototype.createSurface = function ( dmDoc, confi
* @inheritdoc
*/
ve.init.mw.MobileArticleTarget.prototype.getSaveButtonLabel = function () {
if ( mw.config.get( 'wgEditButtonPublishNotSave' ) ) {
return OO.ui.deferMsg( 'visualeditor-savedialog-label-publish-short' );
}
return OO.ui.deferMsg( 'visualeditor-savedialog-label-save-short' );
};

View file

@ -1500,11 +1500,15 @@ ve.init.mw.ArticleTarget.prototype.setupToolbar = function () {
};
/**
* Getting the message for the toolbar / save dialog save button
* Getting the message for the toolbar / save dialog save / publish button
*
* @return {Function|string} An i18n message or resolveable function
*/
ve.init.mw.ArticleTarget.prototype.getSaveButtonLabel = function () {
if ( mw.config.get( 'wgEditButtonPublishNotSave' ) ) {
return OO.ui.deferMsg( !this.pageExists ? 'publishpage' : 'publishchanges' );
}
return OO.ui.deferMsg( !this.pageExists ? 'savearticle' : 'savechanges' );
};

View file

@ -44,7 +44,7 @@ ve.ui.windowFactory.register( ve.ui.MWCommandHelpDialog );
if ( saveShortcut !== '-' && saveShortcut !== '' ) {
ve.ui.commandHelpRegistry.register( 'other', 'save', {
shortcuts: [ accessKeyPrefix + saveShortcut.toUpperCase() ],
label: OO.ui.deferMsg( 'savechanges' ),
label: function () { return ve.init.target.getSaveButtonLabel(); },
demote: true
} );
}