Commit 0eea2596 authored by dragondean@qq.com's avatar dragondean@qq.com

完善国际化提取

parent 946b8b13
const fs = require('fs');
const root = "./src"
const savePath = "./i18n-messages.txt"
let allFiles = []
function getFiles(dir){
let files = fs.readdirSync(dir)
files.forEach(file => {
......@@ -14,6 +14,11 @@ function getFiles(dir){
}
getFiles(root)
/* allFiles = [
'src/views/ecw/box/shippingSea/utils.js',
'src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/contentPadProvider.js'
]
console.log(allFiles) */
let messages = new Set()
allFiles.forEach(file => {
let data = fs.readFileSync(file, {encoding: 'utf-8'})
......@@ -25,4 +30,5 @@ allFiles.forEach(file => {
}
})
fs.writeFileSync("./i18n-messages.txt", Array.from(messages).join("\n"))
console.log("done!")
\ No newline at end of file
console.log(messages)
console.warn(`共提取 ${messages.size} 个待翻译内容,保存于${savePath}`)
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment