json-translator icon indicating copy to clipboard operation
json-translator copied to clipboard

Slow translate on bigger JSON files

Open ParvinEyvazov opened this issue 3 years ago • 5 comments

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.)

ParvinEyvazov avatar Mar 14 '22 07:03 ParvinEyvazov

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/

henriquecustodia avatar Jun 29 '22 19:06 henriquecustodia

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!

ParvinEyvazov avatar Jun 29 '22 21:06 ParvinEyvazov

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

henriquecustodia avatar Jul 01 '22 03:07 henriquecustodia

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:

  • https://www.npmjs.com/package/bing-translate-api
  • https://www.deepl.com/en/docs-api/
  • https://yandex.com/dev/translate/
  • https://github.com/LibreTranslate/LibreTranslate
  • https://github.com/zotero/translation-server

Maybe toggle among theses apis we can achieve good results

henriquecustodia avatar Jul 09 '22 00:07 henriquecustodia

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 avatar Jul 17 '22 15:07 ParvinEyvazov

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.

ParvinEyvazov avatar Sep 04 '22 14:09 ParvinEyvazov