Skip to content

Commit

Permalink
release: 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
plainheart committed Mar 16, 2021
1 parent 24c679d commit a7c33f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bing-translate-api",
"version": "1.1.0",
"version": "1.1.1",
"description": "A simple and free API for Bing Translator for Node.js",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async function translate(text, from, to, correct, raw, tld, userAgent) {
const correctLang = detectedLang.language
const matcher = text.match(/"/g)
const len = text.length + (matcher && matcher.length || 0)
// currently there is a limit of 50 chars for correction service
// currently, there is a limit of 50 characters for correction service
// and only parts of languages are supported
// otherwise, it will return status code 400
if (len <= MAX_CORRECT_TEXT_LEN && lang.canCorrect(correctLang)) {
Expand All @@ -148,7 +148,7 @@ async function translate(text, from, to, correct, raw, tld, userAgent) {
res.correctedText = body && body.correctedText
}
else {
console.warn(`The detected language '${correctLang}' is not supported to correct or the length of text is more than ${MAX_CORRECT_TEXT_LEN}.`)
console.warn(`The detected language '${correctLang}' is not supported to be corrected or the length of text is more than ${MAX_CORRECT_TEXT_LEN}.`)
}
}

Expand Down

0 comments on commit a7c33f1

Please sign in to comment.