translatte
translatte copied to clipboard
empty response with google_v3
Getting no errors but no translation with google_v3
Code fragment:
try {
const res = (await translate(value, {
from: argv.from.substr(0, 2),
to: argv.to.substr(0, 2),
services: {"google_v3": {"project-id": process.env.GCLOUD_PROJECT, "token": process.env.GCLOUD_TOKEN}}
}));
console.log("TR");
console.log(value, {from: argv.from.substr(0, 2), to: argv.to.substr(0, 2)});
console.log(res);
} catch (e) {
console.log("ERROR");
console.log(value, {from: argv.from.substr(0, 2), to: argv.to.substr(0, 2)});
console.log(e);
process.exit();
}
Console output:
TR
Информационный департамент { from: 'ru', to: 'uk' }
{ text: '',
raw: '',
from:
{ language: { didYouMean: false, iso: '' },
text: { autoCorrected: false, value: '', didYouMean: false } },
proxy: '',
agent: '' }
Running the same via curl (https://cloud.google.com/translate/docs/translating-text-v3) works well
I have not had the opportunity to test, my payment card has not passed verification. I will create accounts and test later.
Thank you for message, @terion-name