Skip to content

Commit d0646ff

Browse files
committed
Add i18n
1 parent 6f96cb6 commit d0646ff

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

src/platform/plugins/shared/controls/public/controls/data_controls/options_list_control/components/options_list_popover_action_bar.tsx

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
EuiFlexGroup,
1717
EuiFlexItem,
1818
EuiFormRow,
19+
EuiLink,
1920
EuiText,
2021
EuiToolTip,
2122
} from '@elastic/eui';
@@ -112,13 +113,12 @@ export const OptionsListPopoverActionBar = ({
112113
<EuiToolTip
113114
content={
114115
totalCardinality > MAX_OPTIONS_LIST_BULK_SELECT_SIZE
115-
? 'Bulk selection is only available for less than 100 options'
116+
? OptionsListStrings.popover.getMaximumBulkSelectionTooltip()
116117
: undefined
117118
}
118119
>
119-
<EuiButtonEmpty
120-
size="s"
121-
isDisabled={
120+
<EuiLink
121+
disabled={
122122
availableOptions.length < 1 ||
123123
totalCardinality < 1 ||
124124
totalCardinality > MAX_OPTIONS_LIST_BULK_SELECT_SIZE
@@ -138,19 +138,18 @@ export const OptionsListPopoverActionBar = ({
138138
}
139139
}}
140140
>
141-
Select all
142-
</EuiButtonEmpty>
143-
</EuiToolTip>
141+
{OptionsListStrings.popover.getSelectAllButtonLabel()}
142+
</EuiLink>
143+
</EuiToolTip>{' '}
144144
<EuiToolTip
145145
content={
146146
totalCardinality > 100
147-
? 'Bulk selection is only available for less than 100 options'
147+
? OptionsListStrings.popover.getMaximumBulkSelectionTooltip()
148148
: undefined
149149
}
150150
>
151-
<EuiButtonEmpty
152-
size="s"
153-
isDisabled={
151+
<EuiLink
152+
disabled={
154153
availableOptions.length < 1 ||
155154
totalCardinality < 1 ||
156155
totalCardinality > MAX_OPTIONS_LIST_BULK_SELECT_SIZE
@@ -170,8 +169,8 @@ export const OptionsListPopoverActionBar = ({
170169
}
171170
}}
172171
>
173-
Deselect all
174-
</EuiButtonEmpty>
172+
{OptionsListStrings.popover.getDeselectAllButtonLabel()}
173+
</EuiLink>
175174
</EuiToolTip>
176175
</EuiText>
177176
</EuiFlexItem>

src/platform/plugins/shared/controls/public/controls/data_controls/options_list_control/options_list_strings.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import { i18n } from '@kbn/i18n';
1111
import { OptionsListSearchTechnique } from '../../../../common/options_list/suggestions_searching';
12+
import { MAX_OPTIONS_LIST_BULK_SELECT_SIZE } from './constants';
1213

1314
export const OptionsListStrings = {
1415
control: {
@@ -267,6 +268,19 @@ export const OptionsListStrings = {
267268
'Appears in {documentCount, number} {documentCount, plural, one {document} other {documents}}',
268269
values: { documentCount },
269270
}),
271+
getSelectAllButtonLabel: () =>
272+
i18n.translate('controls.optionsList.popover.selectAllButtonLabel', {
273+
defaultMessage: 'Select all',
274+
}),
275+
getDeselectAllButtonLabel: () =>
276+
i18n.translate('controls.optionsList.popover.deselectAllButtonLabel', {
277+
defaultMessage: 'Deselect all',
278+
}),
279+
getMaximumBulkSelectionTooltip: () =>
280+
i18n.translate('controls.optionsList.popover.maximumBulkSelectionTooltip', {
281+
defaultMessage: 'Bulk selection is only available for fewer than {maxOptions} options',
282+
values: { maxOptions: MAX_OPTIONS_LIST_BULK_SELECT_SIZE },
283+
}),
270284
},
271285
controlAndPopover: {
272286
getExists: (negate: number = +false) =>

0 commit comments

Comments
 (0)