You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `i18nDomains` routing feature introduced behind a flag in [v3.4.0](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#430) is no longer experimental and is available for general use.
6
+
7
+
This routing option allows you to configure different domains for individual locales in entirely server-rendered projects using the [@astrojs/node](https://docs.astro.build/en/guides/integrations-guide/node/) or [@astrojs/vercel](https://docs.astro.build/en/guides/integrations-guide/vercel/) adapter with a `site` configured.
8
+
9
+
If you were using this feature, please remove the experimental flag from your Astro config:
10
+
11
+
```diff
12
+
import { defineConfig } from 'astro'
13
+
14
+
export default defineConfig({
15
+
- experimental: {
16
+
- i18nDomains: true,
17
+
- }
18
+
})
19
+
```
20
+
21
+
If you have been waiting for stabilization before using this routing option, you can now do so.
22
+
23
+
Please see [the internationalization docs](https://docs.astro.build/en/guides/internationalization/#domains) for more about this feature.
* In the event of route collisions, where two routes of equal route priority attempt to build the same URL, Astro will log a warning identifying the conflicting routes.
1956
1956
*/
1957
1957
globalRoutePriority?: boolean;
1958
-
1959
-
/**
1960
-
* @docs
1961
-
* @name experimental.i18nDomains
1962
-
* @type {boolean}
1963
-
* @default `false`
1964
-
* @version 4.3.0
1965
-
* @description
1966
-
*
1967
-
* Enables domain support for the [experimental `domains` routing strategy](https://docs.astro.build/en/guides/internationalization/#domains-experimental) which allows you to configure the URL pattern of one or more supported languages to use a custom domain (or sub-domain).
1968
-
*
1969
-
* When a locale is mapped to a domain, a `/[locale]/` path prefix will not be used. However, localized folders within `src/pages/` are still required, including for your configured `defaultLocale`.
1970
-
*
1971
-
* Any other locale not configured will default to a localized path-based URL according to your `prefixDefaultLocale` strategy (e.g. `https://example.com/[locale]/blog`).
1972
-
*
1973
-
* ```js
1974
-
* //astro.config.mjs
1975
-
* export default defineConfig({
1976
-
* site: "https://example.com",
1977
-
* output: "server", // required, with no prerendered pages
1978
-
* adapter: node({
1979
-
* mode: 'standalone',
1980
-
* }),
1981
-
* i18n: {
1982
-
* defaultLocale: "en",
1983
-
* locales: ["en", "fr", "pt-br", "es"],
1984
-
* prefixDefaultLocale: false,
1985
-
* domains: {
1986
-
* fr: "https://fr.example.com",
1987
-
* es: "https://example.es",
1988
-
* },
1989
-
* },
1990
-
* experimental: {
1991
-
* i18nDomains: true,
1992
-
* },
1993
-
* });
1994
-
* ```
1995
-
*
1996
-
* Both page routes built and URLs returned by the `astro:i18n` helper functions [`getAbsoluteLocaleUrl()`](https://docs.astro.build/en/reference/api-reference/#getabsolutelocaleurl) and [`getAbsoluteLocaleUrlList()`](https://docs.astro.build/en/reference/api-reference/#getabsolutelocaleurllist) will use the options set in `i18n.domains`.
1997
-
*
1998
-
* See the [Internationalization Guide](https://docs.astro.build/en/guides/internationalization/#domains-experimental) for more details, including the limitations of this experimental feature.
"The option `site` isn't set. When using the 'domains' strategy for `i18n`, `site` is required to create absolute URLs for locales that aren't mapped to a domain.",
679
-
});
680
-
}
681
-
if(output!=='server'){
682
-
ctx.addIssue({
683
-
code: z.ZodIssueCode.custom,
684
-
message: 'Domain support is only available when `output` is `"server"`.',
"The option `site` isn't set. When using the 'domains' strategy for `i18n`, `site` is required to create absolute URLs for locales that aren't mapped to a domain.",
676
+
});
677
+
}
678
+
if(output!=='server'){
679
+
ctx.addIssue({
680
+
code: z.ZodIssueCode.custom,
681
+
message: 'Domain support is only available when `output` is `"server"`.',
0 commit comments