mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-01 10:22:30 +02:00
chore: upgrade Prettier + regenerate lock file (#5611)
* Bump deps * Run prettier * Format docs * Minor refactor * Collapse objects * Fix type * Update lock file
This commit is contained in:
parent
4dbc458a22
commit
3f1f8255a2
70 changed files with 1534 additions and 1517 deletions
|
@ -131,29 +131,25 @@ function translateSidebar({
|
|||
sidebarName: string;
|
||||
sidebarsTranslations: TranslationFileContent;
|
||||
}): Sidebar {
|
||||
return transformSidebarItems(
|
||||
sidebar,
|
||||
(item: SidebarItem): SidebarItem => {
|
||||
if (item.type === 'category') {
|
||||
return {
|
||||
...item,
|
||||
label:
|
||||
sidebarsTranslations[
|
||||
`sidebar.${sidebarName}.category.${item.label}`
|
||||
]?.message ?? item.label,
|
||||
};
|
||||
}
|
||||
if (item.type === 'link') {
|
||||
return {
|
||||
...item,
|
||||
label:
|
||||
sidebarsTranslations[`sidebar.${sidebarName}.link.${item.label}`]
|
||||
?.message ?? item.label,
|
||||
};
|
||||
}
|
||||
return item;
|
||||
},
|
||||
);
|
||||
return transformSidebarItems(sidebar, (item: SidebarItem): SidebarItem => {
|
||||
if (item.type === 'category') {
|
||||
return {
|
||||
...item,
|
||||
label:
|
||||
sidebarsTranslations[`sidebar.${sidebarName}.category.${item.label}`]
|
||||
?.message ?? item.label,
|
||||
};
|
||||
}
|
||||
if (item.type === 'link') {
|
||||
return {
|
||||
...item,
|
||||
label:
|
||||
sidebarsTranslations[`sidebar.${sidebarName}.link.${item.label}`]
|
||||
?.message ?? item.label,
|
||||
};
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
function getSidebarsTranslations(
|
||||
|
@ -193,9 +189,8 @@ function getVersionTranslationFiles(version: LoadedVersion): TranslationFiles {
|
|||
},
|
||||
};
|
||||
|
||||
const sidebarsTranslations: TranslationFileContent = getSidebarsTranslations(
|
||||
version,
|
||||
);
|
||||
const sidebarsTranslations: TranslationFileContent =
|
||||
getSidebarsTranslations(version);
|
||||
|
||||
// const docsTranslations: TranslationFileContent = getDocsTranslations(version);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue