From 1890cd43bbfa124864dfa95c397f50703866cc91 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Thu, 23 Jul 2020 22:34:14 +0300 Subject: [PATCH 1/5] i18n: Merge similar translation strings - tables See trac ticket https://core.trac.wordpress.org/ticket/47259 --- packages/block-library/src/table/edit.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/block-library/src/table/edit.js b/packages/block-library/src/table/edit.js index 4bc6ca81bbdb3..bd369b1fa7b70 100644 --- a/packages/block-library/src/table/edit.js +++ b/packages/block-library/src/table/edit.js @@ -83,17 +83,17 @@ const BACKGROUND_COLORS = [ const ALIGNMENT_CONTROLS = [ { icon: alignLeft, - title: __( 'Align Column Left' ), + title: __( 'Align column left' ), align: 'left', }, { icon: alignCenter, - title: __( 'Align Column Center' ), + title: __( 'Align column center' ), align: 'center', }, { icon: alignRight, - title: __( 'Align Column Right' ), + title: __( 'Align column right' ), align: 'right', }, ]; @@ -435,37 +435,37 @@ export class TableEdit extends Component { return [ { icon: tableRowBefore, - title: __( 'Add Row Before' ), + title: __( 'Insert row before' ), isDisabled: ! selectedCell, onClick: this.onInsertRowBefore, }, { icon: tableRowAfter, - title: __( 'Add Row After' ), + title: __( 'Insert row after' ), isDisabled: ! selectedCell, onClick: this.onInsertRowAfter, }, { icon: tableRowDelete, - title: __( 'Delete Row' ), + title: __( 'Delete row' ), isDisabled: ! selectedCell, onClick: this.onDeleteRow, }, { icon: tableColumnBefore, - title: __( 'Add Column Before' ), + title: __( 'Insert column before' ), isDisabled: ! selectedCell, onClick: this.onInsertColumnBefore, }, { icon: tableColumnAfter, - title: __( 'Add Column After' ), + title: __( 'Insert column after' ), isDisabled: ! selectedCell, onClick: this.onInsertColumnAfter, }, { icon: tableColumnDelete, - title: __( 'Delete Column' ), + title: __( 'Delete column' ), isDisabled: ! selectedCell, onClick: this.onDeleteColumn, }, @@ -580,7 +580,7 @@ export class TableEdit extends Component { > Date: Thu, 23 Jul 2020 23:06:04 +0300 Subject: [PATCH 2/5] table.test.js - updated translation strings --- packages/e2e-tests/specs/editor/blocks/table.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/e2e-tests/specs/editor/blocks/table.test.js b/packages/e2e-tests/specs/editor/blocks/table.test.js index f67f42565baf8..f71a905ea0be5 100644 --- a/packages/e2e-tests/specs/editor/blocks/table.test.js +++ b/packages/e2e-tests/specs/editor/blocks/table.test.js @@ -24,7 +24,7 @@ const createButtonLabel = 'Create Table'; */ async function changeCellAlignment( align ) { await clickBlockToolbarButton( 'Change column alignment' ); - await clickButton( `Align Column ${ capitalize( align ) }` ); + await clickButton( `Align column ${ capitalize( align ) }` ); } describe( 'Table', () => { @@ -37,7 +37,7 @@ describe( 'Table', () => { // Check for existence of the column count field. const columnCountLabel = await page.$x( - "//div[@data-type='core/table']//label[text()='Column Count']" + "//div[@data-type='core/table']//label[text()='Column count']" ); expect( columnCountLabel ).toHaveLength( 1 ); @@ -52,7 +52,7 @@ describe( 'Table', () => { // Check for existence of the row count field. const rowCountLabel = await page.$x( - "//div[@data-type='core/table']//label[text()='Row Count']" + "//div[@data-type='core/table']//label[text()='Row count']" ); expect( rowCountLabel ).toHaveLength( 1 ); @@ -165,7 +165,7 @@ describe( 'Table', () => { // Add a column. await clickBlockToolbarButton( 'Edit table' ); - await clickButton( 'Add Column After' ); + await clickButton( 'Insert column after' ); // Expect the table to have 3 columns across the header, body and footer. expect( await getEditedPostContent() ).toMatchSnapshot(); @@ -174,7 +174,7 @@ describe( 'Table', () => { // Delete a column. await clickBlockToolbarButton( 'Edit table' ); - await clickButton( 'Delete Column' ); + await clickButton( 'Delete column' ); // Expect the table to have 2 columns across the header, body and footer. expect( await getEditedPostContent() ).toMatchSnapshot(); @@ -184,7 +184,7 @@ describe( 'Table', () => { await insertBlock( 'Table' ); const [ columnCountLabel ] = await page.$x( - "//div[@data-type='core/table']//label[text()='Column Count']" + "//div[@data-type='core/table']//label[text()='Column count']" ); await columnCountLabel.click(); await page.keyboard.press( 'Backspace' ); From 0c61c7e322c40ab6a2972ccf64897212e7ec9934 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Fri, 24 Jul 2020 01:08:34 +0300 Subject: [PATCH 3/5] table.test.js - updated translation strings --- packages/e2e-tests/specs/editor/blocks/table.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/e2e-tests/specs/editor/blocks/table.test.js b/packages/e2e-tests/specs/editor/blocks/table.test.js index f71a905ea0be5..13b61714db583 100644 --- a/packages/e2e-tests/specs/editor/blocks/table.test.js +++ b/packages/e2e-tests/specs/editor/blocks/table.test.js @@ -24,7 +24,7 @@ const createButtonLabel = 'Create Table'; */ async function changeCellAlignment( align ) { await clickBlockToolbarButton( 'Change column alignment' ); - await clickButton( `Align column ${ capitalize( align ) }` ); + await clickButton( `Align column ${align}` ); } describe( 'Table', () => { From 23d88b1aa38c0f2ab53e69ce34553f61e512a738 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Fri, 24 Jul 2020 16:58:07 +0300 Subject: [PATCH 4/5] fix table test --- packages/e2e-tests/specs/editor/blocks/table.test.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/e2e-tests/specs/editor/blocks/table.test.js b/packages/e2e-tests/specs/editor/blocks/table.test.js index 13b61714db583..a05afc5f09fbb 100644 --- a/packages/e2e-tests/specs/editor/blocks/table.test.js +++ b/packages/e2e-tests/specs/editor/blocks/table.test.js @@ -1,8 +1,3 @@ -/** - * External dependencies - */ -import { capitalize } from 'lodash'; - /** * WordPress dependencies */ @@ -24,7 +19,7 @@ const createButtonLabel = 'Create Table'; */ async function changeCellAlignment( align ) { await clickBlockToolbarButton( 'Change column alignment' ); - await clickButton( `Align column ${align}` ); + await clickButton( `Align column ${align.toLowerCase()}` ); } describe( 'Table', () => { From b16c13269d4e04d2c22e30e5c3c020f98ae33945 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Wed, 29 Jul 2020 16:25:13 +0300 Subject: [PATCH 5/5] Update packages/e2e-tests/specs/editor/blocks/table.test.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sören Wrede --- packages/e2e-tests/specs/editor/blocks/table.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/e2e-tests/specs/editor/blocks/table.test.js b/packages/e2e-tests/specs/editor/blocks/table.test.js index a05afc5f09fbb..c817cece9b2ea 100644 --- a/packages/e2e-tests/specs/editor/blocks/table.test.js +++ b/packages/e2e-tests/specs/editor/blocks/table.test.js @@ -19,7 +19,7 @@ const createButtonLabel = 'Create Table'; */ async function changeCellAlignment( align ) { await clickBlockToolbarButton( 'Change column alignment' ); - await clickButton( `Align column ${align.toLowerCase()}` ); + await clickButton( `Align column ${ align.toLowerCase() }` ); } describe( 'Table', () => {