diff --git a/web/src/components/config-form/theme/widgets/SelectWidget.tsx b/web/src/components/config-form/theme/widgets/SelectWidget.tsx index d5047e959..46c2d0701 100644 --- a/web/src/components/config-form/theme/widgets/SelectWidget.tsx +++ b/web/src/components/config-form/theme/widgets/SelectWidget.tsx @@ -1,5 +1,6 @@ // Select Widget - maps to shadcn/ui Select import type { WidgetProps } from "@rjsf/utils"; +import { useTranslation } from "react-i18next"; import { Select, SelectContent, @@ -21,9 +22,18 @@ export function SelectWidget(props: WidgetProps) { schema, } = props; + const { t } = useTranslation(["views/settings"]); const { enumOptions = [] } = options; + const enumI18nPrefix = options["enumI18nPrefix"] as string | undefined; const fieldClassName = getSizedFieldClassName(options, "sm"); + const getLabel = (option: { value: unknown; label: string }) => { + if (enumI18nPrefix) { + return t(`${enumI18nPrefix}.${option.value}`); + } + return option.label; + }; + return (