Skip to content

Commit 8c0a6c5

Browse files
authored
[FIX] Translations for App Select Settings not working (#23908)
1 parent c0b4120 commit 8c0a6c5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

client/views/admin/apps/AppSetting.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ function AppSetting({ appSetting, onChange, value, ...props }) {
4646
[i18nDescription, tApp],
4747
);
4848

49+
let translatedValues;
50+
if (values?.length) {
51+
translatedValues = values.map((selectFieldEntry) => {
52+
const { key, i18nLabel } = selectFieldEntry;
53+
54+
if (!i18nLabel) {
55+
return selectFieldEntry;
56+
}
57+
58+
return {
59+
key,
60+
i18nLabel: tApp(i18nLabel),
61+
};
62+
});
63+
}
64+
4965
return (
5066
<MemoizedSetting
5167
type={type}
@@ -54,7 +70,7 @@ function AppSetting({ appSetting, onChange, value, ...props }) {
5470
value={value}
5571
onChangeValue={onChange}
5672
_id={id}
57-
values={values}
73+
values={translatedValues}
5874
{...props}
5975
/>
6076
);

0 commit comments

Comments
 (0)