diff --git a/components/locale-provider/en_US.tsx b/components/locale-provider/en_US.tsx index f41ec856d5..adb58e60f4 100644 --- a/components/locale-provider/en_US.tsx +++ b/components/locale-provider/en_US.tsx @@ -17,6 +17,8 @@ export default { filterConfirm: 'OK', filterReset: 'Reset', emptyText: 'No Data', + selectAll: 'Select All', + selectInvert: 'Select Invert', }, Modal: { okText: 'OK', diff --git a/components/table/SelectionCheckboxAll.tsx b/components/table/SelectionCheckboxAll.tsx index 351c9a58af..e6e85012e1 100644 --- a/components/table/SelectionCheckboxAll.tsx +++ b/components/table/SelectionCheckboxAll.tsx @@ -13,6 +13,7 @@ export interface SelectionDecorator { export interface SelectionCheckboxAllProps { store: Store; + locale: any; disabled: boolean; getCheckboxPropsByItem: (item, index) => any; getRecordKey: (record, index?) => string; @@ -22,22 +23,23 @@ export interface SelectionCheckboxAllProps { selections: SelectionDecorator[]; } -const defaultSelections: SelectionDecorator[] = [{ - key: 'all', - text: '全选', - onSelect: () => {}, -}, { - key: 'invert', - text: '反选', - onSelect: () => {}, -}]; - export default class SelectionCheckboxAll extends React.Component { unsubscribe: () => void; + defaultSelections: SelectionDecorator[]; constructor(props) { super(props); + this.defaultSelections = [{ + key: 'all', + text: props.locale.selectAll, + onSelect: () => {}, + }, { + key: 'invert', + text: props.locale.selectInvert, + onSelect: () => {}, + }]; + this.state = { checked: this.getCheckState(props), indeterminate: this.getIndeterminateState(props), @@ -154,11 +156,12 @@ export default class SelectionCheckboxAll extends React.Component {this.renderMenus(selections)} @@ -167,6 +170,7 @@ export default class SelectionCheckboxAll extends React.Component 暂无数据, + selectAll: '全选', + selectInvert: '反选', }; const defaultPagination = { @@ -627,6 +629,7 @@ export default class Table extends React.Component, any> { selectionColumn.title = (