diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php index 5557fe24a0..3a1c5b2f72 100644 --- a/VisualEditor.i18n.php +++ b/VisualEditor.i18n.php @@ -12,11 +12,34 @@ $messages['en'] = array( 'visualeditor-tooltip-wikitext' => 'Toggle wikitext view', 'visualeditor-tooltip-json' => 'Toggle JSON view', 'visualeditor-tooltip-html' => 'Toggle HTML view', - 'visualeditor-tooltip-render' => 'Toggle preview', + 'visualeditor-tooltip-render' => 'Toggle preview', 'visualeditor-tooltip-history' => 'Toggle transaction history view', 'visualeditor-tooltip-help' => 'Toggle help view', 'visualeditor-feedback-prompt' => 'Leave feedback', 'visualeditor-feedback-dialog-title' => 'Leave feedback about VisualEditor Sandbox', + 'visualeditor-ca-editsource' => 'Edit source', + 'visualeditor-linkinspector-title' => 'Edit link', + 'visualeditor-linkinspector-label-pagetitle' => 'Page title', + 'visualeditor-formatdropdown-title' => 'Change format', + 'visualeditor-formatdropdown-format-paragraph' => 'Paragraph', + 'visualeditor-formatdropdown-format-heading1' => 'Heading 1', + 'visualeditor-formatdropdown-format-heading2' => 'Heading 2', + 'visualeditor-formatdropdown-format-heading3' => 'Heading 3', + 'visualeditor-formatdropdown-format-heading4' => 'Heading 4', + 'visualeditor-formatdropdown-format-heading5' => 'Heading 5', + 'visualeditor-formatdropdown-format-heading6' => 'Heading 6', + 'visualeditor-formatdropdown-format-preformatted' => 'Preformatted', + 'visualeditor-annotationbutton-bold-tooltip' => 'Bold', + 'visualeditor-annotationbutton-italic-tooltip' => 'Italic', + 'visualeditor-annotationbutton-link-tooltip' => 'Link', + 'visualeditor-indentationbutton-indent-tooltip' => 'Increase indentation', + 'visualeditor-indentationbutton-outdent-tooltip' => 'Decrease indentation', + 'visualeditor-listbutton-number-tooltip' => 'Numbered list', + 'visualeditor-listbutton-bullet-tooltip' => 'Bullet list', + 'visualeditor-clearbutton-tooltip' => 'Clear formatting', + 'visualeditor-historybutton-undo-tooltip' => 'Undo', + 'visualeditor-historybutton-redo-tooltip' => 'Redo', + 'visualeditor-viewpage-savewarning' => 'Are you sure you want to go back to view mode without saving first?', ); /** Message documentation (Message documentation) @@ -31,6 +54,29 @@ $messages['qqq'] = array( 'visualeditor-tooltip-render' => 'Tooltip for a toolbar button which activates or deactivates a split view, with the visual editor on the left-hand side, and a dynamically updating preview on the right-hand side. This view is primarily useful for debugging purposes.', 'visualeditor-tooltip-history' => "Tooltip for a toolbar button which activates or deactivates a split view, with the visual editor on the left-hand side, and a history of the user's edit transactions on the right-hand side. This view is primarily useful for debugging purposes.", 'visualeditor-feedback-prompt' => 'A link that opens feedback form in http://www.mediawiki.org/wiki/Special:VisualEditorSandbox', + 'visualeditor-ca-editsource' => 'Text for the edit source link in the tab dropdown', + 'visualeditor-linkinspector-title' => 'Title of the link inspector dialog', + 'visualeditor-linkinspector-label-pagetitle' => 'Label for the text field that holds the link target in the link inspector', + 'visualeditor-formatdropdown-tooltip' => 'Tooltip for the formatting dropdown', + 'visualeditor-formatdropdown-format-paragraph' => 'Item in the formatting dropdown for paragraphs (normal text)', + 'visualeditor-formatdropdown-format-heading1' => 'Item in the formatting dropdown for a level 1 heading', + 'visualeditor-formatdropdown-format-heading2' => 'Item in the formatting dropdown for a level 2 heading', + 'visualeditor-formatdropdown-format-heading3' => 'Item in the formatting dropdown for a level 3 heading', + 'visualeditor-formatdropdown-format-heading4' => 'Item in the formatting dropdown for a level 4 heading', + 'visualeditor-formatdropdown-format-heading5' => 'Item in the formatting dropdown for a level 5 heading', + 'visualeditor-formatdropdown-format-heading6' => 'Item in the formatting dropdown for a level 6 heading', + 'visualeditor-formatdropdown-format-preformatted' => 'Item in the formatting dropdown for preformatted text', + 'visualeditor-annotationbutton-bold-tooltip' => 'Tooltip for the bold button', + 'visualeditor-annotationbutton-italic-tooltip' => 'Tooltip for the italic button', + 'visualeditor-annotationbutton-link-tooltip' => 'Tooltip for the link button', + 'visualeditor-indentationbutton-indent-tooltip' => 'Tooltip for the list indent button', + 'visualeditor-indentationbutton-outdent-tooltip' => 'Tooltip for the list outdent button', + 'visualeditor-listbutton-number-tooltip' => 'Tooltip for the numbered list button', + 'visualeditor-listbutton-bullet-tooltip' => 'Tooltip for the bullet list button', + 'visualeditor-clearbutton-tooltip' => 'Tooltip for the clear formatting button', + 'visualeditor-historybutton-undo-tooltip' => 'Tooltip for the undo button', + 'visualeditor-historybutton-redo-tooltip' => 'Tooltip for the redo button', + 'visualeditor-viewpage-savewarning' => 'Text shown when the user tries to leave the editor without saving their changes', ); /** Asturian (asturianu) diff --git a/VisualEditor.php b/VisualEditor.php index 4f49380abd..d321f230ca 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -111,7 +111,8 @@ $wgResourceModules += array( 'create', 'accesskey-ca-edit', 'tooltip-ca-edit', - 'viewsource' + 'viewsource', + 'visualeditor-ca-editsource' ), ), 'ext.visualEditor.init' => $wgVisualEditorResourceTemplate + array( @@ -256,6 +257,28 @@ $wgResourceModules += array( 'visualeditor-tooltip-history', 'visualeditor-tooltip-help', 'visualeditor', + 'visualeditor-linkinspector-tooltip', + 'visualeditor-linkinspector-label-pagetitle', + 'visualeditor-formatdropdown-tooltip', + 'visualeditor-formatdropdown-format-paragraph', + 'visualeditor-formatdropdown-format-heading1', + 'visualeditor-formatdropdown-format-heading2', + 'visualeditor-formatdropdown-format-heading3', + 'visualeditor-formatdropdown-format-heading4', + 'visualeditor-formatdropdown-format-heading5', + 'visualeditor-formatdropdown-format-heading6', + 'visualeditor-formatdropdown-format-preformatted', + 'visualeditor-annotationbutton-bold-tooltip', + 'visualeditor-annotationbutton-italic-tooltip', + 'visualeditor-annotationbutton-link-tooltip', + 'visualeditor-indentationbutton-indent-tooltip', + 'visualeditor-indentationbutton-outdent-tooltip', + 'visualeditor-listbutton-number-tooltip', + 'visualeditor-listbutton-bullet-tooltip', + 'visualeditor-clearbutton-tooltip', + 'visualeditor-historybutton-undo-tooltip', + 'visualeditor-historybutton-redo-tooltip', + 'visualeditor-viewpage-savewarning', ), ) ); diff --git a/modules/ve2/init/targets/ve.init.ViewPageTarget.js b/modules/ve2/init/targets/ve.init.ViewPageTarget.js index 3ad9e4bfbe..62d69357e8 100644 --- a/modules/ve2/init/targets/ve.init.ViewPageTarget.js +++ b/modules/ve2/init/targets/ve.init.ViewPageTarget.js @@ -77,12 +77,12 @@ ve.init.ViewPageTarget.saveDialogTemplate = '\ \ \ + for="ve-init-viewPageTarget-saveDialog-minorEdit">\
\ \ \ + for="ve-init-viewPageTarget-saveDialog-watchList">\ \
\ \ @@ -125,7 +125,7 @@ ve.init.ViewPageTarget.prototype.deactivate = function( override ) { if ( override || !this.surface.getModel().getHistory().length || - confirm( 'Are you sure you want to go back to view mode without saving first?' ) + confirm( mw.msg( 'visualeditor-viewpage-savewarning' ) ) ) { this.deactivating = true; // User interface changes @@ -373,7 +373,7 @@ ve.init.ViewPageTarget.prototype.setupSkinTabs = function() { mw.util.addPortletLink( 'p-cactions', this.editUri, - 'Edit Source', // TODO: i18n + mw.msg( 'visualeditor-ca-editsource' ), 'ca-editsource' ); } diff --git a/modules/ve2/ui/inspectors/ve.ui.LinkInspector.js b/modules/ve2/ui/inspectors/ve.ui.LinkInspector.js index 9b33cdaf48..9bd617fa51 100644 --- a/modules/ve2/ui/inspectors/ve.ui.LinkInspector.js +++ b/modules/ve2/ui/inspectors/ve.ui.LinkInspector.js @@ -11,8 +11,13 @@ ve.ui.LinkInspector = function( toolbar, context ) { // Properties this.$clearButton = $( '
' ) .prependTo( this.$ ); - this.$.prepend( '
Edit link
' ); - this.$locationLabel = $( '' ).appendTo( this.$form ); + this.$.prepend( + $( '
' ) + .text( mw.msg( 'visualeditor-linkinspector-title' ) ) + ); + this.$locationLabel = $( '' ) + .text( mw.msg( 'visualeditor-linkinspector-label-pagetitle' ) ) + .appendTo( this.$form ); this.$locationInput = $( '' ).appendTo( this.$form ); this.initialValue = null; diff --git a/modules/ve2/ui/tools/ve.ui.AnnotationButtonTool.js b/modules/ve2/ui/tools/ve.ui.AnnotationButtonTool.js index c45d481c69..cf1ac29bae 100644 --- a/modules/ve2/ui/tools/ve.ui.AnnotationButtonTool.js +++ b/modules/ve2/ui/tools/ve.ui.AnnotationButtonTool.js @@ -63,7 +63,7 @@ ve.ui.AnnotationButtonTool.prototype.updateState = function( annotations, nodes ve.ui.Tool.tools.bold = { 'constructor': ve.ui.AnnotationButtonTool, 'name': 'bold', - 'title': 'Bold (ctrl/cmd + B)', + 'title': mw.msg( 'visualeditor-annotationbutton-bold-tooltip' ), 'data': { 'annotation': { 'type': 'textStyle/bold' } } @@ -72,7 +72,7 @@ ve.ui.Tool.tools.bold = { ve.ui.Tool.tools.italic = { 'constructor': ve.ui.AnnotationButtonTool, 'name': 'italic', - 'title': 'Italic (ctrl/cmd + I)', + 'title': mw.msg( 'visualeditor-annotationbutton-italic-tooltip' ), 'data': { 'annotation': { 'type': 'textStyle/italic' } } @@ -81,7 +81,7 @@ ve.ui.Tool.tools.italic = { ve.ui.Tool.tools.link = { 'constructor': ve.ui.AnnotationButtonTool, 'name': 'link', - 'title': 'Link (ctrl/cmd + K)', + 'title': mw.msg( 'visualeditor-annotationbutton-link-tooltip' ), 'data': { 'annotation': { 'type': 'link/wikiLink', 'data': { 'title': '' } }, 'inspector': 'link' diff --git a/modules/ve2/ui/tools/ve.ui.ClearButtonTool.js b/modules/ve2/ui/tools/ve.ui.ClearButtonTool.js index 3abc02e284..14b6201803 100644 --- a/modules/ve2/ui/tools/ve.ui.ClearButtonTool.js +++ b/modules/ve2/ui/tools/ve.ui.ClearButtonTool.js @@ -50,7 +50,7 @@ ve.ui.ClearButtonTool.prototype.updateState = function( annotations ) { ve.ui.Tool.tools.clear = { 'constructor': ve.ui.ClearButtonTool, 'name': 'clear', - 'title': 'Clear formatting' + 'title': mw.msg( 'visualeditor-clearbutton-tooltip' ) }; /* Inheritance */ diff --git a/modules/ve2/ui/tools/ve.ui.FormatDropdownTool.js b/modules/ve2/ui/tools/ve.ui.FormatDropdownTool.js index dec727f11a..de52dd9195 100644 --- a/modules/ve2/ui/tools/ve.ui.FormatDropdownTool.js +++ b/modules/ve2/ui/tools/ve.ui.FormatDropdownTool.js @@ -13,48 +13,48 @@ ve.FormatDropdownTool = function( toolbar, name, title ) { ve.ui.DropdownTool.call( this, toolbar, name, title, [ { 'name': 'paragraph', - 'label': 'Paragraph', + 'label': mw.msg( 'visualeditor-formatdropdown-format-paragraph' ), 'type' : 'paragraph' }, { 'name': 'heading-1', - 'label': 'Heading 1', + 'label': mw.msg( 'visualeditor-formatdropdown-format-heading1' ), 'type' : 'heading', 'attributes': { 'level': 1 } }, { 'name': 'heading-2', - 'label': 'Heading 2', + 'label': mw.msg( 'visualeditor-formatdropdown-format-heading2' ), 'type' : 'heading', 'attributes': { 'level': 2 } }, { 'name': 'heading-3', - 'label': 'Heading 3', + 'label': mw.msg( 'visualeditor-formatdropdown-format-heading3' ), 'type' : 'heading', 'attributes': { 'level': 3 } }, { 'name': 'heading-4', - 'label': 'Heading 4', + 'label': mw.msg( 'visualeditor-formatdropdown-format-heading4' ), 'type' : 'heading', 'attributes': { 'level': 4 } }, { 'name': 'heading-5', - 'label': 'Heading 5', + 'label': mw.msg( 'visualeditor-formatdropdown-format-heading5' ), 'type' : 'heading', 'attributes': { 'level': 5 } }, { 'name': 'heading-6', - 'label': 'Heading 6', + 'label': mw.msg( 'visualeditor-formatdropdown-format-heading6' ), 'type' : 'heading', 'attributes': { 'level': 6 } }, { 'name': 'preformatted', - 'label': 'Preformatted', + 'label': mw.msg( 'visualeditor-formatdropdown-format-preformatted' ), 'type' : 'preformatted' } ] ); @@ -115,7 +115,7 @@ ve.FormatDropdownTool.prototype.updateState = function( annotations, nodes ) { ve.ui.Tool.tools.format = { 'constructor': ve.FormatDropdownTool, 'name': 'format', - 'title': 'Change format' + 'title': mw.msg( 'visualeditor-formatdropdown-tooltip' ) }; /* Inheritance */ diff --git a/modules/ve2/ui/tools/ve.ui.HistoryButtonTool.js b/modules/ve2/ui/tools/ve.ui.HistoryButtonTool.js index b4857ac1e8..d0e0444256 100644 --- a/modules/ve2/ui/tools/ve.ui.HistoryButtonTool.js +++ b/modules/ve2/ui/tools/ve.ui.HistoryButtonTool.js @@ -60,13 +60,13 @@ ve.ui.HistoryButtonTool.prototype.updateState = function( annotations ) { ve.ui.Tool.tools.undo = { 'constructor': ve.ui.HistoryButtonTool, 'name': 'undo', - 'title': 'Undo (ctrl/cmd + Z)' + 'title': mw.msg( 'visualeditor-historybutton-undo-tooltip' ) }; ve.ui.Tool.tools.redo = { 'constructor': ve.ui.HistoryButtonTool, 'name': 'redo', - 'title': 'Redo (ctrl/cmd + shift + Z)' + 'title': mw.msg( 'visualeditor-historybutton-redo-tooltip' ) }; /* Inhertiance */ diff --git a/modules/ve2/ui/tools/ve.ui.IndentationButtonTool.js b/modules/ve2/ui/tools/ve.ui.IndentationButtonTool.js index f13136b2b5..5cba84e082 100644 --- a/modules/ve2/ui/tools/ve.ui.IndentationButtonTool.js +++ b/modules/ve2/ui/tools/ve.ui.IndentationButtonTool.js @@ -101,13 +101,13 @@ ve.ui.IndentationButtonTool.prototype.updateState = function( annotations, nodes ve.ui.Tool.tools.indent = { 'constructor': ve.ui.IndentationButtonTool, 'name': 'indent', - 'title': 'Increase indentation' + 'title': mw.msg( 'visualeditor-indentationbutton-indent-tooltip' ), }; ve.ui.Tool.tools.outdent = { 'constructor': ve.ui.IndentationButtonTool, 'name': 'outdent', - 'title': 'Reduce indentation' + 'title': mw.msg( 'visualeditor-indentationbutton-outdent-tooltip' ), }; /* Inheritance */ diff --git a/modules/ve2/ui/tools/ve.ui.ListButtonTool.js b/modules/ve2/ui/tools/ve.ui.ListButtonTool.js index 82e6f97bb8..222d9785b5 100644 --- a/modules/ve2/ui/tools/ve.ui.ListButtonTool.js +++ b/modules/ve2/ui/tools/ve.ui.ListButtonTool.js @@ -129,13 +129,13 @@ ve.ui.ListButtonTool.prototype.updateState = function( annotations, nodes ) { ve.ui.Tool.tools.number = { 'constructor': ve.ui.ListButtonTool, 'name': 'number', - 'title': 'Numbered list' + 'title': mw.msg( 'visualeditor-listbutton-number-tooltip' ), }; ve.ui.Tool.tools.bullet = { 'constructor': ve.ui.ListButtonTool, 'name': 'bullet', - 'title': 'Bulleted list' + 'title': mw.msg( 'visualeditor-listbutton-bullet-tooltip' ), }; /* Inheritance */ diff --git a/modules/ve2/ui/ve.ui.Menu.js b/modules/ve2/ui/ve.ui.Menu.js index 3d4963c8da..5360563c5b 100644 --- a/modules/ve2/ui/ve.ui.Menu.js +++ b/modules/ve2/ui/ve.ui.Menu.js @@ -63,7 +63,7 @@ ve.ui.Menu.prototype.addItem = function( item, before ) { if ( item.label ) { item.$ = $( '
' ) .attr( 'rel', item.name ) - // TODO: i18n time! + // TODO: this should take a labelmsg instead and call mw.msg() .append( $( '' ).text( item.label ) ); } else { // No label, must be a break