Giter Site home page Giter Site logo

Comments (7)

AidanWelch avatar AidanWelch commented on July 24, 2024 1

@AdamElitzur Yep you got it exactly right! I'm glad that solution works for you!

from google-translate-api.

AidanWelch avatar AidanWelch commented on July 24, 2024

I'm glad you're liking it! My immediate guess would have been that it was because of forceBatch but you already set that to false so I'd have to investigate. I'll try to take a look when I get a chance soon (If I take too long feel free to @ me)

from google-translate-api.

AdamElitzur avatar AdamElitzur commented on July 24, 2024

Thanks so much! Let me know if you find anything, and if it's happening on your side or not.

from google-translate-api.

AdamElitzur avatar AdamElitzur commented on July 24, 2024

@AidanWelch I hope all is well! Finding anything yet with the discrepancy? Anything else I should try in the meantime? Thanks so much.

from google-translate-api.

AidanWelch avatar AidanWelch commented on July 24, 2024

Well, the issue is with batch translation as

translate('ארים ראשי, אשא עיני אל ההרים במרחקים', {from: 'he', to: 'en', forceBatch: false, fallbackBatch: false}); // => res.text === 'I lift my head, I will lift my eyes to the mountains in the distance'

However that responds with Error: Too Many Requests sometimes. So, it must just be more aggressive rate limiting. With fallbackBatch: true when singleTranslate fails then batchTranslate is called rather than throwing an error. But, to be honest, it might have been a mistake on my part to degrade translation quality rather than throw an error by default.

Basically, forceBatch: false and fallbackBatch: false must be set to force the more accurate singleTranslate.

from google-translate-api.

AidanWelch avatar AidanWelch commented on July 24, 2024

@AdamElitzur (Just pinging in case you didn't get the notification)

from google-translate-api.

AdamElitzur avatar AdamElitzur commented on July 24, 2024

Thanks so much @AidanWelch! If I set forceBatch: false and fallbackBatch: false, then could that cause errors if there are too many requests?
I would like for a translation to show no matter what, even if the quality is worse, if that is the best possible outcome (better than an error). So actually, I like your move to degrade translation quality rather than throw an error by default! Thank you!

from google-translate-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.