alan
5 years ago
2 changed files with 0 additions and 22 deletions
@ -1,21 +0,0 @@
|
||||
const { resolve } = require('path'); |
||||
const { writeFileSync } = require('fs'); |
||||
const propertiesReader = require('properties-reader'); |
||||
|
||||
let content = ''; |
||||
|
||||
const properties = propertiesReader(resolve(__dirname, '../../i18n/zh_cn.properties')); |
||||
function toUnicodeFun(data) { |
||||
if (data === '' || typeof data === 'undefined') return ''; |
||||
let str = ''; |
||||
for (let i = 0; i < data.length; i++) { |
||||
str += `\\u${data.charCodeAt(i).toString(16)}`; |
||||
} |
||||
|
||||
return str; |
||||
} |
||||
properties.each((key, value) => { |
||||
content += `${key}= ${toUnicodeFun(value)}\n`; |
||||
}); |
||||
|
||||
writeFileSync(resolve(__dirname, '../../i18n/zh_cn_unicode.properties'), `${content}`); |
Loading…
Reference in new issue