-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix(i18n): emit an error when the index isn't found #9678
Conversation
🦋 Changeset detectedLatest commit: 00c9fb5 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs is happy with the error message! (c @Princesseuh to confirm the syntax/formatting!)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format looks great!
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* fix(i18n): emit an error when the index isn't found * changeset * Update .changeset/proud-guests-bake.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * rename * Update packages/astro/src/core/errors/errors-data.ts Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* feat(i18n): disable redirect * feat(i18n): add option to disable redirect to default language * chore: add schema validation * docs * changeset * Update packages/astro/src/core/config/schema.ts Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> * chore: address feedback * fix test * Update .changeset/cyan-grapes-suffer.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update packages/astro/src/@types/astro.ts Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Fix discord fetch code (#9663) * Force re-execution of Partytown's head snippet on view transitions (#9666) * Remove the header script before a view transition takes place to force a reload on the next page * Add changeset * Save another char * [ci] format * fix(assets): Implement all hooks in the passthrough image service (#9668) * fix(assets): Implement all hooks in the passthrough image service * chore: changeset * refactor(toolbar): Rename every internal reference of overlay/plugins to toolbar/apps (#9647) * refactor(toolbar): Rename every internal reference of overlay/plugins to toolbar/apps * refactor: rename vite plugin * fix: update import * nit: add setting fallback * Disable file watcher for internal one-off vite servers (#9665) * Use node:test and node:assert/strict (#9649) * [ci] format * fix(i18n): emit an error when the index isn't found (#9678) * fix(i18n): emit an error when the index isn't found * changeset * Update .changeset/proud-guests-bake.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * rename * Update packages/astro/src/core/errors/errors-data.ts Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * feat(i18n): add option to disable redirect to default language * chore: rebase * Update packages/astro/src/@types/astro.ts Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> * lock file update --------- Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Martin Trapp <94928215+martrapp@users.noreply.github.com> Co-authored-by: Martin Trapp <martrapp@users.noreply.github.com> Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com> Co-authored-by: Bjorn Lu <bluwy@users.noreply.github.com> Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Changes
We've had more than one report where users didn't add a index page when they use the option
i18n.routing.prefixDefaultLocale
totrue
.The index page is required to create a redirect from
/
to/<defaultLocale>
.This PR adds a check during the build, and emits an error if the index is missing.
Testing
There was a case where a fixture didn't have the index, and the test cases were still passing.
These fixtures were now raising an error, and I added the index page.
Docs
/cc @withastro/maintainers-docs for feedback!