Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
How to translate AXIOS responses using Amazon Translate or Google Translate in React?

I am trying to convert Axios JSON responses in React i.e

axios.get('https://jsonplaceholder.typicode.com/users')
            .then(res => {
                ...translation_logic_here
                setUsers(translatedJson)
             })

I am trying to translate all values(even if it is nested), to a target language.

I see both in Amazon and Google, they provide text translation API's, where we have to send HTTP request for each value in JSON..lets say if 100 values, 100 http requests which takes more time... A gist on the code and a screenshot is provided below(134 requests in screenshot!!!)

var params = {
                    Text: res.data[0].company.catchPhrase,
                    SourceLanguageCode: "auto",
                    TargetLanguageCode: 'ru',
                };

translate.translateText(params, function(err, data) {
           ...after_translation_logic
}

enter image description here

I tried https://www.npmjs.com/package/react-google-translate and official Javascript SDK AWS SDK both has this same approach.

AFAIK, even google provides text translation API's in same approach which can't be used for web applications.

Lastly, i came across this solution googleTranslateElementInit which works like a charm... but we require Amazon Custom Terminology or Google Glossary feature for custom translation.

Will googleTranslateElementInit still be supported in future? If so how can i integrate Google Glossary in googleTranslateElementInit? or any ways in Amazon Translate without multiple http requests?

Can anyone please support me on how to proceed? Any help is much appreciated...Thanks.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!