Skip to content

Commit

Permalink
i18n: Merge similar translation strings - tables (#24169)
Browse files Browse the repository at this point in the history
* i18n: Merge similar translation strings - tables

See trac ticket https://core.trac.wordpress.org/ticket/47259

* table.test.js - updated translation strings

* table.test.js - updated translation strings

* fix table test

* Update packages/e2e-tests/specs/editor/blocks/table.test.js

Co-authored-by: Sören Wrede <[email protected]>

Co-authored-by: Sören Wrede <[email protected]>
  • Loading branch information
ramiy and Soean authored Jul 29, 2020
1 parent fe5b553 commit 06db150
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
22 changes: 11 additions & 11 deletions packages/block-library/src/table/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
];
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -580,15 +580,15 @@ export class TableEdit extends Component {
>
<TextControl
type="number"
label={ __( 'Column Count' ) }
label={ __( 'Column count' ) }
value={ initialColumnCount }
onChange={ this.onChangeInitialColumnCount }
min="1"
className="blocks-table__placeholder-input"
/>
<TextControl
type="number"
label={ __( 'Row Count' ) }
label={ __( 'Row count' ) }
value={ initialRowCount }
onChange={ this.onChangeInitialRowCount }
min="1"
Expand Down
17 changes: 6 additions & 11 deletions packages/e2e-tests/specs/editor/blocks/table.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* External dependencies
*/
import { capitalize } from 'lodash';

/**
* WordPress dependencies
*/
Expand All @@ -24,7 +19,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.toLowerCase() }` );
}

describe( 'Table', () => {
Expand All @@ -37,7 +32,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 );

Expand All @@ -52,7 +47,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 );

Expand Down Expand Up @@ -165,7 +160,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();
Expand All @@ -174,7 +169,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();
Expand All @@ -184,7 +179,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' );
Expand Down

0 comments on commit 06db150

Please sign in to comment.