-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add support for locale folders #1113
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This reverts commit d95fb00.
Deployment failed with the following error:
Learn More: https://vercel.link/invalid-route-source-pattern |
Deployment failed with the following error:
Learn More: https://vercel.link/mix-routing-props |
@Sporiff I can't make a good review cause I can't load a page with changes(I tried from both my machines and it`s just lagging and sending an error), but anyway:
Maybe I've missed something cause I can`t open all changes, but preview works for me |
You should be able to load it if you use the file filter to remove the mdx and mdoc files and just show the ts/mjs/astro files.
This is actually what we currently have. The When using the i18n API in Astro without prefixing the default locale, the custom 404 file doesn't get copied unless it's inside the Basically, the 404 page doesn't appear under a locale route. It's just served at the root level whenever the user hits a nonexistent page. This means the localization doesn't work quite as expected. The Vercel middleware enables us to push the user to the English 404 page, but it's a bit limited beyond that.
Astro middleware is a bit limited on SSG mode because the middleware can't know at build time what the user's locale is or where they're trying to go. The best solution for this is probably just to put some inline script in the 404 page that redirects the user to the localized page based on normal browser detection at runtime. |
@Sporiff Yep, I've tried to filter but can't check everything. Under middleware, I mean astro middleware in our src folder, but it's fine if it works for now Approved(can't do this from review) |
Closes https://adjustcom.atlassian.net/browse/THC-1023
Due to limitations in our translation software, we've previously had to add workarounds for keeping all of our localized files in the same directory as the English content (with the locale appended to differentiate). Since this missing feature has been added, we can now make use of Astro's build-in 18n routing rules by moving our files to locale-based folders.