Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/frontend/components/property-type/phone/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<EditPropertyProps> = (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]
Expand All @@ -27,6 +31,8 @@ const Edit: FC<EditPropertyProps> = (props) => {
name: property.path,
required: property.isRequired,
}}
searchPlaceholder={translateLabel('search', resource.id)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use translateMessage for placeholder too, translateLabel is mostly used for translating some headers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add translations to the core translations for all languages? We usually just use https://www.deepl.com/en/translator for this

searchNotFound={translateMessage('noCountryFound', resource.id)}
onChange={setValue}
onBlur={(): void => onChange(property.path, value)}
value={value}
Expand Down