diff --git a/README.md b/README.md index 903e5f7..8274744 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ gulp-reporter [![AppVeyor](https://img.shields.io/appveyor/ci/gucong3000/gulp-reporter.svg?&label=Windows)](https://ci.appveyor.com/project/gucong3000/gulp-reporter) [![Coverage Status](https://img.shields.io/coveralls/gucong3000/gulp-reporter.svg)](https://coveralls.io/r/gucong3000/gulp-reporter) -Error reporter for: +Error report localization for: [EditorConfig](https://github.com/jedmao/eclint) [ESLint](https://github.com/adametry/gulp-eslint) [JSCS](https://github.com/jscs-dev/gulp-jscs) diff --git a/lib/editorconfig_zh_CN.js b/lib/editorconfig_zh_CN.js index a91e387..7736d28 100644 --- a/lib/editorconfig_zh_CN.js +++ b/lib/editorconfig_zh_CN.js @@ -25,7 +25,7 @@ module.exports = function(error) { for (const [en, cn] of messages) { if (en instanceof RegExp) { if (en.test(error.message)) { - error.message = cn.replace(/\$\d+/, key => en[key]); + error.message = error.message.replace(en, cn); return error; } } else if (error.message === en) { diff --git a/package.json b/package.json index 9d64503..c1d4320 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "lodash.get": "^4.4.2", "os-locale": "^2.0.0" }, - "description": "Error reporter for: EditorConfig/ESLint/JSCS/JSHint/CssLint/PostCSS/TSLint", + "description": "Error report localization for: EditorConfig/ESLint/JSCS/JSHint/CssLint/PostCSS/TSLint", "devDependencies": { "cover": "^0.2.9", "coveralls": "^2.12.0", @@ -44,6 +44,8 @@ "keywords": [ "gulp", "reporter", + "report", + "localization", "eslint", "jscs", "jshint", @@ -68,5 +70,5 @@ "pretest": "node-version-gte-4 && eslint lib test/*.test.js || echo \"ESLint not supported\"", "test": "istanbul cover node_modules/mocha/bin/_mocha test/*.test.js" }, - "version": "1.8.0" + "version": "1.8.1" }