-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat(gatsby-theme-i18n): Add "prefixDefault" option #75
Conversation
add default option 404 default update gatsby-node.js change helpers (object params) and update useLocalization hook and usages of those helpers add seo title to client-only param component create 404 page for default example
I dropped it into my existing project and it seems to not have broken anything. I removed my own implementation and will continue using this revision. I'll report back if there is anything amiss 👍 |
@LekoArts The prefixDefault is working for me also. The question that I have: What is the strategy if a route without a prefix is opened? Now you just get a empty page. Can I do anything about that? It would be perfect if the user would be rerouted to the matching lang in that case. Like if a person with the browser lang set to German clicks an a link to www.product.com/landingpage is rerouted to www.product.com/de/landingpage. Can I get this behaviour already somehow? |
@philschonholzer Sure, you can do something about that! If you read the "Automating the process of adding locale-based redirects." part of this medium blog post you have the option of server redirects:
But if you look at gatsby-plugin-intl that uses browser-lang you can also use redirects in the browser. I'm definitely open for adding documentation around this to the README (and docs later) though. |
Hey @LekoArts I tried out this pull request and it fixes the exact issue I've been trying to figure out for an hour or two, is there an eta for this to be merged? Is there anything else I can do to help with getting this there? |
Published in |
You can try this out by installing the canary
1.0.5-defaultprefix
on npm.This adds a
prefixDefault
option togatsby-theme-i18n
. Currently this will create/en/
instead of/
if e.g.en
is the default language.