Trim translation source text
This commit is contained in:
parent
85ed092113
commit
3dcc2229a5
|
@ -11,6 +11,8 @@ class Translate {
|
||||||
}
|
}
|
||||||
|
|
||||||
async translate(sourceWord, sourceLang = "auto", targetLang) {
|
async translate(sourceWord, sourceLang = "auto", targetLang) {
|
||||||
|
sourceWord = sourceWord.trim();
|
||||||
|
|
||||||
const result = await this.sendRequest(sourceWord, sourceLang, targetLang);
|
const result = await this.sendRequest(sourceWord, sourceLang, targetLang);
|
||||||
return this.formatResult(result);
|
return this.formatResult(result);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue