mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
fix some i18n config docs (#10746)
* fix some i18n config docs * Move manual option to last position --------- Co-authored-by: = <otterlord.dev@gmail.com>
This commit is contained in:
parent
c3008fd85a
commit
51b3a6a5ac
1 changed files with 40 additions and 14 deletions
|
@ -1494,22 +1494,11 @@ export interface AstroUserConfig {
|
||||||
* @description
|
* @description
|
||||||
*
|
*
|
||||||
* Controls the routing strategy to determine your site URLs. Set this based on your folder/URL path configuration for your default language.
|
* Controls the routing strategy to determine your site URLs. Set this based on your folder/URL path configuration for your default language.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
routing?:
|
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
|
* @docs
|
||||||
* @name i18n.routing.prefixDefaultLocale
|
* @name i18n.routing.prefixDefaultLocale
|
||||||
|
@ -1526,6 +1515,18 @@ export interface AstroUserConfig {
|
||||||
* When `true`, all URLs will display a language prefix.
|
* 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.
|
* 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.
|
* 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;
|
prefixDefaultLocale?: boolean;
|
||||||
|
|
||||||
|
@ -1568,7 +1569,32 @@ export interface AstroUserConfig {
|
||||||
* - `"pathname": The strategy is applied to the pathname of the URLs
|
* - `"pathname": The strategy is applied to the pathname of the URLs
|
||||||
*/
|
*/
|
||||||
strategy?: 'pathname';
|
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
|
* @name i18n.domains
|
||||||
|
|
Loading…
Reference in a new issue