Files
upstream-jitsi-meet/lang/update-translation.js
upstream-mirror 1d2bfcac0c
Some checks failed
Prosody Plugin Tests / test (push) Failing after 10m11s
Close stale issues and PRs / stale (push) Failing after 1s
snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
2026-09-15 15:56:32 +05:00

39 lines
896 B
JavaScript

/* eslint-disable */
const fs = require('fs');
const process = require('process');
const traverse = require('traverse');
const mainLang = require('./main.json');
const [ targetLangFile ] = process.argv.slice(-1);
if (!targetLangFile) {
console.log('No target language file specified');
process.exit(1);
}
const targetLang = require(`./${targetLangFile}`);
const paths = traverse(mainLang).reduce(function(acc, item) {
if (this.isLeaf) {
acc.push(this.path);
}
return acc;
}, []);
const result = {};
for (const path of paths) {
if (traverse(targetLang).has(path)) {
traverse(result).set(path, traverse(targetLang).get(path));
} else {
//console.log(`${path.join('.')} is missing`);
traverse(result).set(path, '');
}
}
const data = JSON.stringify(result, undefined, 4);
fs.writeFileSync(`./${targetLangFile}`, data + "\n");