WMDE-Fisch has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406040 )
Change subject: [WIP] Update msg text and add i18n ...................................................................... [WIP] Update msg text and add i18n Bug: T183362 Change-Id: I3f9ee8496db0fdce04a3ca90cd1cd7bc6a162cd3 --- M extension.json M i18n/en.json M i18n/qqq.json M includes/GoatTwoColConflict/HtmlGoatConflictHeader.php M includes/GoatTwoColConflict/HtmlGoatConflictView.php M modules/GoatTwoColConflict/ext.TwoColConflict.Goat.init.js 6 files changed, 51 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwoColConflict refs/changes/40/406040/1 diff --git a/extension.json b/extension.json index b9bbc06..dfbc5af 100644 --- a/extension.json +++ b/extension.json @@ -205,6 +205,12 @@ "oojs-ui", "oojs-ui.styles.icons-editing-core", "oojs-ui.styles.icons-interactions" + ], + "messages": [ + "twoColConflict-goat-your-version", + "twoColConflict-goat-other-version", + "twoColConflict-goat-show-unselected", + "twoColConflict-goat-show-error-hint" ] }, "ext.TwoColConflict.GoatCss": { diff --git a/i18n/en.json b/i18n/en.json index bd7835f..c026119 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -57,5 +57,18 @@ "twoColConflict-test-preview-hint": "Thanks for trying out the Two Column Edit Conflict interface! Help us make improvements by providing us with your feedback [//meta.wikimedia.org/wiki/Talk:WMDE_Technical_Wishes/Edit_Conflicts/Feedback_Round_Test_Page here].\n\nBelow are the results of your test edit conflict resolution.", "twoColConflict-test-username": "ConflictTest User", "twoColConflict-test-summary-text": "Conflict test edit summary", - "twoColConflict-goat-saved-at": "saved $1, $2." + "twoColConflict-goat-edit-button": "Edit text", + "twoColConflict-goat-reset-button": "Reset text", + "twoColConflict-goat-save-button": "Save changes and leave editing mode", + "twoColConflict-goat-abort-button": "Abort editing and discard changes", + "twoColConflict-goat-collapse-button": "Collapse text", + "twoColConflict-goat-expand-button": "Expand text", + "twoColConflict-goat-choose-version": "Please choose a version", + "twoColConflict-goat-your-version": "Your version", + "twoColConflict-goat-other-version": "Other version", + "twoColConflict-goat-show-error-hint": "There are paragraphs you didn't choose a version for. Please select one for each paragraph.", + "twoColConflict-goat-show-unselected": "Show me unselected paragraphs -->", + "twoColConflict-goat-saved-at": "saved $1, $2.", + "twoColConflict-goat-other-header": "Conflicting version from", + "twoColConflict-goat-other-header2": "which is live now." } diff --git a/i18n/qqq.json b/i18n/qqq.json index 9039533..f64f1b6 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -62,5 +62,18 @@ "twoColConflict-test-preview-hint": "Last hint shown on the conflict test page above the preview of the resolved test conflict.", "twoColConflict-test-username": "Username for the conflict test page's fictitious conflicting edit.", "twoColConflict-test-summary-text": "Edit summary for the conflict test page's fictitious conflicting edit.", - "twoColConflict-goat-saved-at": "Header for the diff columns showing the time and date when the content was modified.\n\nParameters:\n* $1 - date\n* $2 - time" + "twoColConflict-goat-edit-button": "Label for the edit button shown on diff paragraphs.", + "twoColConflict-goat-reset-button": "Label for the reset button shown on diff paragraphs.", + "twoColConflict-goat-save-button": "Label for the save button shown on diff paragraphs to save changes in that paragraph.", + "twoColConflict-goat-abort-button": "Label for the abort button to discard changes in an edited diff paragraph.", + "twoColConflict-goat-collapse-button": "Label for the collapse button to collapse an unchanged text paragraph.", + "twoColConflict-goat-expand-button": "Label for the expand button to expand an unchanged text paragraph.", + "twoColConflict-goat-choose-version": "Label for the version selection on conflicting paragraphs.", + "twoColConflict-goat-your-version": "Label for the version selection on conflicting paragraphs, when your version was selected.", + "twoColConflict-goat-other-version": "Label for the version selection on conflicting paragraphs, when the other was selected.", + "twoColConflict-goat-show-error-hint": "Error message shown if the user did not select a version on conflicting paragraphs.", + "twoColConflict-goat-show-unselected": "Link message that can be clicked to jump to the first unselected conflicting paragraph.", + "twoColConflict-goat-saved-at": "Header for the diff columns showing the time and date when the content was modified.\n\nParameters:\n* $1 - date\n* $2 - time", + "twoColConflict-goat-other-header": "Header for the conflicting other version.", + "twoColConflict-goat-other-header2": "Header for the conflicting other version part2." } diff --git a/includes/GoatTwoColConflict/HtmlGoatConflictHeader.php b/includes/GoatTwoColConflict/HtmlGoatConflictHeader.php index 2d8c500..7de3e40 100644 --- a/includes/GoatTwoColConflict/HtmlGoatConflictHeader.php +++ b/includes/GoatTwoColConflict/HtmlGoatConflictHeader.php @@ -35,12 +35,13 @@ } private function buildYourVersionHeader() { - // TODO i18n return Html::openElement( 'div', [ 'class' => 'mw-twocolconflict-goat-your-header' ] ) . - Html::Element( 'span', [], 'Your version.' ) . + Html::Element( 'span', [], + new Message( 'twoColConflict-goat-your-version' ) + ) . Html::Element( 'br' ) . Html::openElement( 'span' ) . $this->getFormattedDateTime( new MWTimestamp() ) . @@ -49,14 +50,15 @@ } private function buildConflictingVersionHeader() { - // TODO i18n return Html::openElement( 'div', [ 'class' => 'mw-twocolconflict-goat-conflicting-header' ] ) . Html::rawElement( 'span', [], - 'Conflicting version from ' . $this->getLastUserLink() + new Message( 'twoColConflict-goat-other-header' ) . + ' ' . $this->getLastUserLink() . ' ' . + new Message( 'twoColConflict-goat-other-header2' ) ) . Html::Element( 'br' ) . Html::openElement( 'span' ) . diff --git a/includes/GoatTwoColConflict/HtmlGoatConflictView.php b/includes/GoatTwoColConflict/HtmlGoatConflictView.php index f510c14..038cd5c 100644 --- a/includes/GoatTwoColConflict/HtmlGoatConflictView.php +++ b/includes/GoatTwoColConflict/HtmlGoatConflictView.php @@ -75,12 +75,11 @@ } private function buildSideSelector( $rowNum ) { - // TODO: i18n return Html::openElement( 'div', [ 'class' => 'mw-twocolconflict-goat-selection' ] ) . Html::element( 'span', [ 'class' => 'mw-twocolconflict-goat-label' ], - 'Please choose a version' + new Message( 'twoColConflict-goat-choose-version' ) ) . Html::openElement( 'div', [ 'class' => 'mw-twocolconflict-goat-toggle' ] ) . new OOUI\RadioInputWidget( [ @@ -194,61 +193,55 @@ } private function buildEditButton() { - // TODO: i18n return new OOUI\ButtonWidget( [ 'framed' => false, 'icon' => 'edit', - 'title' => 'Edit this part', + 'title' => new Message( 'twoColConflict-goat-edit-button' ), 'classes' => [ 'mw-twocolconflict-goat-editbutton' ] ] ); } private function buildResetButton() { - // TODO: i18n return new OOUI\ButtonWidget( [ 'framed' => false, 'icon' => 'editUndo', - 'title' => 'Set back to initial text', + 'title' => new Message( 'twoColConflict-goat-reset-button' ), 'classes' => [ 'mw-twocolconflict-goat-resetbutton' ] ] ); } private function buildSaveButton() { - // TODO: i18n return new OOUI\ButtonWidget( [ 'framed' => false, 'icon' => 'check', - 'title' => 'Save your changes', + 'title' => new Message( 'twoColConflict-goat-save-button' ), 'classes' => [ 'mw-twocolconflict-goat-savebutton' ] ] ); } private function buildAbortButton() { - // TODO: i18n return new OOUI\ButtonWidget( [ 'framed' => false, 'icon' => 'close', - 'title' => 'Abort editing', + 'title' => new Message( 'twoColConflict-goat-abort-button' ), 'classes' => [ 'mw-twocolconflict-goat-abortbutton' ] ] ); } private function buildExpandButton() { - // TODO: i18n return new OOUI\ButtonWidget( [ 'framed' => false, 'icon' => 'expand', - 'title' => 'Expand text', + 'title' => new Message( 'twoColConflict-goat-expand-button' ), 'classes' => [ 'mw-twocolconflict-goat-expandbutton' ] ] ); } private function buildCollapseButton() { - // TODO: i18n return new OOUI\ButtonWidget( [ 'framed' => false, 'icon' => 'collapse', - 'title' => 'Collapse text', + 'title' => new Message( 'twoColConflict-goat-collapse-button' ), 'classes' => [ 'mw-twocolconflict-goat-collapsebutton' ] ] ); } diff --git a/modules/GoatTwoColConflict/ext.TwoColConflict.Goat.init.js b/modules/GoatTwoColConflict/ext.TwoColConflict.Goat.init.js index 817fce6..cfbf012 100644 --- a/modules/GoatTwoColConflict/ext.TwoColConflict.Goat.init.js +++ b/modules/GoatTwoColConflict/ext.TwoColConflict.Goat.init.js @@ -31,11 +31,11 @@ .addClass( 'mw-twocolconflict-goat-row-incomplete-error-text' ); $msg.append( - $( '<span></span>' ).text( 'There are paragraphs you didn\'t choose a version for. Please select one for each paragraph.' ) + $( '<span></span>' ).text( mw.msg( 'twoColConflict-goat-show-error-hint' ) ) ); $msg.append( - $( '<a></a>' ).text( 'Show me unselected paragraphs -->' ).on( 'click', function () { + $( '<a></a>' ).text( mw.msg( 'twoColConflict-goat-show-unselected' ) ).on( 'click', function () { document.getElementsByClassName( 'mw-twocolconflict-goat-row-incomplete' )[ 0 ].scrollIntoView(); } ) ); @@ -213,13 +213,11 @@ saveAndStopCurrentEditing(); if ( $switch.val() === 'your' ) { - // TODO: i18n - $label.text( 'Your version' ); + $label.text( mw.msg( 'twoColConflict-goat-your-version' ) ); $selectedColumn = $row.find( '.mw-twocolconflict-goat-delete' ); $unselectedColumn = $row.find( '.mw-twocolconflict-goat-add' ); } else { - // TODO: i18n - $label.text( 'Other version' ); + $label.text( mw.msg( 'twoColConflict-goat-other-version' ) ); $selectedColumn = $row.find( '.mw-twocolconflict-goat-add' ); $unselectedColumn = $row.find( '.mw-twocolconflict-goat-delete' ); } -- To view, visit https://gerrit.wikimedia.org/r/406040 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f9ee8496db0fdce04a3ca90cd1cd7bc6a162cd3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TwoColConflict Gerrit-Branch: master Gerrit-Owner: WMDE-Fisch <christoph.jau...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits