Closed ttrasn closed 1 year ago
Thanks for the PR! It seems that many unnecessary differences are being generated. Could you please correct them to the minimum difference?
sure @sienori , I'll update it now
Hi @sienori , please check it
Thanks for the PR!
It would be nice if we don't just check for undefined
. if for whatever reason the e.terms
has falsy values then return an empty string.
e.terms ? e.terms.join(', ') : ''
or it would be better if we don't set resultData.candidateText
at all if there is no terms
/entry
:
if (result.data.dict) {
const dict = result.data.dict.terms || result.data.dict.entry
resultData.candidateText = dict ? getCandidateText(dict) : ""
}
Obviously getCandidateText
is not implemented and this is just my idea. I think we have to check both terms
/entry
in getCandidateText(dict)
for some backward compatibility.
I believe checking for undefined
is enough. for other possible values the old code should work fine.
Thanks!
fix issue : https://github.com/sienori/simple-translate/issues/505 and https://github.com/sienori/simple-translate/issues/506