| 2 | const locale = require('../app/locale/locale') |
| 3 | |
| 4 | function checkLang (lang) { |
| 5 | if (lang === 'en') { |
| 6 | return |
| 7 | } |
| 8 | const language = require(`../app/locale/${lang}.js`).translation |
| 9 | Object.keys(en).forEach(key => { |
| 10 | if (!language[key]) { |
| 11 | // console.log(`Missing key: ${key}`) |
| 12 | return |
| 13 | } |
| 14 | Object.keys(en[key]).forEach(subKey => { |
| 15 | if (!language[key][subKey]) { |
| 16 | // console.log(`Missing key: ${key}.${subKey}`) |
| 17 | return |
| 18 | } |
| 19 | const enLength = en[key][subKey].length |
| 20 | const langLength = language[key][subKey].replace('[AI_TRANSLATION]', '').length |
| 21 | if (langLength - enLength > 20 && langLength > enLength * 2) { |
| 22 | console.log(`${lang} Too long: ${key}.${subKey} - ${langLength} vs ${enLength}`) |
| 23 | } |
| 24 | }) |
| 25 | }) |
| 26 | } |
| 27 | |
| 28 | function main () { |
| 29 | Object.keys(locale).forEach(lang => { |