Translation not respecting the targeted language, resulting in mixed language translation
Hi all,
I am encountering an issue recently regarding to translation which has been working fine for the past few months. When I provide an input text (Chinese) , and attempt to translate to one of the languages (Japanese, Korean, French, there could be more but these are the only languages I tested with) , it only translates the first couple lines and the rest is replaced with English translation.
Below is my code for getting the translation:
const translateAPI = new Translate({ projectId: process.env.PROJECT_ID, keyFilename: process.env.GOOGLE_APPLICATION_CREDENTIALS });
const [tempTrans] = await translateAPI.translate(text, to);
return he.decode(tempTrans);
Please see attached debugged screenshot for the issue.
Below shows the input text is in Chinese:

Below shows targeted language is Japanese:

Below shows the translated language is a mixed of Japanese and English:

I have attached the raw input text file. (Input is in Chinese)
When the input text is English, the translation translates as expected, but when the input is in Chinese this issue happens. Any help or advise is appreciated, thanks in advance. 2022-07-03T00_43_18_742Z-translation-debug-input.txt
Environment details
- OS: Windows
- Node.js version: Node 10 and 14
- npm version: 6.14.17
-
@google-cloud/translateversion: 6.3.1