dialect-app / dialect

A translation app for GNOME.
https://dialectapp.org/
GNU General Public License v3.0
597 stars 69 forks source link

Port Google Translate back again #243

Closed mufeedali closed 2 years ago

mufeedali commented 2 years ago

Honestly, I'm at a complete loss about why this doesn't work. Unless I'm missing something, it looks like it should be working but it doesn't for some reason. Google sees the request as a bad request but the equivalent code written with httpx works just fine.

Fixes #234

mufeedali commented 2 years ago

The changes that were needed to the existing system are basically three:

mufeedali commented 2 years ago

So... what's left is error handling, which is just hell in the case of gtrans...

mufeedali commented 2 years ago

So... what's left is error handling, which is just hell in the case of gtrans...

It doesn't even error out in the case of wrong language codes, it just defaults to English instead...

The character limit for this API is really odd: 2332. Tested multiple times on my end to confirm but seems so.

When it does fail entirely (like when exceeding character limits), it gives gibberish output too.