crow-translate / QOnlineTranslator

A library for Qt5 that provides free usage of Google, Yandex and Bing translate API.
GNU General Public License v3.0
79 stars 12 forks source link

Wrong language for Lingva #34

Closed bigshans closed 2 years ago

bigshans commented 2 years ago

The problem I found when I was using lingva to translate Chinese.

When I use crow translate, I always get the error Error transferring https://lingva.ml/api/v1/auto/zh-CN/hello - server replied: Bad Request . So I checked the source code and found that you use google's language code for lingva. But in Chinese, they are different. I'm not sure if there are more differences, so I hope you can review it.

For lingva: "zh": "Chinese", "zh_HANT": "Chinese (Traditional)", For google: zh-CN: Chinese, zh-TW: Chinese

This is language code for lingva.

https://github.com/TheDavidDelta/lingva-translate/blob/main/utils/languages.json

Thanks!

Shatur commented 2 years ago

Oh, you are right, thanks! Could you send a PR to add "zh_HANT" to the list of exceptions for Lingva?

bigshans commented 2 years ago

Oh, you are right, thanks! Could you send a PR to add "zh_HANT" to the list of exceptions for Lingva?

Sorry, I'm very busy recently. I may not have the free time to solve it.

Shatur commented 2 years ago

Sorry, I'm very busy recently. I may not have the free time to solve it.

No problem, I will do it myself later then.