optionally list missing translations with verify.js
This commit is contained in:
parent
566d0aa2bf
commit
50c59889b0
@ -1,5 +1,7 @@
|
||||
import locales from './index.js';
|
||||
|
||||
const showUntranslated = process.argv[2] == '-v';
|
||||
|
||||
let valid = true;
|
||||
|
||||
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 });
|
||||
}
|
||||
}
|
||||
|
||||
if (showUntranslated && actual[key] == expected[key]) {
|
||||
writeError('untranslated', lang, trace ? `${trace}.${key}` : key, { original: expected[key] });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user