wire to the config attribute

This commit is contained in:
sebastien 2025-07-04 13:13:23 +02:00
parent 98469e1099
commit 650f51662a
8 changed files with 24 additions and 13 deletions

View file

@ -8,7 +8,7 @@
import fs from 'fs-extra';
import path from 'path';
import logger from '@docusaurus/logger';
import {DEFAULT_PLUGIN_ID} from '@docusaurus/utils';
import {DEFAULT_PLUGIN_ID, getCurrentLocaleConfig} from '@docusaurus/utils';
import {
getVersionsFilePath,
getVersionDocsDirPath,
@ -89,7 +89,7 @@ async function cliDocsVersionCommand(
const localizationDir = path.resolve(
siteDir,
i18n.path,
i18n.localeConfigs[locale]!.path,
getCurrentLocaleConfig(i18n).path,
);
// Copy docs files.
const docsDir =

View file

@ -7,7 +7,11 @@
import path from 'path';
import fs from 'fs-extra';
import {getPluginI18nPath, DEFAULT_PLUGIN_ID} from '@docusaurus/utils';
import {
getPluginI18nPath,
DEFAULT_PLUGIN_ID,
getCurrentLocaleConfig,
} from '@docusaurus/utils';
import {
VERSIONS_JSON_FILE,
VERSIONED_DOCS_DIR,
@ -187,7 +191,7 @@ export async function getVersionMetadataPaths({
> {
const isCurrent = versionName === CURRENT_VERSION_NAME;
const shouldTranslate = false; // TODO wire this properly
const shouldTranslate = getCurrentLocaleConfig(context.i18n).translate;
const contentPathLocalized = shouldTranslate
? getDocsDirPathLocalized({
localizationDir: context.localizationDir,