naraesk / krunner-translator

KRunner Translator (Plasma 5)
https://store.kde.org/p/1081236/
GNU General Public License v3.0
86 stars 14 forks source link

Translation not working when target language is also a source language #5

Closed simgunz closed 6 years ago

simgunz commented 6 years ago

Default source language: English Alternative source language: German

de home / Translated to home en blau / Translate to blau

The examples you provide do not work as expected. Indeed they are not translated at all. Many other words have the same problem.

This is not always the case though.

da street / Translated to gade

Any idea why does this happen for many words?

I am using Yandex.

naraesk commented 6 years ago

Thangs for reporting this issue. It appears that the original word is always displayed as translation. This is a bug. However, translation still works. With your settings and "en blau" I get 3 additional results: blue, drunk, and azure

simgunz commented 6 years ago

With "en blau" now I get blue, but I do not get the other two results. Please see issue #6, maybe when you tested it the settings were not actually applied. I get more results if also globse is active.

In my first report I said that "da street" works, but it should be "de street" and the result is "street", which is wrong. (da is Danish, so there is no ambiguity).

naraesk commented 6 years ago

You are right about the settings. But yandex returns street as translation for en-de street and home for en-de home. Yes, that's wrong but you will have to report it at yandex.

Krunner translator invokes this URL: translate.yandex.net/api/v1.5/tr.json/translate?key=APIKEY&text=street&lang=en-de

Just replace APIKEY with your API key ("trnsl...."). Return code 200 means that the translation was successful. If your API key is wrong or you choose an unsupported language, you get different return codes: https://tech.yandex.com/translate/doc/dg/reference/translate-docpage/#codes

When using different languages than de, such as fr or es it works fine.

Just noticed the the web frontend of yandex translates street (english) with street (german) as well: https://translate.yandex.com/?lang=en-de&text=street

simgunz commented 6 years ago

Yes indeed there are some translation errors. Maybe you can change the example for home in the documentation, given that it is an unlucky case, and close the issue.

naraesk commented 6 years ago

Done