-
Notifications
You must be signed in to change notification settings - Fork 70
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
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