0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-27 22:19:04 -05:00
astro/.changeset/fluffy-dolls-sleep.md

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

27 lines
639 B
Markdown
Raw Normal View History

---
'astro': minor
---
Adds a new way to configure the `i18n.locales` array.
Developers can now assign a custom URL path prefix that can span multiple language codes:
```js
// astro.config.mjs
export default defineConfig({
experimental: {
i18n: {
defaultLocale: "english",
locales: [
"de",
{ path: "english", codes: ["en", "en-US"]},
"fr",
],
routingStrategy: "prefix-always"
}
}
})
```
With the above configuration, the URL prefix of the default locale will be `/english/`. When computing `Astro.preferredLocale`, Astro will use the `codes`.