mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
feat(core): allow customizing the i18n directory path (#7386)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
c07a514730
commit
abe5450526
26 changed files with 147 additions and 166 deletions
|
@ -85,13 +85,15 @@ export async function cliDocsVersionCommand(
|
|||
|
||||
await Promise.all(
|
||||
i18n.locales.map(async (locale) => {
|
||||
// TODO duplicated logic from core, so duplicate comment as well: we need
|
||||
// to support customization per-locale in the future
|
||||
const localizationDir = path.resolve(siteDir, i18n.path, locale);
|
||||
// Copy docs files.
|
||||
const docsDir =
|
||||
locale === i18n.defaultLocale
|
||||
? path.resolve(siteDir, docsPath)
|
||||
: getDocsDirPathLocalized({
|
||||
siteDir,
|
||||
locale,
|
||||
localizationDir,
|
||||
pluginId,
|
||||
versionName: CURRENT_VERSION_NAME,
|
||||
});
|
||||
|
@ -114,8 +116,7 @@ export async function cliDocsVersionCommand(
|
|||
locale === i18n.defaultLocale
|
||||
? getVersionDocsDirPath(siteDir, pluginId, version)
|
||||
: getDocsDirPathLocalized({
|
||||
siteDir,
|
||||
locale,
|
||||
localizationDir,
|
||||
pluginId,
|
||||
versionName: version,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue