witty-noon-28853
09/12/2025, 8:55 AMchilly-king-10285
09/12/2025, 8:55 AMchilly-king-10285
09/12/2025, 8:55 AMtsx // translations.ts export const messages = { en: { // Replace the TOTP setup instruction text key with your copy: // Use the exact key from Elements’ locale files "settings.totp.instructions": "Your custom instructions on how to set up the authenticator.", }, } // app.tsx import { OryProvider } from "@ory/elements-react" import { messages } from "./translations" export default function App({ Component, ...props }) { return ( <OryProvider customTranslations={messages}> <Component {...props} /> </OryProvider> ) }
This injects your copy wherever the TOTP settings component renders that message. You can find the exact keys to override in the Elements locale files. [[Using custom translations](https://www.ory.sh/docs/elements/guides/internationalization#using-custom-translations); [IntlConfig](https://www.ory.sh/docs/elements/reference/@ory/elements-react/type-aliases/IntlConfig)] Option 2 — Using react-intl directly: Wrap your app in react-intl’s IntlProvider and pass your messages for the current locale; use the same message keys as Elements. [[Internationalization guide](https://www.ory.sh/docs/elements/guides/internationalization#using-custom-translations)]witty-noon-28853
09/12/2025, 8:58 AMchilly-king-10285
09/12/2025, 8:58 AMchilly-king-10285
09/12/2025, 8:59 AMtsx // translations.ts export const messages = { en: { // Use the exact key from Elements’ locales repo for the TOTP instruction "settings.totp.instructions": "Your custom authenticator setup instructions.", }, } // app.tsx/root layout import { OryProvider } from "@ory/elements-react" export default function App({ children }) { return ( <OryProvider config={{ /* your sdk + project config */ }} customTranslations={messages}> {children} </OryProvider> ) }
If you prefer react-intl directly, wrap your app with IntlProvider and provide the same keys. [[Using custom translations](https://www.ory.sh/docs/elements/guides/internationalization#using-custom-translations); [Internationalization](https://www.ory.sh/docs/elements/guides/internationalization)]witty-noon-28853
09/12/2025, 9:27 AMchilly-king-10285
09/12/2025, 9:27 AMchilly-king-10285
09/12/2025, 9:27 AMtsx // translations.ts export const customTranslations = { en: { // Use the exact key from Elements’ locales for the TOTP setup text "settings.totp.instructions": "Your custom instructions on how to set up the authenticator.", }, } // config.ts import { OryClientConfiguration } from "@ory/elements-react" export const config: OryClientConfiguration = { project: { // ...your AccountExperienceConfiguration (urls, name, etc.) }, sdk: { url: "<https://your-slug.projects.oryapis.com>", // or your API base URL }, intl: { locale: "en", customTranslations, // inject your overrides here }, }
Then provide this config to Ory Elements (e.g., via OryProvider or per-component config prop, depending on your setup): tsx import { OryProvider } from "@ory/elements-react" import { config } from "./config" export function App({ children }) { return <OryProvider config={config}>{children}</OryProvider> }
Key refs: the OryClientConfiguration interface supports an intl field with locale and customTranslations; custom i18n is documented in the Elements i18n guide. [[OryClientConfiguration](https://www.ory.sh/docs/elements/reference/@ory/elements-react/interfaces/OryClientConfiguration); [IntlConfig](https://www.ory.sh/docs/elements/reference/@ory/elements-react/type-aliases/IntlConfig); [Using custom translations](https://www.ory.sh/docs/elements/guides/internationalization#using-custom-translations)]witty-noon-28853
09/12/2025, 9:36 AMchilly-king-10285
09/12/2025, 9:36 AMchilly-king-10285
09/12/2025, 9:36 AMtsx // translations.ts export const customTranslations = { en: { "settings.totp.description": "Your custom instructions on how to set up the authenticator.", }, } // config.ts import { OryClientConfiguration } from "@ory/elements-react" export const config: OryClientConfiguration = { project: { // your AccountExperienceConfiguration... }, intl: { locale: "en", customTranslations, }, }
Pass this config to your Settings component (or globally if you use a provider). The intl.customTranslations mechanism is documented in OryClientConfiguration and IntlConfig, and custom i18n overrides are covered in the Elements i18n guide. [[OryClientConfiguration](https://www.ory.sh/docs/elements/reference/@ory/elements-react/interfaces/OryClientConfiguration); [IntlConfig](https://www.ory.sh/docs/elements/reference/@ory/elements-react/type-aliases/IntlConfig); [Using custom translations](https://www.ory.sh/docs/elements/guides/internationalization#using-custom-translations)]