Merge b73e164482 into c9d9316e97
This commit is contained in:
commit
f07d54992b
|
|
@ -1,40 +1,47 @@
|
||||||
/**
|
/**
|
||||||
* Shared i18n locale configuration.
|
* Shared i18n locale configuration.
|
||||||
*
|
*
|
||||||
* Single source of truth for locale definitions used by:
|
* Single source of truth for locale definitions used by:
|
||||||
* - website/astro.config.mjs (Starlight i18n)
|
* - website/astro.config.mjs (Starlight i18n)
|
||||||
* - tools/build-docs.mjs (llms-full.txt locale exclusion)
|
* - tools/build-docs.mjs (llms-full.txt locale exclusion)
|
||||||
* - website/src/pages/404.astro (client-side locale redirect)
|
* - website/src/pages/404.astro (client-side locale redirect)
|
||||||
*
|
*
|
||||||
* The root locale (English) uses Starlight's 'root' key convention
|
* The root locale (English) uses Starlight's 'root' key convention
|
||||||
* (no URL prefix). All other locales get a URL prefix matching their key.
|
* (no URL prefix). All other locales get a URL prefix matching their key.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const locales = {
|
/**
|
||||||
root: {
|
* @typedef {Object} Locale
|
||||||
label: 'English',
|
* @property {string} label - The display name of the locale.
|
||||||
lang: 'en',
|
* @property {string} lang - The BCP 47 language tag.
|
||||||
},
|
*/
|
||||||
'vi-vn': {
|
|
||||||
label: 'Tiếng Việt',
|
/** @type {Record<string, Locale>} */
|
||||||
lang: 'vi-VN',
|
export const locales = {
|
||||||
},
|
root: {
|
||||||
'zh-cn': {
|
label: 'English',
|
||||||
label: '简体中文',
|
lang: 'en',
|
||||||
lang: 'zh-CN',
|
},
|
||||||
},
|
'vi-vn': {
|
||||||
fr: {
|
label: 'Tiếng Việt',
|
||||||
label: 'Français',
|
lang: 'vi-VN',
|
||||||
lang: 'fr-FR',
|
},
|
||||||
},
|
'zh-cn': {
|
||||||
cs: {
|
label: '简体中文',
|
||||||
label: 'Čeština',
|
lang: 'zh-CN',
|
||||||
lang: 'cs-CZ',
|
},
|
||||||
},
|
fr: {
|
||||||
};
|
label: 'Français',
|
||||||
|
lang: 'fr-FR',
|
||||||
/**
|
},
|
||||||
* Non-root locale keys (the URL prefixes for translated content).
|
cs: {
|
||||||
* @type {string[]}
|
label: 'Čeština',
|
||||||
*/
|
lang: 'cs-CZ',
|
||||||
export const translatedLocales = Object.keys(locales).filter((k) => k !== 'root');
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Non-root locale keys (the URL prefixes for translated content).
|
||||||
|
* @type {string[]}
|
||||||
|
*/
|
||||||
|
export const translatedLocales = Object.keys(locales).filter((k) => k !== 'root');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue