Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we call this translate() in loop? #101

Open
jayna456 opened this issue Nov 26, 2019 · 0 comments
Open

Can we call this translate() in loop? #101

jayna456 opened this issue Nov 26, 2019 · 0 comments

Comments

@jayna456
Copy link

jayna456 commented Nov 26, 2019

I have array of objects. From which I have one key value pair on which I want to translate it. By calling translate() in loop getting error of Response code 429 (Too Many Requests)

Below is my code:

for(let obj of notifyData) {
    translate(obj.body, {from: 'en', to: 'hr'})
              .then((response) => {
                console.log('tr...', response);
              })
              .catch((err) => {
                console.log('error in translation...',err);
              })
}

the function is not event taking first element from the array. i.e. array[0]. By doing this too, I am getting too many requests error..

Please help me out..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant