mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-14 15:28:08 +02:00
feat: allow customizing localization path of each locale (#7624)
This commit is contained in:
parent
39e3e3715e
commit
1b9bec1042
24 changed files with 254 additions and 30 deletions
|
@ -26,6 +26,7 @@ const DefaultI18N: I18n = {
|
|||
direction: 'ltr',
|
||||
htmlLang: 'en',
|
||||
calendar: 'gregory',
|
||||
path: 'en',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -54,6 +54,7 @@ function getI18n(locale: string): I18n {
|
|||
label: locale,
|
||||
htmlLang: locale,
|
||||
direction: 'ltr',
|
||||
path: locale,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -71,7 +72,11 @@ const getPlugin = async (
|
|||
i18n: I18n = DefaultI18N,
|
||||
) => {
|
||||
const generatedFilesDir: string = path.resolve(siteDir, '.docusaurus');
|
||||
const localizationDir = path.join(siteDir, i18n.path, i18n.currentLocale);
|
||||
const localizationDir = path.join(
|
||||
siteDir,
|
||||
i18n.path,
|
||||
i18n.localeConfigs[i18n.currentLocale]!.path,
|
||||
);
|
||||
const siteConfig = {
|
||||
title: 'Hello',
|
||||
baseUrl: '/',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue