Skip to content
Permalink
Browse files
fix(translator): use franc-min instead of franc for more accurate…
… detection.
  • Loading branch information
plainheart committed Feb 17, 2021
1 parent c3f215f commit fc0427ad010a9bf504585ce9a3bf509588428735
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.

Some generated files are not rendered by default. Learn more.

@@ -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": {
@@ -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
@@ -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);
});
});

0 comments on commit fc0427a

Please sign in to comment.