uptime-kuma/extra/remove-empty-lang-keys.js
Louis Lam 7a82ae039c
Fix weblate conflict and new translations (#5232)
Co-authored-by: Jochem Pluim <[email protected]>
Co-authored-by: Zandor Smith <[email protected]>
Co-authored-by: Anonymous <[email protected]>
Co-authored-by: Ryo Hanafusa <[email protected]>
Co-authored-by: Eduard Dev <[email protected]>
Co-authored-by: Gunnar Norin <[email protected]>
Co-authored-by: AmadeusGraves <[email protected]>
Co-authored-by: Dan Misener <[email protected]>
Co-authored-by: Алексей Добрый <[email protected]>
Co-authored-by: Ilkka Myller <[email protected]>
Co-authored-by: Nelson Chan <[email protected]>
Co-authored-by: Lance <[email protected]>
Co-authored-by: Peter Dave Hello <[email protected]>
Co-authored-by: PhongPham <[email protected]>
2024-10-23 08:36:22 +08:00

26 lines
557 B
JavaScript

// For #5231
const fs = require("fs");
let path = "../src/lang";
// list directories in the lang directory
let jsonFileList = fs.readdirSync(path);
for (let jsonFile of jsonFileList) {
if (!jsonFile.endsWith(".json")) {
continue;
}
let jsonPath = path + "/" + jsonFile;
let langData = JSON.parse(fs.readFileSync(jsonPath, "utf8"));
for (let key in langData) {
if (langData[key] === "") {
delete langData[key];
}
}
fs.writeFileSync(jsonPath, JSON.stringify(langData, null, 4) + "\n");
}