Preflight checklist
Ory Network Project
No response
Describe your problem
Currently, it seems like this mode is not supported, since there are no references to the "accept-language" header in the library.
In fact, it is not the key: project.default_locale which is used (as the name would perhaps suggest), but the intl.locale config key
|
locale={config.intl?.locale ?? "en"} |
.
Describe your ideal solution
I would expect the behaviour of the default OryProvider to interpret the "accept-language" header in "respect_accept_language" mode, and use that as the default application language, unless otherwise overridden in the config object.
I imagine that this would entail adding another function to "utils" which parses the header and possibly cross-references it with the project.enabled_locales array from config. Once this approach is approved, I'd be happy to open a PR.
Workarounds or alternatives
I was looking at using window.navigator.language as an alternative but this would mean that the config object would need to be rendered client-side.
Version
main 795b1bd
Additional Context
No response
Preflight checklist
Ory Network Project
No response
Describe your problem
Currently, it seems like this mode is not supported, since there are no references to the "accept-language" header in the library.
In fact, it is not the key:
project.default_localewhich is used (as the name would perhaps suggest), but theintl.localeconfig keyelements/packages/elements-react/src/context/provider.tsx
Line 83 in 795b1bd
Describe your ideal solution
I would expect the behaviour of the default OryProvider to interpret the "accept-language" header in "respect_accept_language" mode, and use that as the default application language, unless otherwise overridden in the config object.
I imagine that this would entail adding another function to "utils" which parses the header and possibly cross-references it with the
project.enabled_localesarray from config. Once this approach is approved, I'd be happy to open a PR.Workarounds or alternatives
I was looking at using window.navigator.language as an alternative but this would mean that the config object would need to be rendered client-side.
Version
main 795b1bd
Additional Context
No response