mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-18 18:52:23 +02:00
refactor(core): reorganize files (#7042)
* refactor(core): reorganize files * fix types
This commit is contained in:
parent
85a79fd9b9
commit
5fb09a2946
61 changed files with 1089 additions and 1028 deletions
|
@ -22,7 +22,6 @@ import {
|
|||
import type {
|
||||
TranslationFileContent,
|
||||
TranslationFile,
|
||||
TranslationFiles,
|
||||
TranslationMessage,
|
||||
} from '@docusaurus/types';
|
||||
import {mergeTranslations} from '@docusaurus/utils';
|
||||
|
@ -242,7 +241,7 @@ function translateSidebars(
|
|||
);
|
||||
}
|
||||
|
||||
function getVersionTranslationFiles(version: LoadedVersion): TranslationFiles {
|
||||
function getVersionTranslationFiles(version: LoadedVersion): TranslationFile[] {
|
||||
const versionTranslations: TranslationFileContent = {
|
||||
'version.label': {
|
||||
message: version.label,
|
||||
|
@ -283,7 +282,7 @@ function translateVersion(
|
|||
|
||||
function getVersionsTranslationFiles(
|
||||
versions: LoadedVersion[],
|
||||
): TranslationFiles {
|
||||
): TranslationFile[] {
|
||||
return versions.flatMap(getVersionTranslationFiles);
|
||||
}
|
||||
function translateVersions(
|
||||
|
@ -295,7 +294,7 @@ function translateVersions(
|
|||
|
||||
export function getLoadedContentTranslationFiles(
|
||||
loadedContent: LoadedContent,
|
||||
): TranslationFiles {
|
||||
): TranslationFile[] {
|
||||
return getVersionsTranslationFiles(loadedContent.loadedVersions);
|
||||
}
|
||||
export function translateLoadedContent(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue