Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: Merge similar translation strings - tables #24169

Merged
merged 5 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()}` );
ramiy marked this conversation as resolved.
Show resolved Hide resolved
}

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