mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 03:15:12 +00:00
optionally list missing translations with verify.js
This commit is contained in:
parent
566d0aa2bf
commit
50c59889b0
1 changed files with 6 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
||||||
import locales from './index.js';
|
import locales from './index.js';
|
||||||
|
|
||||||
|
const showUntranslated = process.argv[2] == '-v';
|
||||||
|
|
||||||
let valid = true;
|
let valid = true;
|
||||||
|
|
||||||
function writeError(type, lang, tree, data) {
|
function writeError(type, lang, tree, data) {
|
||||||
|
@ -34,6 +36,10 @@ function verify(expected, actual, lang, trace) {
|
||||||
writeError('missing_parameter', lang, trace ? `${trace}.${key}` : key, { parameter });
|
writeError('missing_parameter', lang, trace ? `${trace}.${key}` : key, { parameter });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (showUntranslated && actual[key] == expected[key]) {
|
||||||
|
writeError('untranslated', lang, trace ? `${trace}.${key}` : key, { original: expected[key] });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue