react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

Input HelperText i18n translation

Open papppeter opened this issue 6 months ago • 2 comments

Is your feature request related to a problem? Please describe. I would like to add translated helper texts to inputs.

For now i need to add manually a translation key to every input

I would like to fill in i18nProvider all the helper text which i need without touching the forms itself

Describe the solution you'd like Create a similar solution to fields translations. If a translation exists than helper text will be displayed.

resources.[resource_name].fieldHelperTexts.[field name]

or

resources.[resource_name].fields.[field name] = {label: "Field Label", helperText: "hint"} shorthand would be the original version. not an object but string.

papppeter avatar Jun 13 '25 09:06 papppeter

Thank you for your suggestion!

FYI, helperText actually already supports i18n keys, although I realize this is documented nowhere! 😅 https://github.com/marmelab/react-admin/blob/91f4f906658130eae8947df46951db8b30b6965f/packages/ra-ui-materialui/src/input/InputHelperText.tsx#L22

On the other hand providing a default translation key is an idea to consider. I'll keep this issue open as enhancement idea to see if it gains some traction. You may also work on a PR implementing that feature if you want. However I'd rather use the following key to be more consistent with the rest of the code: resources.${resource}.fields.${source}.helperText.

slax57 avatar Jun 13 '25 09:06 slax57

Thanks for the quick response!

Extending docs is good starting point!

papppeter avatar Jun 13 '25 10:06 papppeter

Fixed by #10785

fzaninotto avatar Aug 13 '25 13:08 fzaninotto