Browse Source

fix: 不需要了

qufenxi
alan 5 years ago
parent
commit
7a16b3e26d
  1. 21
      lib/transform-i18n/transform-i18n-unicode.js
  2. 1
      package.json

21
lib/transform-i18n/transform-i18n-unicode.js

@ -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}`);

1
package.json

@ -70,7 +70,6 @@
"eslint-fix": "eslint './*.js' './**/*.js' './**/*.ts' --fix", "eslint-fix": "eslint './*.js' './**/*.js' './**/*.ts' --fix",
"const": "javac -encoding UTF-8 -d constants/classes constants/*.java && java -cp constants/classes FRConstantsWriter", "const": "javac -encoding UTF-8 -d constants/classes constants/*.java && java -cp constants/classes FRConstantsWriter",
"i18n": "node ./lib/transform-i18n/transform-i18n.js", "i18n": "node ./lib/transform-i18n/transform-i18n.js",
"unicode": "node ./lib/transform-i18n/transform-i18n-unicode.js",
"test": "jest --passWithNoTests", "test": "jest --passWithNoTests",
"upgrade": "node lib/upgrade" "upgrade": "node lib/upgrade"
}, },

Loading…
Cancel
Save