mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
Update write-translations.js to find versioned sidebar category names
This commit is contained in:
parent
1517b155b7
commit
9eb6ff2034
1 changed files with 14 additions and 0 deletions
|
@ -74,6 +74,20 @@ function execute() {
|
|||
});
|
||||
});
|
||||
|
||||
files = glob.sync(CWD + "/versioned_sidebars/*");
|
||||
files.forEach(file => {
|
||||
if (!file.endsWith("-sidebar.json")) {
|
||||
return;
|
||||
}
|
||||
sidebarContent = JSON.parse(fs.readFileSync(file, "utf8"));
|
||||
Object.keys(sidebarContent).forEach(sb => {
|
||||
const categories = sidebarContent[sb];
|
||||
Object.keys(categories).forEach(category => {
|
||||
translations["localized-strings"][category] = category;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/* go through pages to look for text inside translate tags */
|
||||
files = glob.sync(CWD + "/pages/en/**");
|
||||
files.forEach(file => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue