From 7a16b3e26d28acd3c62a2e62d5d71ade4315b743 Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 19 Aug 2019 11:33:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E9=9C=80=E8=A6=81=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/transform-i18n/transform-i18n-unicode.js | 21 -------------------- package.json | 1 - 2 files changed, 22 deletions(-) delete mode 100644 lib/transform-i18n/transform-i18n-unicode.js diff --git a/lib/transform-i18n/transform-i18n-unicode.js b/lib/transform-i18n/transform-i18n-unicode.js deleted file mode 100644 index 998ad3d..0000000 --- a/lib/transform-i18n/transform-i18n-unicode.js +++ /dev/null @@ -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}`); diff --git a/package.json b/package.json index c5b870b..3c1bd3b 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,6 @@ "eslint-fix": "eslint './*.js' './**/*.js' './**/*.ts' --fix", "const": "javac -encoding UTF-8 -d constants/classes constants/*.java && java -cp constants/classes FRConstantsWriter", "i18n": "node ./lib/transform-i18n/transform-i18n.js", - "unicode": "node ./lib/transform-i18n/transform-i18n-unicode.js", "test": "jest --passWithNoTests", "upgrade": "node lib/upgrade" },