You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2021/02/17 12:53:09 UTC
[echarts-bot] branch master updated: fix(translator): use
`franc-min` instead of `franc` for more accurate detection.
This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-bot.git
The following commit(s) were added to refs/heads/master by this push:
new fc0427a fix(translator): use `franc-min` instead of `franc` for more accurate detection.
fc0427a is described below
commit fc0427ad010a9bf504585ce9a3bf509588428735
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Wed Feb 17 20:52:50 2021 +0800
fix(translator): use `franc-min` instead of `franc` for more accurate detection.
---
package-lock.json | 6 +++---
package.json | 2 +-
src/translator.js | 2 +-
test/translator.test.js | 7 +++++++
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 90ff8d2..f90c55c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3786,10 +3786,10 @@
"map-cache": "^0.2.2"
}
},
- "franc": {
+ "franc-min": {
"version": "5.0.0",
- "resolved": "https://registry.npmjs.org/franc/-/franc-5.0.0.tgz",
- "integrity": "sha512-ioKMLQlZv0T4qQ/AivMt8y8i4M3RWvVeOAm8y8SAjfcN+shtHVqR7NKAQAfQcrxWIbmfne4pRTcgNBcM0bj60A==",
+ "resolved": "https://registry.npmjs.org/franc-min/-/franc-min-5.0.0.tgz",
+ "integrity": "sha512-xy7Iq7uNflbvNU+bkyYWtP+BOHWZle7kT9GM84gEV14b7/7sgq7M7Flf6v1XRflHAuHoshBMveWA6Q+kEXYeHQ==",
"requires": {
"trigram-utils": "^1.0.0"
}
diff --git a/package.json b/package.json
index 25c3020..f2f3b41 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
},
"dependencies": {
"@vitalets/google-translate-api": "^5.0.0",
- "franc": "^5.0.0",
+ "franc-min": "^5.0.0",
"probot": "^11.0.6"
},
"devDependencies": {
diff --git a/src/translator.js b/src/translator.js
index 19614b1..1e7e61c 100644
--- a/src/translator.js
+++ b/src/translator.js
@@ -1,5 +1,5 @@
const googleTranslate = require('@vitalets/google-translate-api');
-const franc = require('franc');
+const franc = require('franc-min');
/**
* To translate the raw sentence to English
diff --git a/test/translator.test.js b/test/translator.test.js
index 3e64e0d..45e3a62 100644
--- a/test/translator.test.js
+++ b/test/translator.test.js
@@ -36,6 +36,8 @@ series-line.lineStyle. color 可以是一个函数,能动态修改每一小段
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->`;
+const str3 = `Export types for formatter callback params`;
+
describe('translator and language test', () => {
it('The language should be English', () => {
const c = removeCodeAndComment(str);
@@ -46,4 +48,9 @@ describe('translator and language test', () => {
const c = removeCodeAndComment(str2);
expect(detectEnglish(c)).toEqual(false);
});
+
+ it('The language should be English', () => {
+ const c = removeCodeAndComment(str3);
+ expect(detectEnglish(c)).toEqual(true);
+ });
});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org