mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
Add check of valid translations jsons to GA
This commit is contained in:
parent
4eb0775532
commit
b775d70985
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
|
@ -34,3 +34,5 @@ jobs:
|
|||
run: npm run lint:styles
|
||||
- name: Typecheck
|
||||
run: npm run typecheck
|
||||
- name: Check translations jsons
|
||||
run: npm run check-translation-jsons:no-write
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
"create-misc-json": "node --experimental-specifier-resolution=node --loader ts-node/esm -r tsconfig-paths/register scripts/create-misc-json.ts",
|
||||
"create-analyzer-json": "node --experimental-specifier-resolution=node --loader ts-node/esm -r tsconfig-paths/register scripts/create-analyzer-json.ts",
|
||||
"check-translation-jsons": "node --experimental-specifier-resolution=node --loader ts-node/esm -r tsconfig-paths/register scripts/check-translation-jsons.ts && npm run prettier:write-translation-progress",
|
||||
"check-translation-jsons:no-write": "node --experimental-specifier-resolution=node --loader ts-node/esm -r tsconfig-paths/register scripts/check-translation-jsons.ts --no-write",
|
||||
"replace-img-names": "node --experimental-specifier-resolution=node --loader ts-node/esm -r tsconfig-paths/register scripts/replace-img-names.ts",
|
||||
"remove-bad-custom-urls": "node --experimental-specifier-resolution=node --loader ts-node/esm -r tsconfig-paths/register scripts/remove-bad-custom-urls.ts",
|
||||
"lint:ts": "eslint . --ext .ts,.tsx",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user