From 06678d8c49604f0059b53baf2cbb394e3c40862f Mon Sep 17 00:00:00 2001 From: reza ehsani Date: Thu, 14 Sep 2023 15:34:32 +0100 Subject: [PATCH] fixing terms issue (#507) * Update translate.js fixing e.terms console log error * revert reformats * revert formating --- src/common/translate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/translate.js b/src/common/translate.js index 5286f11..de8ac5b 100644 --- a/src/common/translate.js +++ b/src/common/translate.js @@ -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(""); }