Skip to content
Permalink
Browse files
fix(translator): tweak detectEnglish logic.
  • Loading branch information
plainheart committed Feb 17, 2021
1 parent d3cb45f commit c3f215f3c85193d13c150f9ad305b75f9bb9b35f
Showing 1 changed file with 3 additions and 2 deletions.
@@ -48,8 +48,9 @@ function detectLanguage(text, detectAll) {
*/
function detectEnglish(text) {
const lang = detectLanguage(text, true);
return lang[0][0] === 'eng'
&& (!lang[1] || (lang[1][0] === 'sco' && lang[1][1] > 0.9) || lang[1][1] < 0.9);
return (lang[0][0] === 'eng' && lang[0][1] === 1)
|| (lang[0][0] === 'eng'
&& (!lang[1] || (lang[1][0] === 'sco' && lang[1][1] > 0.9) || lang[1][1] < 0.9));
}

/**

0 comments on commit c3f215f

Please sign in to comment.