Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Other: Add UI components label to translation service.
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed May 29, 2018
1 parent 969347b commit 27e9222
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/tableui.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default class TableUI extends Plugin {
*/
init() {
const editor = this.editor;
const t = this.editor.t;

editor.ui.componentFactory.add( 'insertTable', locale => {
const command = editor.commands.get( 'insertTable' );
Expand All @@ -47,7 +48,7 @@ export default class TableUI extends Plugin {
// Decorate dropdown's button.
dropdownView.buttonView.set( {
icon: tableIcon,
label: 'Insert table',
label: t( 'Insert table' ),
tooltip: true
} );

Expand All @@ -73,34 +74,34 @@ export default class TableUI extends Plugin {

editor.ui.componentFactory.add( 'tableColumn', locale => {
const options = [
{ commandName: 'setColumnHeader', label: 'Header column', bindIsActive: true },
{ commandName: 'insertColumnBefore', label: 'Insert column before' },
{ commandName: 'insertColumnAfter', label: 'Insert column after' },
{ commandName: 'removeColumn', label: 'Delete column' }
{ commandName: 'setColumnHeader', label: t( 'Header column' ), bindIsActive: true },
{ commandName: 'insertColumnBefore', label: t( 'Insert column before' ) },
{ commandName: 'insertColumnAfter', label: t( 'Insert column after' ) },
{ commandName: 'removeColumn', label: t( 'Delete column' ) }
];

return this._prepareDropdown( 'Column', tableColumnIcon, options, locale );
} );

editor.ui.componentFactory.add( 'tableRow', locale => {
const options = [
{ commandName: 'setRowHeader', label: 'Header row', bindIsActive: true },
{ commandName: 'insertRowBelow', label: 'Insert row below' },
{ commandName: 'insertRowAbove', label: 'Insert row above' },
{ commandName: 'removeRow', label: 'Delete row' }
{ commandName: 'setRowHeader', label: t( 'Header row' ), bindIsActive: true },
{ commandName: 'insertRowBelow', label: t( 'Insert row below' ) },
{ commandName: 'insertRowAbove', label: t( 'Insert row above' ) },
{ commandName: 'removeRow', label: t( 'Delete row' ) }
];

return this._prepareDropdown( 'Row', tableRowIcon, options, locale );
} );

editor.ui.componentFactory.add( 'mergeCell', locale => {
const options = [
{ commandName: 'mergeCellUp', label: 'Merge cell up' },
{ commandName: 'mergeCellRight', label: 'Merge cell right' },
{ commandName: 'mergeCellDown', label: 'Merge cell down' },
{ commandName: 'mergeCellLeft', label: 'Merge cell left' },
{ commandName: 'splitCellVertically', label: 'Split cell vertically' },
{ commandName: 'splitCellHorizontally', label: 'Split cell horizontally' }
{ commandName: 'mergeCellUp', label: t( 'Merge cell up' ) },
{ commandName: 'mergeCellRight', label: t( 'Merge cell right' ) },
{ commandName: 'mergeCellDown', label: t( 'Merge cell down' ) },
{ commandName: 'mergeCellLeft', label: t( 'Merge cell left' ) },
{ commandName: 'splitCellVertically', label: t( 'Split cell vertically' ) },
{ commandName: 'splitCellHorizontally', label: t( 'Split cell horizontally' ) }
];

return this._prepareDropdown( 'Merge cell', tableMergeCellIcon, options, locale );
Expand Down

0 comments on commit 27e9222

Please sign in to comment.