tisfeng / Easydict

ไธ€ไธช็ฎ€ๆดไผ˜้›…็š„่ฏๅ…ธ็ฟป่ฏ‘ macOS Appใ€‚ๅผ€็ฎฑๅณ็”จ๏ผŒๆ”ฏๆŒ็ฆป็บฟ OCR ่ฏ†ๅˆซ๏ผŒๆ”ฏๆŒๆœ‰้“่ฏๅ…ธ๏ผŒ๐ŸŽ ่‹นๆžœ็ณป็ปŸ่ฏๅ…ธ๏ผŒ๐ŸŽ ่‹นๆžœ็ณป็ปŸ็ฟป่ฏ‘๏ผŒOpenAI๏ผŒGemini๏ผŒDeepL๏ผŒGoogle๏ผŒBing๏ผŒ่…พ่ฎฏ๏ผŒ็™พๅบฆ๏ผŒ้˜ฟ้‡Œ๏ผŒๅฐ็‰›๏ผŒๅฝฉไบ‘ๅ’Œ็ซๅฑฑ็ฟป่ฏ‘ใ€‚A concise and elegant Dictionary and Translator macOS App for looking up words and translating text.
GNU General Public License v3.0
7.04k stars 356 forks source link

๐Ÿš€ Feature Request: Transcriptions for non-Latin script languages #458

Open thesla13 opened 6 months ago

thesla13 commented 6 months ago

Please confirm the following:

Feature description

Hey, Tisfeng!

I have been using Easydict to dabble in Chinese and Japanese. And find it super useful when Easydict not only does OCR and provides text-to-speach and translation, but also shows transcription for the characters of these languages.

However. (And the following concerns mostly Google and Bing services, as Youdao only shows Pinyin readings for two-character Chinese words, and others do not seem to provide any transcriptions at all.) However โ€” the problem is there is a strict limit on how long a query would be provided with a transcription. I've experimented a bit, and as of now it seems to work as follows:

Japanese: Google doesn't give transcriptions at all. Bing does, but for queries of up to 7 characters long. 8-char long phrase would be shown without a reading.

Chinese: Google works for up to 4 characters. 5 and more โ€” no Pinyin. Bing, again, up to 7. 8 and more โ€” no such luck.

Use case

I do understand that providing transcriptions for long passages within Easydict's window would clutter the interface considerably. But still, 15- or 20-char phrases โ€” do seem adequate to me. And at least having an option in settings to enable it would be super-super useful to me. And, again, as it works now โ€” seems to be highly illogical: 4-char limit here, 7-char there (and 7 seems to be especially weird for Chinese with two-character words and 4- and 8-character names for things and concepts).

Please, pretty please, do consider looking into this.

Thank you so very much for your wonderful app and your hard work!

ja 2a ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ ja 3a ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ ja 1a ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ zh 1a ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ zh 2a ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ zh 3a ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ๐ŸŸจ zh 4a

tisfeng commented 6 months ago

OK, I'll take a closer look later.

tisfeng commented 5 months ago

Thanks for the feedback, we've checked it out and realized that there is indeed some rather confusing logic here, so let me explain.

Youdao

Youdao's web interface for dictionaries is a bit tricky to parse, and it works best with English and Chinese dictionaries, so we mainly use this API. For Chinese, it seems to only support pinyin display for Chinese characters of 1-2 characters, and won't display any longer than that.

Google

Due to historical reasons, we have two API for Google Translate, they are used in different scenarios, because one of them is good at looking up dictionaries, and the other is good at translating long texts.

So, for very short Chinese words, length <= 4, which is the length of common Chinese idioms, we will call the dictionary API, which has phonetic symbols, while the long text translation API itself has no phonetic symbols.

This is really not good, we will improve the Google Translate API later, for example, we will try to use the official web interface, and try our best to show the phonetic symbols of long text if it has.

Bing

Bing is the only one that we actively limit the length of phonetic symbols displayed, because its translation API will return very long text length phonetic symbols, if we don't limit it, it will lead to a very ugly UI, the phonetic symbols display control is only one line, and the window width is limited.

Here the limit is 7, because it is the length of an ancient Chinese poem, for example [ๆ›พๆฒงๆตท้šพไธบๆฐด].

tisfeng commented 5 months ago

We will improve the display length of the phonetic symbols later, for now please click on the link button to go to the web page to see the phonetic symbols for long text.

image