git ssb

2+

mixmix / ticktack



Commit 9cfd6e51ee778dc16e35913b12823e4b573afbfb

add translation check

mix irving committed on 8/28/2017, 1:42:43 AM
Parent: ef08c9119e733198510e57b49ae441a7d0c8cae7

Files changed

README.mdchanged
package-lock.jsonchanged
package.jsonchanged
translations/checker.jsadded
README.mdView
@@ -49,4 +49,9 @@
4949 "autoinvite": "128.199.132.182:43750:@7xMrWP8708+LDvaJrRMRQJEixWYp4Oipa9ohqY7+NyQ=.ed25519~YC4ZnjHH8qzsyHe2sihW8WDlhxSUH33IthOi4EsldwQ="
5050 }
5151 ```
5252
53 +### Translations
54 +
55 +Theses are in `/translations`.
56 +There's a helper script in there called `checker.js` which looks for translations in `en` (english) that are missing from `zh` (mandarin).
57 +
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 199182 bytes
New file size: 199493 bytes
package.jsonView
@@ -58,7 +58,8 @@
5858 "suggest-box": "^2.2.3",
5959 "url": "^0.11.0"
6060 },
6161 "devDependencies": {
62- "electron": "~1.6.11"
62 + "electron": "~1.6.11",
63 + "flat": "^4.0.0"
6364 }
6465 }
translations/checker.jsView
@@ -1,0 +1,20 @@
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

Built with git-ssb-web