From 12a67bdde5a7662dba14892b3c4680a4a8f87395 Mon Sep 17 00:00:00 2001 From: zggsong Date: Mon, 15 Apr 2024 14:30:31 +0800 Subject: [PATCH] fix: ecdict only determines if it is a word --- .../ViewModels/Preference/Services/TranslatorEcdict.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/STranslate/ViewModels/Preference/Services/TranslatorEcdict.cs b/src/STranslate/ViewModels/Preference/Services/TranslatorEcdict.cs index 475d31df..ec7450ad 100644 --- a/src/STranslate/ViewModels/Preference/Services/TranslatorEcdict.cs +++ b/src/STranslate/ViewModels/Preference/Services/TranslatorEcdict.cs @@ -248,12 +248,14 @@ public async Task 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)