Update write-translations.js to find versioned sidebar category names

This commit is contained in:
Frank Li 2017-08-04 10:44:54 -07:00
parent 1517b155b7
commit 9eb6ff2034

View file

@ -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 => {