-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
🌵 [SPIKE] Can we use url paths to choose a locale? #23163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Playing around, looking to see if I can pass desired language by route, use that to offer different theme translations, app translations, etc, based on requested url.
Short answer: yes, but I have no idea what to do about navigation.
Slightly longer answer: The problem with the approach here is that we don't know in advance what languages might be requested, which means we can't pre-initialize i18next, which means that the first request for a given language is wrong/throws/stalls forever/something else undesirable. (And that means all my tests break too, of course.) Aside from the first request for a language, it works great and was a surprisingly small tweak. (Looks bigger than it is because I built it on the unmerged theme i18next code swap.)
To be viable, I think we need either a way to pre-declare (config.production.json or a list in the admin panel) what languages will be used so that they can be initialized on boot.
Or perhaps better would be to add a locale property to routes.yaml, which might be more flexible.