Questions tagged [google-translate-api]

4 questions
0
votes
0 answers

Can't resolve 'util' in 'node_modules/@google-cloud/common/build/src'

I'm trying to implement the google translate api and am encountering this error when I import the Translate function. I have followed the documentation here. This is my code: const {Translate} = require('@google-cloud/translate').v2;
chackerian
  • 1,301
  • 2
  • 15
  • 29
0
votes
0 answers

google-translate api returns SyntaxError: Unexpected token < in JSON at position 0

I used a simple code to translate strings using @iamtraction/google-translate const translate = require('@iamtraction/google-translate'); module.exports = function({ string, from, to }) { return new Promise(resolve => { run(); …
0
votes
1 answer

Prevent Google Translate from translating a variable

I see Google Translate, both the web interface and API translates a variable like '{userName}'. Is there a way to preserve the variable as it is? Context: I have a Flutter project with localization support. The ARB file contains an entry like…
0
votes
2 answers

Unable to run Node Script file from Laravel Controller function

I am trying to run node js file function from Laravel Controller function. Basically Node js file called as translate.js have function which can translate input text to required language ( Like english to hindi etc..) I have done some testing with…
NIKUNJ PATEL
  • 2,034
  • 1
  • 7
  • 22