mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-19 17:49:19 +02:00
Attempt to fix translation content conflict
This commit is contained in:
parent
dacfc17fb4
commit
7f05848713
8 changed files with 61 additions and 10 deletions
|
@ -48,8 +48,8 @@ function getSidebarTranslationFileContent(
|
|||
|
||||
const categories = collectSidebarCategories(sidebar);
|
||||
|
||||
const categoryContent: TranslationFileContent = Object.fromEntries(
|
||||
categories.flatMap((category) => {
|
||||
const categoryEntries: TranslationMessageEntry[] = categories.flatMap(
|
||||
(category) => {
|
||||
const entries: TranslationMessageEntry[] = [];
|
||||
|
||||
entries.push([
|
||||
|
@ -82,9 +82,21 @@ function getSidebarTranslationFileContent(
|
|||
}
|
||||
|
||||
return entries;
|
||||
}),
|
||||
},
|
||||
);
|
||||
|
||||
_.chain(categoryEntries)
|
||||
.groupBy((entry) => entry[0])
|
||||
.forEach((group, key) => {
|
||||
if (group.length > 1) {
|
||||
console.warn(`KEY CONFLICT FOR key = ${key}`, group.length);
|
||||
}
|
||||
})
|
||||
.value();
|
||||
|
||||
const categoryContent: TranslationFileContent =
|
||||
Object.fromEntries(categoryEntries);
|
||||
|
||||
const links = collectSidebarLinks(sidebar);
|
||||
const linksContent: TranslationFileContent = Object.fromEntries(
|
||||
links.map((link) => [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue