Hi everyone, Has anyone successfully used the acce...
# ory-network
c
Hi everyone, Has anyone successfully used the accept-language header on Ory Client SDK? We are adding the language on the custom headers field ("Accept-Language") on the SDK. All the messages for native flows still return in english. Or do you know of another way to debug this?
p
Hi @chilly-memory-85439 The language support isn't within Kratos. It's within the Account Experience. When you set the
Accept-Language
header on a request to the Account Experience, it will set the language for the rest of the flow. The text is then altered inside the Ory Elements library. https://github.com/ory/kratos-selfservice-ui-node/blob/master/src/pkg/middleware.ts#L144C16-L147 https://github.com/ory/kratos-selfservice-ui-node/blob/master/src/routes/login.ts#L197
You can also add your own translation support within your UI based on what is done inside Ory Elements. We use react-intl here https://github.com/ory/elements/blob/main/src/react-components/provider.tsx#L214-L247 https://github.com/ory/elements/blob/main/src/react-components/ory/helpers/node.tsx#L59-L183
*You don't need Ory Elements to have your own translations. But you can reuse what Ory Elements has.