Preflight checklist
Ory Network Project
No response
Describe the bug
Upgrading to Ory elements v1.2.0 we found a bug in translations not being honored. When trying to sign up with a already existing email, for an account with no social signing options, we get the error message back in english instead of our translation.
Looking further into the issue it seems like the following happens,
In node_modules/@ory/elements-react/dist/theme/default/index.mjs → uiTextToFormattedMessage (line 1269):
if (isKratosMessageId(id)) {
const hasEmptyArrayContext = Object.values(context).some(
(v) => Array.isArray(v) && v.length === 0
);
if (hasEmptyArrayContext) {
return text; // ← returns raw server text (English), skips translation
}
return intl.formatMessage(kratosMessages[id], contextInjectedMessage);
}
If any value in the message's context is an empty array, Ory bails out and returns the raw server text — never running it through intl.formatMessage, so our customTranslations (svOry.json) are bypassed.
Reproducing the bug
- Use Ory/elements-react v1.2.0
- Add a custom translation for a different language other than English
- Create a account using a non social signing provider option, like email + password
- Logout and try to repeat 2 with the same email
- The error message is now in English instead of your language set in the translation file
Relevant log output
Relevant configuration
Version
1.2.0
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Other
Additional Context
No response
Preflight checklist
Ory Network Project
No response
Describe the bug
Upgrading to Ory elements v1.2.0 we found a bug in translations not being honored. When trying to sign up with a already existing email, for an account with no social signing options, we get the error message back in english instead of our translation.
Looking further into the issue it seems like the following happens,
In
node_modules/@ory/elements-react/dist/theme/default/index.mjs → uiTextToFormattedMessage(line 1269):If any value in the message's context is an empty array, Ory bails out and returns the raw server text — never running it through intl.formatMessage, so our customTranslations (svOry.json) are bypassed.
Reproducing the bug
Relevant log output
Relevant configuration
Version
1.2.0
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Other
Additional Context
No response