diff options
author | 2024-04-10 16:49:12 -0300 | |
---|---|---|
committer | 2024-04-10 20:49:12 +0100 | |
commit | 51b3a6a5acb7098b9cd5a85f4ac690165853f651 (patch) | |
tree | 639f7346a06af4741897fa41139243c4f8080489 | |
parent | c3008fd85a40a879c3b323c48137aada0be807d8 (diff) | |
download | astro-51b3a6a5acb7098b9cd5a85f4ac690165853f651.tar.gz astro-51b3a6a5acb7098b9cd5a85f4ac690165853f651.tar.zst astro-51b3a6a5acb7098b9cd5a85f4ac690165853f651.zip |
fix some i18n config docs (#10746)
* fix some i18n config docs
* Move manual option to last position
---------
Co-authored-by: = <otterlord.dev@gmail.com>
-rw-r--r-- | packages/astro/src/@types/astro.ts | 54 |
1 files changed, 40 insertions, 14 deletions
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 705d26732..5ef43ff99 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -1494,22 +1494,11 @@ export interface AstroUserConfig { * @description * * Controls the routing strategy to determine your site URLs. Set this based on your folder/URL path configuration for your default language. + * */ // prettier-ignore routing?: - /** - * - * @docs - * @name i18n.routing.manual - * @type {string} - * @version 4.6.0 - * @description - * When this option is enabled, Astro will **disable** its i18n middleware so that you can implement your own custom logic. No other `routing` options (e.g. `prefixDefaultLocale`) may be configured with `routing: "manual"`. - * - * You will be responsible for writing your own routing logic, or executing Astro's i18n middleware manually alongside your own. - */ - 'manual' - | { + { /** * @docs * @name i18n.routing.prefixDefaultLocale @@ -1526,6 +1515,18 @@ export interface AstroUserConfig { * When `true`, all URLs will display a language prefix. * URLs will be of the form `example.com/[locale]/content/` for every route, including the default language. * Localized folders are used for every language, including the default. + * + * ```js + * export default defineConfig({ + * i18n: { + * defaultLocale: "en", + * locales: ["en", "fr", "pt-br", "es"], + * routing: { + * prefixDefaultLocale: true, + * } + * } + * }) + * ``` */ prefixDefaultLocale?: boolean; @@ -1568,7 +1569,32 @@ export interface AstroUserConfig { * - `"pathname": The strategy is applied to the pathname of the URLs */ strategy?: 'pathname'; - }; + } | + /** + * + * @docs + * @name i18n.routing.manual + * @kind h4 + * @type {string} + * @version 4.6.0 + * @description + * When this option is enabled, Astro will **disable** its i18n middleware so that you can implement your own custom logic. No other `routing` options (e.g. `prefixDefaultLocale`) may be configured with `routing: "manual"`. + * + * You will be responsible for writing your own routing logic, or executing Astro's i18n middleware manually alongside your own. + * + * ```js + * export default defineConfig({ + * i18n: { + * defaultLocale: "en", + * locales: ["en", "fr", "pt-br", "es"], + * routing: { + * prefixDefaultLocale: true, + * } + * } + * }) + * ``` + */ + 'manual'; /** * @name i18n.domains |