mololab / json-translator

jsontt 💡 - AI JSON Translator with GPT + other FREE translation modules to translate your json/yaml files into other languages ✅ Check Readme ✌ Supports GPT / DeepL / Google / Bing / Libre / Argos
https://mololab.org/jsontt/npm
MIT License
452 stars 57 forks source link

Slow translate on bigger JSON files #2

Closed ParvinEyvazov closed 2 years ago

ParvinEyvazov commented 2 years ago

When translating bigger JSON files, Google API response times get higher. I am planning to fix that issue by using the proxy.

(I would appreciate it if anybody can be a contributor to that problem.)

henriquecustodia commented 2 years ago

Hey there! I've found this package after making some research and I really liked how it works.

Well, I've made json translator repository some time ago that uses proxies to call google-translate-api. I think I can contribute with this solution.

Check out the project website: https://json-translator-app.herokuapp.com/

ParvinEyvazov commented 2 years ago

That would be an awesome contribution to this project. This solution will fix the biggest issue of this project (latency & unexpected load errors by Google Translate API).

Checked the mentioned project and it works super fast, it is awesome. Please feel free to ask about anything.

Thank you!

henriquecustodia commented 2 years ago

No problems! I'll check the codebase as soon as possible :)

henriquecustodia commented 2 years ago

Hey @ParvinEyvazov, this week I did some tests on this app and I got stuck trying to use several proxies to translate keys.

I'm using this package to get a proxy list with thousands ips (at around 34k), but I saw the delay to translate simple messages was greater than 15 seconds (a lot of time). Maybe because the most of proxies server has a big latency. Well, I don't know if the proxy approach can still work.

What about trying to use another translate api? There are many appearently. I did a quick research and I found a few options:

Maybe toggle among theses apis we can achieve good results

ParvinEyvazov commented 2 years ago

Thank you for the comment @henriquecustodia . I was AFK for a couple of weeks.

I also tried some proxy lists before and faced the same problem as you. I will investigate the packages and will try to find a better solution. I will try to share my progress via this comment.

ParvinEyvazov commented 2 years ago

I added a translation request queue which will prevent high loads to the translation servers. Tried with big JSON files and works fine. Also added two more translation APIs (Libre Translate and Argos Translate) for more choices.