Files: 9660479589cb3e6a2d8fe371854da4ce7a38522b / translations / checker.js
543 bytesRaw
1 | // this is a script to help spot missing translations! |
2 | |
3 | const merge = require('lodash/mergeWith') |
4 | const flat = require('flat') |
5 | |
6 | const en = flat(require('./en')) |
7 | const zh = flat(require('./zh')) |
8 | |
9 | function customizer (objVal, srcVal, key, obj, src, stack) { |
10 | // See docs https://lodash.com/docs/4.17.4#mergeWith |
11 | |
12 | if (objVal == undefined) { // implies zh is missing key |
13 | if (typeof srcVal == 'string') console.log(key, '=', srcVal) |
14 | } |
15 | } |
16 | |
17 | |
18 | merge(zh, en, customizer) |
19 | // signature: obj, src, customizer |
20 | // order matters because of customizer |
21 |
Built with git-ssb-web