From ea7763c9f3b2e3928c973f51f03abb92a4d5d771 Mon Sep 17 00:00:00 2001 From: Diogo de Azevedo Silva Date: Mon, 20 Feb 2023 19:01:12 -0300 Subject: [PATCH] fix: translate phone input placeholder and message The edit component of phone property was missing translations. --- src/frontend/components/property-type/phone/edit.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontend/components/property-type/phone/edit.tsx b/src/frontend/components/property-type/phone/edit.tsx index 44b5be94d..d3fc1470b 100644 --- a/src/frontend/components/property-type/phone/edit.tsx +++ b/src/frontend/components/property-type/phone/edit.tsx @@ -5,9 +5,13 @@ import { EditPropertyProps } from '../base-property-props' import { recordPropertyIsEqual } from '../record-property-is-equal' import { PropertyLabel } from '../utils/property-label' import allowOverride from '../../../hoc/allow-override' +import { useTranslation } from '../../../hooks' const Edit: FC = (props) => { - const { onChange, property, record } = props + const { onChange, property, record, resource } = props + + const { translateLabel, translateMessage } = useTranslation() + const propValue = record.params?.[property.path] ?? '' const [value, setValue] = useState(propValue) const error = record.errors?.[property.path] @@ -27,6 +31,8 @@ const Edit: FC = (props) => { name: property.path, required: property.isRequired, }} + searchPlaceholder={translateLabel('search', resource.id)} + searchNotFound={translateMessage('noCountryFound', resource.id)} onChange={setValue} onBlur={(): void => onChange(property.path, value)} value={value}