Files
nebula.js/tools/verify-translations.cjs
Tobias Åström 32d600e88b chore: convert rendering tests to es6 (#1658)
* chore: convert rendering tests to es6

* chore: fix cjs config usage

* chore: fix cjs config usage

* chore: fix verify translations

* chore: babel and jest es6

* chore: aw cjs

* chore: aw cjs

* chore: aw cjs

* chore: fix path
2024-12-30 14:40:28 +01:00

33 lines
717 B
JavaScript

const vars = require('../apis/locale/all');
const languages = [
'en-US',
'it-IT',
'zh-CN',
'zh-TW',
'ko-KR',
'de-DE',
'sv-SE',
'es-ES',
'pt-BR',
'ja-JP',
'fr-FR',
'nl-NL',
'tr-TR',
'pl-PL',
'ru-RU',
];
Object.keys(vars).forEach((key) => {
const supportLanguagesForString = Object.keys(vars[key].locale);
if (supportLanguagesForString.indexOf('en-US') === -1) {
// en-US must exist
throw new Error(`String '${vars[key].id}' is missing value for 'en-US'`);
}
for (let i = 0; i < languages.length; i++) {
if (supportLanguagesForString.indexOf(languages[i]) === -1) {
console.warn(`String '${vars[key].id}' is missing value for '${languages[i]}'`);
}
}
});