Skip to content

Commit 8fa91a5

Browse files
authored
fix(ui): missing translation support in SelectMany component (#14819)
### What? Restores translation support to the `SelectMany` component in list views. The component now properly uses the `useTranslation` hook and the `general:select` translation key. ### Why? The `SelectMany` component had its translation functionality commented out, causing it to display hardcoded English text ("Select X") instead of being localized for different languages. This broke internationalization support for users viewing the admin panel in non-English locales. ### How? Uncommented the `useTranslation` import and hook usage, then updated the button text to use the `t('general:select')` translation key followed by the count. Fixes #14816
1 parent 2b7aa7a commit 8fa91a5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22

33
import { useSelection } from '../../providers/Selection/index.js'
4-
// import { useTranslation } from '../../providers/Translation/index.js'
4+
import { useTranslation } from '../../providers/Translation/index.js'
55
import { Pill } from '../Pill/index.js'
66

77
export const SelectMany: React.FC<{
@@ -10,15 +10,14 @@ export const SelectMany: React.FC<{
1010
const { onClick } = props
1111

1212
const { count, selected } = useSelection()
13-
// const { t } = useTranslation()
13+
const { t } = useTranslation()
1414

1515
if (!selected || !count) {
1616
return null
1717
}
1818

1919
return (
2020
<Pill
21-
// className={`${baseClass}__toggle`}
2221
onClick={() => {
2322
if (typeof onClick === 'function') {
2423
onClick(selected)
@@ -27,7 +26,7 @@ export const SelectMany: React.FC<{
2726
pillStyle="white"
2827
size="small"
2928
>
30-
{`Select ${count}`}
29+
{t('general:select')} {count}
3130
</Pill>
3231
)
3332
}

0 commit comments

Comments
 (0)