Skip to content

Commit

Permalink
fix: ecdict only determines if it is a word
Browse files Browse the repository at this point in the history
  • Loading branch information
ZGGSONG committed Apr 15, 2024
1 parent acb838b commit 12a67bd
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,14 @@ public async Task<TranslationResult> TranslateAsync(object request, Cancellation
var content = req.Text;

var isWord = StringUtil.IsWord(content);

//是否为自动转到中/英文
var isAutoToZhOrEn = source == LangEnum.auto && (target == LangEnum.zh_cn || target == LangEnum.zh_tw || target == LangEnum.yue || target == LangEnum.en);
if (!(isWord && isAutoToZhOrEn))
if (!isWord)
goto Empty;

//是否为自动转到中/英文??为了干嘛的?忘了
//var isAutoToZhOrEn = source == LangEnum.auto && (target == LangEnum.zh_cn || target == LangEnum.zh_tw || target == LangEnum.yue || target == LangEnum.en);
//if (!(isWord && isAutoToZhOrEn))
// goto Empty;

var result = await EcdictHelper.GetECDICTAsync(content, token);

if (result is null)
Expand Down

0 comments on commit 12a67bd

Please sign in to comment.