mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-22 19:17:46 +02:00
wire to the config attribute
This commit is contained in:
parent
98469e1099
commit
650f51662a
8 changed files with 24 additions and 13 deletions
|
@ -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 =
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue