diff --git a/packages/docusaurus-types/src/index.d.ts b/packages/docusaurus-types/src/index.d.ts index cb36b5cd6777a..723150f7a8fdd 100644 --- a/packages/docusaurus-types/src/index.d.ts +++ b/packages/docusaurus-types/src/index.d.ts @@ -71,8 +71,8 @@ export type I18nConfig = { */ defaultLocale: string; /** - * Root folder where all locale folders are relative to. Can be absolute or - * relative to the config file. + * Root folder where all locale folders are located in. Can be absolute or + * relative to the site dir. */ path: string; /** List of locales deployed on your site. Must contain `defaultLocale`. */ @@ -423,7 +423,8 @@ export type LoadContext = { outDir: string; /** * Directory where all source translations for the current locale can be found - * in. Constructed with `i18n.path` + `i18n.currentLocale.path` (e.g. i18n/en) + * in. Constructed with `i18n.path` + `i18n.currentLocale.path` + * (e.g. `/i18n/en`) */ i18nDir: string; /** diff --git a/website/docs/api/docusaurus.config.js.md b/website/docs/api/docusaurus.config.js.md index 9910ddb5220a3..bb06fba9e3b26 100644 --- a/website/docs/api/docusaurus.config.js.md +++ b/website/docs/api/docusaurus.config.js.md @@ -130,6 +130,7 @@ Example: module.exports = { i18n: { defaultLocale: 'en', + path: 'i18n', locales: ['en', 'fa'], localeConfigs: { en: { @@ -150,6 +151,7 @@ module.exports = { ``` - `defaultLocale`: The locale that (1) does not have its name in the base URL (2) gets started with `docusaurus start` without `--locale` option (3) will be used for the `` tag +- `path`: Root folder where all locale folders are located in. Can be absolute or relative to the site dir. - `locales`: List of locales deployed on your site. Must contain `defaultLocale`. - `localeConfigs`: Individual options for each locale. - `label`: The label displayed for this locale in the locales dropdown.