Does anyone know the import syntax for this line of code:
const { Translate } = require("@google-cloud/translate").v2;
I was thinking something like:
import { Translate } from "@google-cloud/translate.v2"
but that doesnt work. any ideas?
Does anyone know the import syntax for this line of code:
const { Translate } = require("@google-cloud/translate").v2;
I was thinking something like:
import { Translate } from "@google-cloud/translate.v2"
but that doesnt work. any ideas?
Try using:
import { v2 } from "@google-cloud/translate";
// use "v2.Translate"
or
import { Translate } from "@google-cloud/translate/v2";
For my own project, using v7.2.1 of the library, I have this:
import { Translate } from "@google-cloud/translate/build/src/v2";