Open windrunner414 opened 2 weeks ago
Hello windrunner414, Thank you for your first issue contribution 🎉
Just had a look into code. Maybe it doesn't even query the dictionary because word count > 1 https://github.com/tisfeng/Easydict/blob/main/Easydict/objc/Service/Apple/AppleDictionary/EZAppleDictionary.m#L126 https://github.com/tisfeng/Easydict/blob/2d0cf752df5fd3e7f31e5752409c801744d83f2a/Easydict/objc/Utility/EZCategory/NSString/NSString%2BEZUtils.m#L174
It appears Chinese bypasses the word count check in shouldQueryDictionaryWithLanguage
so it works for Chinese. Not sure why Swedish "välkommen" also returns no result, maybe the word count is not accurate for Swedish?
I don't have a dev environment to debug it now, I probably can take a closer look some time later though. It may be better to have a setting allowing it to always query in dictionary?
ok, I'll take a look at it later.
This is a bug.
The Apple dictionary query should not call the queryTypeWithLanguage
method here because this method is incomplete. Initially, I only considered Chinese and English, and it is not suitable for other languages, such as Japanese.
I have removed this check https://github.com/tisfeng/Easydict/pull/681, and the next version will fix it.
Please confirm the following:
Problem description
Apple Dict in Easydict returns no result when the query text contains hiragana/katakana (Japanese) or some Swedish letters (å, ä, ö). I only tested Japanese and Swedish, it's possible that all characters other than Chinese and Latin don't work. For example, はなし: 超級クラウン中日辞典 / クラウン日中辞典 (the built-in one in apple dictionary):
Easydict:
However, 話 will return the correct results
Is the issue consistently reproducible?
Reproducible
Steps to Reproduce
Screenshot
Runtime log(zip file)
Sorry there are too many menu icons on my laptop and the easydict one is not showing up, I'll try to get the log later
Expected result
Easydict shows the correct result as Apple Dictionary does
Proposed solution (optional)
No response
Device type and OS version
Apple M1 Pro, MacOS 14.6.1
Are you willing to submit a PR to fix this issue?