12345678910111213141516171819202122232425 |
- const http = require('http');
- const fs = require('fs');
- function checkIfPhishing(urlToPrint, path, lang = 'zh') {
- fs.mkdirSync(path, { recursive: true });
- const file = fs.createWriteStream(`${path}/${lang}.json`);
- const request = http.get(urlToPrint, function (response) {
- response.pipe(file).on('finish', function () {
- console.log(`lang: ${lang} get translate in ${path} Done!`);
- // console.log(fs.readFileSync(`${lang}.json`, { encoding: "utf8" }));
- });
- });
- }
- // editor zh
- checkIfPhishing(
- 'http://192.168.0.163:8080/download/daikan/frontend/zh_Hans/',
- 'src/locales/lang/webslate',
- 'zh',
- );
- // editor en
- checkIfPhishing(
- 'http://192.168.0.163:8080/download/daikan/frontend/en/',
- 'src/locales/lang/webslate',
- 'en',
- );
|