From b9cf6c73a9bb9f478f44df8992f2bc687b2b3cd4 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 23 Jul 2024 13:12:18 -0400 Subject: [PATCH] fix(ui): Where query selectors for checkboxes are now translated (#7309) Fixes https://github.com/payloadcms/payload/issues/7204 --- packages/ui/src/elements/WhereBuilder/Condition/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/elements/WhereBuilder/Condition/index.tsx b/packages/ui/src/elements/WhereBuilder/Condition/index.tsx index 529759c172..06f2c84b41 100644 --- a/packages/ui/src/elements/WhereBuilder/Condition/index.tsx +++ b/packages/ui/src/elements/WhereBuilder/Condition/index.tsx @@ -43,6 +43,7 @@ import type { Option } from '../../ReactSelect/index.js' import { RenderCustomClientComponent } from '../../../elements/RenderCustomClientComponent/index.js' import { useDebounce } from '../../../hooks/useDebounce.js' +import { useTranslation } from '../../../providers/Translation/index.js' import { Button } from '../../Button/index.js' import { ReactSelect } from '../../ReactSelect/index.js' import { DateField } from './Date/index.js' @@ -78,6 +79,7 @@ export const Condition: React.FC = (props) => { const [internalField, setInternalField] = useState(() => fields.find((field) => fieldName === field.value), ) + const { t } = useTranslation() const [internalOperatorOption, setInternalOperatorOption] = useState(operator) const [internalQueryValue, setInternalQueryValue] = useState(initialValue) @@ -116,7 +118,7 @@ export const Condition: React.FC = (props) => { let valueOptions if (booleanSelect) { - valueOptions = ['true', 'false'] + valueOptions = [t('general:true'), t('general:false')] } else if (internalField?.props && 'options' in internalField.props) { valueOptions = internalField.props.options }