const { resolve } = require('path'); const { writeFileSync } = require('fs'); const propertiesReader = require('properties-reader'); let content = ''; const properties = propertiesReader(resolve(__dirname, '../../i18n/zh_cn.properties')); properties.each((key, value) => { content += ` '${key}': '${value}',\n`; }); writeFileSync(resolve(__dirname, '../../private/i18n.ts'), `export default { ${content}}; `);