amis-rpc-design/libs/amis/scripts/generate-sdk-locale.js

17 lines
362 B
JavaScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
/**
* 用于生成 sdk 里的多语言目前只有德语
*/
const fs = require('fs');
try {
const localeFile = fs.readFileSync(process.argv[2], 'utf8');
console.log(
localeFile
.replace(`import {register} from '../locale';`, '')
.replace('register(', `amisRequire('amis').registerLocale(`)
);
} catch (err) {
console.error(err);
}