-
Notifications
You must be signed in to change notification settings - Fork 180
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
Map language in URL to locale #108
Comments
We would also be very interested in this. We would like to have |
I've started to work on this. |
Hey @audunru! Any success with this effort? We're having a similar problem with the |
I got it working pretty quickly, then I started working on adding some tests to the existing code to make sure I didn't break anything. I'll see if I can find some time soon to wrap it up! |
Ah great, I'm using a fork for the time being, with a quick solution that complies with the options format you've suggested ( In case somebody needs: https://github.com/smaniotto/gatsby-plugin-intl/tree/prefixes |
I've opened up a pull request for this now. |
Ran into an issue where we want to use a different path segment in the URL than what the actual locale is. This results in complaints in the browser console about missing locale data.
I'm wondering if this needs to be solved in the config.
Current config:
Proposal where a language can be an object, with the underlying locale name set to "nb" to fix any Intl locale data errors, but use the URL-friendly "no" in the visible URL.
This would, I believe, also allow you to to have URLs like
/english/some/page
but still use one of the available English locales.Happy to submit a PR if this is of interest.
EDIT: Updated suggestion to use "prefix" as the option for what to use in the URL instead of my original suggestion of "path"
The text was updated successfully, but these errors were encountered: