Files
inji-wallet/scripts/compile-strings.js
Paolo Miguel de Leon 5355ba0a35 feat: add localization
2022-04-25 15:38:58 +08:00

14 lines
361 B
JavaScript

const fs = require('fs');
const glob = require('glob');
glob('**/*.strings.json', (_err, paths) => {
const strings = {};
paths.forEach((path) => {
const key = path.match(/(?<ns>[^/]+)\.strings\.json$/).groups.ns;
strings[key] = JSON.parse(fs.readFileSync(path));
});
fs.writeFileSync(`locales/en.json`, JSON.stringify(strings, null, 2));
});