0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00
astro/.changeset/cyan-grapes-suffer.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
777 B
Markdown
Raw Normal View History

feat(i18n): disable redirect to default language (#9638) * 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>
2024-01-17 08:25:44 -05:00
---
"astro": minor
---
Adds a new `i18n.routing` config option `redirectToDefaultLocale` to disable automatic redirects of the root URL (`/`) to the default locale when `prefixDefaultLocale: true` is set.
In projects where every route, including the default locale, is prefixed with `/[locale]/` path, this property allows you to control whether or not `src/pages/index.astro` should automatically redirect your site visitors from `/` to `/[defaultLocale]`.
You can now opt out of this automatic redirection by setting `redirectToDefaultLocale: false`:
```js
// astro.config.mjs
export default defineConfig({
i18n:{
defaultLocale: "en",
locales: ["en", "fr"],
routing: {
prefixDefaultLocale: true,
redirectToDefaultLocale: false
}
}
})
```