elements icon indicating copy to clipboard operation
elements copied to clipboard

custom the i18n translation for prop placeholder, like {title} to 'identities.messages.1070002'

Open Jinglever opened this issue 9 months ago • 4 comments

Preflight checklist

Ory Network Project

No response

Describe your problem

Issue: No way to internationalize form field titles in elements-react registration form

I’m using the registration form provided by @ory/elements-react. The form field titles are defined in the backend identity.schema.json, which only allows a single language.

However, I haven’t found a way to internationalize (i18n) these field titles when the form is rendered on the frontend. This makes it difficult to support multi-language UIs.

Is there any recommended approach or workaround to support translated titles in the rendered form?

Describe your ideal solution

Ideally, I’d like to be able to localize the form field titles using my frontend’s local i18n setup (e.g. i18next). Alternatively, if identity.schema.json could support multi-language title fields — such as language-specific keys or a built-in localization structure — that would also solve the issue.

Workarounds or alternatives

none workarounds yet.

Version

1.0.0-rc.5

Additional Context

No response

Jinglever avatar May 28 '25 16:05 Jinglever

The form field titles are defined in the backend identity.schema.json, which only allows a single language.

en.json

{
  "property.country_code": "country"
  "forms.label.country_code": "Country"
}

NikitaIT avatar Nov 05 '25 11:11 NikitaIT

Is this what you are looking for -> Using custom translations ?

vinckr avatar Nov 06 '25 13:11 vinckr

Yes, we've added new translations keys to help with the message with ID 1070002.

To use this:

"forms.input.placeholder.traits.email": "My custom placeholder for email fields"
// or

"forms.label.traits.email": "My custom label for email fields"

Where traits.email is the path within the identity schema. E.g. for a trait named phone you'd change it to forms.input.placeholder.traits.phone.

jonas-jonas avatar Nov 18 '25 14:11 jonas-jonas

Ah, sorry this is not released yet. Will be released in the next release.

jonas-jonas avatar Nov 18 '25 14:11 jonas-jonas