Add check of valid translations jsons to GA

This commit is contained in:
Kalle
2022-10-29 00:33:07 +03:00
parent 4eb0775532
commit b775d70985
3 changed files with 16 additions and 7 deletions

View File

@@ -1,8 +1,10 @@
// 1) create status.json
import fs from "fs";
import path from "path";
const NO_WRITE_KEY = "--no-write";
const dontWrite = process.argv.includes(NO_WRITE_KEY);
const otherLanguageTranslationPath = (code?: string, fileName?: string) =>
path.join(
...[__dirname, "..", "public", "locales", code, fileName].filter(
@@ -83,13 +85,17 @@ const markdown = createTranslationProgessMarkdown({
totalTranslationCounts,
});
fs.writeFileSync(
path.join(__dirname, "..", "translation-progress.md"),
markdown
);
if (!dontWrite) {
fs.writeFileSync(
path.join(__dirname, "..", "translation-progress.md"),
markdown
);
}
// eslint-disable-next-line no-console
console.log("translation-progress.md written");
console.log(
dontWrite ? "translation-progress.md ok" : "translation-progress.md written"
);
function validateNoExtraKeysInOther({
english,