jenkins-bot has submitted this change and it was merged. Change subject: Use plural grammar in table context for deleting multiple rows/columns ......................................................................
Use plural grammar in table context for deleting multiple rows/columns Bug: T87234 Change-Id: If6b4a9c055752a86db474d42cf43429640ba44c5 --- M i18n/en.json M i18n/qqq.json M src/ui/contextitems/ve.ui.TableContextItem.js 3 files changed, 16 insertions(+), 8 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index 7721d80..2b469be 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -113,8 +113,8 @@ "visualeditor-specialcharacterinspector-title": "Special character", "visualeditor-specialcharinspector-characterlist-insert": "{\n\t\"Symbols\": {\n\t\t\"−\": \"−\",\n\t\t\"—\": \"—\",\n\t\t\"°\": \"°\",\n\t\t\"′\": \"′\",\n\t\t\"″\": \"″\",\n\t\t\"←\": \"←\",\n\t\t\"→\": \"→\",\n\t\t\"« »\" : \"« »\",\n\t\t\"“”\" : \"“”\",\n\t\t\"#\" : \"#\",\n\t\t\"@\" : \"@\",\n\t\t\"|\" : \"|\",\n\t\t\"~\" : \"~\",\n\t\t\"§\": \"§\",\n\t\t\"•\" : \"•\",\n\t\t\"·\": \"·\",\n\t\t\"…\" : \"…\",\n\t\t\"€\" : \"€\"\n\t},\n\t\"Accents\": {\n\t\t\"Æ\" : \"Æ\",\n\t\t\"æ\" : \"æ\",\n\t\t\"À\" : \"À\",\n\t\t\"à\" : \"à\",\n\t\t\"Â\" : \"Â\",\n\t\t\"â\" : \"â\",\n\t\t\"Ä\" : \"Ä\",\n\t\t\"ä\" : \"ä\",\n\t\t\"Å\" : \"Å\",\n\t\t\"å\" : \"å\",\n\t\t\"Ç\" : \"Ç\",\n\t\t\"ç\" : \"ç\",\n\t\t\"È\" : \"È\",\n\t\t\"è\" : \"è\",\n\t\t\"É\" : \"É\",\n\t\t\"é\" : \"é\",\n\t\t\"Ê\" : \"Ê\",\n\t\t\"ê\" : \"ê\",\n\t\t\"Ë\" : \"Ë\",\n\t\t\"ë\" : \"ë\",\n\t\t\"Î\" : \"Î\",\n\t\t\"î\" : \"î\",\n\t\t\"Ï\" : \"Ï\",\n\t\t\"ï\" : \"ï\",\n\t\t\"Ô\" : \"Ô\",\n\t\t\"ô\" : \"ô\",\n\t\t\"Ö\" : \"Ö\",\n\t\t\"ö\" : \"ö\",\n\t\t\"Ø\" : \"Ø\",\n\t\t\"ø\" : \"ø\",\n\t\t\"Ù\" : \"Ù\",\n\t\t\"ù\" : \"ù\",\n\t\t\"Û\" : \"Û\",\n\t\t\"û\" : \"û\",\n\t\t\"Ü\" : \"Ü\",\n\t\t\"ü\" : \"ü\",\n\t\t\"Ÿ\" : \"Ÿ\",\n\t\t\"ÿ\" : \"ÿ\",\n\t\t\"Œ\" : \"Œ\",\n\t\t\"œ\" : \"œ\"\n\t},\n\t\"Mathematical\": {\n\t\t\"−\": \"−\",\n\t\t\"×\": \"×\",\n\t\t\"÷\": \"÷\",\n\t\t\"≈\": \"≈\",\n\t\t\"≠\": \"≠\",\n\t\t\"≤\": \"≤\",\n\t\t\"≥\": \"≥\",\n\t\t\"±\": \"±\",\n\t\t\"¹\" : \"¹\",\n\t\t\"²\" : \"²\",\n\t\t\"³\" : \"³\",\n\t\t\"⁴\" : \"⁴\",\n\t\t\"⁵\" : \"⁵\",\n\t\t\"⁶\" : \"⁶\",\n\t\t\"⁷\" : \"⁷\",\n\t\t\"⁸\" : \"⁸\",\n\t\t\"⁹\" : \"⁹\",\n\t\t\"⁰\" : \"⁰\",\n\t\t\"½\" : \"½\"\n\t}\n}", "visualeditor-table-caption": "Caption", - "visualeditor-table-delete-col": "Delete column", - "visualeditor-table-delete-row": "Delete row", + "visualeditor-table-delete-col": "Delete {{PLURAL:$1|column|columns}}", + "visualeditor-table-delete-row": "Delete {{PLURAL:$1|row|rows}}", "visualeditor-table-delete-table": "Delete table", "visualeditor-table-format-data": "Content cell", "visualeditor-table-format-header": "Header cell", diff --git a/i18n/qqq.json b/i18n/qqq.json index 6e56913..33d4bed 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -120,8 +120,8 @@ "visualeditor-specialcharacterinspector-title": "Used as title for special character inspector.\n{{Identical|Special character}}", "visualeditor-specialcharinspector-characterlist-insert": "This is a JSON string defining the special characters that can be inserted using the special character insertion tool.\n{{doc-important|Please make sure it is a valid JSON string.}}\n{{Optional}}", "visualeditor-table-caption": "Label for table caption tool\n{{Identical|Caption}}", - "visualeditor-table-delete-col": "Label for delete column tool", - "visualeditor-table-delete-row": "Label for delete row tool", + "visualeditor-table-delete-col": "Label for delete column tool\n\n* $1 is the number of columns", + "visualeditor-table-delete-row": "Label for delete row tool\n\n* $1 is the number of rows", "visualeditor-table-delete-table": "Label for delete table tool", "visualeditor-table-format-data": "Label for table cell data tool", "visualeditor-table-format-header": "Label for table cell header tool", diff --git a/src/ui/contextitems/ve.ui.TableContextItem.js b/src/ui/contextitems/ve.ui.TableContextItem.js index 0d9f2b9..039e83a 100644 --- a/src/ui/contextitems/ve.ui.TableContextItem.js +++ b/src/ui/contextitems/ve.ui.TableContextItem.js @@ -100,9 +100,13 @@ ve.ui.DeleteColumnContextItem.static.name = 'deleteColumn'; ve.ui.DeleteColumnContextItem.static.group = 'table-col'; ve.ui.DeleteColumnContextItem.static.icon = 'remove'; -ve.ui.DeleteColumnContextItem.static.title = - OO.ui.deferMsg( 'visualeditor-table-delete-col' ); ve.ui.DeleteColumnContextItem.static.commandName = 'deleteColumn'; +ve.ui.DeleteColumnContextItem.prototype.getTitle = function () { + var selection = this.context.getSurface().getModel().getSelection(), + colCount = selection instanceof ve.dm.TableSelection ? selection.getColCount() : 0; + + return ve.msg( 'visualeditor-table-delete-col', colCount ); +}; ve.ui.contextItemFactory.register( ve.ui.DeleteColumnContextItem ); ve.ui.InsertRowBeforeContextItem = function VeUiInsertRowBeforeContextItem() { @@ -136,7 +140,11 @@ ve.ui.DeleteRowContextItem.static.name = 'deleteRow'; ve.ui.DeleteRowContextItem.static.group = 'table-row'; ve.ui.DeleteRowContextItem.static.icon = 'remove'; -ve.ui.DeleteRowContextItem.static.title = - OO.ui.deferMsg( 'visualeditor-table-delete-row' ); ve.ui.DeleteRowContextItem.static.commandName = 'deleteRow'; +ve.ui.DeleteRowContextItem.prototype.getTitle = function () { + var selection = this.context.getSurface().getModel().getSelection(), + rowCount = selection instanceof ve.dm.TableSelection ? selection.getRowCount() : 0; + + return ve.msg( 'visualeditor-table-delete-row', rowCount ); +}; ve.ui.contextItemFactory.register( ve.ui.DeleteRowContextItem ); -- To view, visit https://gerrit.wikimedia.org/r/198738 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If6b4a9c055752a86db474d42cf43429640ba44c5 Gerrit-PatchSet: 9 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Pratikbsp <pratik...@yahoo.com> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits