fix(ui): Where query selectors for checkboxes are now translated (#7309)
Fixes https://github.com/payloadcms/payload/issues/7204
This commit is contained in:
@@ -43,6 +43,7 @@ import type { Option } from '../../ReactSelect/index.js'
|
|||||||
|
|
||||||
import { RenderCustomClientComponent } from '../../../elements/RenderCustomClientComponent/index.js'
|
import { RenderCustomClientComponent } from '../../../elements/RenderCustomClientComponent/index.js'
|
||||||
import { useDebounce } from '../../../hooks/useDebounce.js'
|
import { useDebounce } from '../../../hooks/useDebounce.js'
|
||||||
|
import { useTranslation } from '../../../providers/Translation/index.js'
|
||||||
import { Button } from '../../Button/index.js'
|
import { Button } from '../../Button/index.js'
|
||||||
import { ReactSelect } from '../../ReactSelect/index.js'
|
import { ReactSelect } from '../../ReactSelect/index.js'
|
||||||
import { DateField } from './Date/index.js'
|
import { DateField } from './Date/index.js'
|
||||||
@@ -78,6 +79,7 @@ export const Condition: React.FC<Props> = (props) => {
|
|||||||
const [internalField, setInternalField] = useState<FieldCondition>(() =>
|
const [internalField, setInternalField] = useState<FieldCondition>(() =>
|
||||||
fields.find((field) => fieldName === field.value),
|
fields.find((field) => fieldName === field.value),
|
||||||
)
|
)
|
||||||
|
const { t } = useTranslation()
|
||||||
const [internalOperatorOption, setInternalOperatorOption] = useState<Operator>(operator)
|
const [internalOperatorOption, setInternalOperatorOption] = useState<Operator>(operator)
|
||||||
const [internalQueryValue, setInternalQueryValue] = useState<string>(initialValue)
|
const [internalQueryValue, setInternalQueryValue] = useState<string>(initialValue)
|
||||||
|
|
||||||
@@ -116,7 +118,7 @@ export const Condition: React.FC<Props> = (props) => {
|
|||||||
|
|
||||||
let valueOptions
|
let valueOptions
|
||||||
if (booleanSelect) {
|
if (booleanSelect) {
|
||||||
valueOptions = ['true', 'false']
|
valueOptions = [t('general:true'), t('general:false')]
|
||||||
} else if (internalField?.props && 'options' in internalField.props) {
|
} else if (internalField?.props && 'options' in internalField.props) {
|
||||||
valueOptions = internalField.props.options
|
valueOptions = internalField.props.options
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user