Browse Source
Merge in VISUAL/fineui from ~TREECAT/fineui:es6 to es6 * commit 'cbf09bbf32129099f33e407a6c907a88cf7e239a': 无jira fix: 国际化es6
treecat-罗群
2 years ago
5 changed files with 28 additions and 5 deletions
@ -0,0 +1,23 @@
|
||||
const { tranvase } = require("./lib/utils"); |
||||
const fs = require("fs"); |
||||
|
||||
const config = { |
||||
handler: filePath => { |
||||
if (filePath.includes("test") || filePath.includes("dist")) { |
||||
return; |
||||
} |
||||
let content = fs.readFileSync(filePath).toString(); |
||||
let reg = /(['"`])(.*?)\1/g; |
||||
if (reg.test(content)) { |
||||
Array.from(content.matchAll(reg)) |
||||
.map(el => el[2]) |
||||
.forEach(el => { |
||||
if (Array.from(el).some(el => el.charCodeAt(0) > 255)) { |
||||
console.log(filePath, el); |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
}; |
||||
|
||||
tranvase(process.argv[2], config); |
Loading…
Reference in new issue