mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-31 23:54:25 +00:00
Update write-translations.js to find versioned sidebar category names
This commit is contained in:
parent
1517b155b7
commit
9eb6ff2034
|
|
@ -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…
Reference in New Issue