ManeraKai / simplytranslate_mobile

Privacy friendly frontend to Google Translate
https://manerakai.github.io/simplytranslate_mobile/
GNU General Public License v3.0
178 stars 15 forks source link

Add offline translations support #143

Closed ghost closed 2 years ago

ghost commented 3 years ago

I saw that on the F-Droid description:

"No Instant Camera, Document, or Speech Translation at the time. Those should be implemented first on the proxy server. Then on the client app. I'll try to help with that."

I hope it is possible and in the future Simply Translate Mobile will become the one and only FOSS Google Translate client with all fuctions of official client. And I want to say good luck to this project!

When (and if) you will start to add a new functions, I suggest you to add offline translations support at first. Because there is no offline translators on the F-Droid. There was Mitzuli, but it don't working anymore. Such function would be userful in places or circumstances when you don't have Internet.

Valdnet commented 3 years ago

I suggest you to add offline translations support at first.

For an application to work offline, it would need a word base, which is unlikely to achieve this.

ghost commented 3 years ago

I suggest you to add offline translations support at first.

For an application to work offline, it would need a word base, which is unlikely to achieve this.

That is what I'm thinking about - how you can implement all functionality from such a closed service as Google Translate. This feature probably requires to download Google's dictionaries.

Valdnet commented 3 years ago

It is rather not achievable. That's why I prefer online translators. They are much better than offline.

@ManeraKai What do you think?

ManeraKai commented 3 years ago

Some problems turn out easy once you start with them, some turn out impossible. as a prestart opinion I'm feeling this will be hard but no one knows. This won't be a priority on top of the camera scanning and speech to text though.

Valdnet commented 3 years ago

One still has to consider that such a translation database takes up a lot of space. In my opinion, this is not achievable. Still constant updating of words. I can not see it. If it were that easy, there would be many more applications like this.

ManeraKai commented 3 years ago

If I managed to take it from Google Translate, it may work. I don't know

ghost commented 3 years ago

One still has to consider that such a translation database takes up a lot of space. In my opinion, this is not achievable. Still constant updating of words. I can not see it. If it were that easy, there would be many more applications like this.

If I remember it correctly, that dictionaries don't need so much space. Maybe one dictionary takes only a few dozens of megabytes. Even if one dictionary takes, for example, 100 megabytes, then it is fine. Because most people would use only 1-3 dictionaries. If you talking about space in the server to store all dictionaries, then it may be a problem, maybe not, I don't know. Also, I read and saw that Google updating that dictionaries very rare.

ManeraKai commented 2 years ago

While reading through Nitters DMCA templates, I read this:

it is simply a proxy to access Twitter assets and user generated content without tracking from Twitter. Thus, all content is proxied from Twitter and is not stored on our servers and if Twitter chooses to remove an asset, it will no longer appear on our site.

This will make some problems with storing a copy of translations for offline use, but Nitter is a website and not an app.

OkyDooky commented 2 years ago

There is LibreTranslate, which is in the works. It looks like a ground-up FOSS translation solution and even has an app of F-Droid. It's definitely a ways away from being ready for the everyday user, but it could be something to keep an eye on for this issue.

ManeraKai commented 2 years ago

If LibreTranslate got ready. Then our app will be almost like a transition app from Google to LibreTranslate.

Aga-C commented 2 years ago

If LibreTranslate got ready. Then our app will be almost like a transition app from Google to LibreTranslate.

Instead of transition, it would be better to give a choice between translation engines.

ManeraKai commented 2 years ago

No it's not about that. We mean a local translating app.

ManeraKai commented 2 years ago

Will this issue be converted to just caching? because it's just a client after all.

ghost commented 2 years ago

Hi, I just checked google translate traffic.

  1. It connects first: https://dl.google.com/translate/offline/locations.json (gets profile info?)

  2. Then it gets a list of supported languages. https://translate.google.com/translate_a/l?hl=en-US&oe=UTF-8&client=at

  3. Then it retrieves offline translation file data (hashes, sizes, etc.). https://dl.google.com/translate/offline/v5/profiles_r29.json (this URL is at (1.)↑("https://dl.google.com/translate/offline/locations.json"))

  4. I downloaded the English-Spanish data in the app... https://redirector.gvt1.com/edgedl/translate/offline/v5/high/r29/en_es.zip

  5. (4.) was redirected to https://r3---sn-oguelnsz.gvt1.com/edgedl/translate/offline/v5/high/r29/en_es.zip?cms_redirect=yes&mh=30&mip=[MY-IP-ADDRESS]&mm=28&mn=sn-oguelnsz&ms=nvh&mt=1652414421&mv=m&mvi=3&pl=24&rmhost=r5---sn-oguelnsz.gvt1.com&shardbypass=sd&smhost=r2---sn-oguelnle.gvt1.com

Sorry for the dirty description, have to go to work. ε≡≡ヘ( ゚Д゚)ノ

ghost commented 2 years ago

en_es.zip https://redirector.gvt1.com/edgedl/translate/offline/v5/high/r29/en_es.zip
was very interesting.

It appears to contain a trained model😆

But I don't know if it can be easily imported into the app🫤.

ManeraKai commented 2 years ago

But I don't know if it can be easily imported into the app🫤.

I don't think so. The file is really complex and I won't be surprised if it did change often. There's so many gibberish data like a binary file.

Working on this issue will only waste time that can be put into other more useful features like text recognition, voice, popup, etc...

Sorry, but I'll close this issue.