fixing terms issue (#507)

* Update translate.js

fixing e.terms console log error

* revert reformats

* revert formating
This commit is contained in:
reza ehsani 2023-09-14 15:34:32 +01:00 committed by GitHub
parent b31d53e539
commit 06678d8c49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,7 +60,7 @@ const sendRequestToGoogle = async (word, sourceLang, targetLang) => {
resultData.resultText = result.data.sentences.map(sentence => sentence.trans).join("");
if (result.data.dict) {
resultData.candidateText = result.data.dict
.map(dict => `${dict.pos}${dict.pos != "" ? ": " : ""}${dict.terms.join(", ")}\n`)
.map(dict => `${dict.pos}${dict.pos != "" ? ": " : ""}${dict.terms !== undefined?dict.terms.join(", "):""}\n`)
.join("");
}