After some fiddling with the code I'm now getting the following error message when running a javascript program in node.js designed to translate a .docx file in Arabic to a .docx English, both files stored in their respective subdirectory in a subdirectory of my bucket. Ah yes, I'm also using a unidirectional glossary in .tmx format (with the source language (Arabic) in the left-hand column and = English in the the one). Bing told take a closer look at how the "request" section of my program is constructed. But I'm not quite sure what's wrong. I'm including the error message as well as the code here. First the error message:
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
Error: 3 INVALID_ARGUMENT: Target language code is required.
at callErrorFromStatus (/home/gurqinfo/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
at Object.onReceiveStatus (/home/gurqinfo/node_modules/@grpc/grpc-js/build/src/client.js:192:76)
at Object.onReceiveStatus (/home/gurqinfo/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
at Object.onReceiveStatus (/home/gurqinfo/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
at /home/gurqinfo/node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
for call at
at ServiceClientImpl.makeUnaryRequest (/home/gurqinfo/node_modules/@grpc/grpc-js/build/src/client.js:160:34)
at ServiceClientImpl.<anonymous> (/home/gurqinfo/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
at /home/gurqinfo/node_modules/@google-cloud/translate/build/src/v3/translation_service_client.js:261:29
at /home/gurqinfo/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
at LongrunningApiCaller._wrapOperation (/home/gurqinfo/node_modules/google-gax/build/src/longRunningCalls/longRunningApiCaller.js:55:16)
at /home/gurqinfo/node_modules/google-gax/build/src/longRunningCalls/longRunningApiCaller.js:46:25
at OngoingCallPromise.call (/home/gurqinfo/node_modules/google-gax/build/src/call.js:67:27)
at LongrunningApiCaller.call (/home/gurqinfo/node_modules/google-gax/build/src/longRunningCalls/longRunningApiCaller.js:45:19)
at /home/gurqinfo/node_modules/google-gax/build/src/createApiCall.js:84:30 {
code: 3,
details: 'Target language code is required.',
metadata: Metadata {
internalRepr: Map(1) {
'grpc-server-stats-bin' => [
Buffer(10) [Uint8Array] [
0, 0, 144, 132, 209,
1, 0, 0, 0, 0
]
]
},
options: {}
}
}
And now the program itself the running of which results in the above error message. By the way, the target language that the error message says is missing isn't missing, unless I am missing something about where it is missing. A distinct possibility given my "skill level." Anyway, here's the code:
Hi @legrandtimonier,
Welcome back to Google Cloud Community.
The target language code is missing in the code, as indicated by the error message "Error: 3 INVALID_ARGUMENT: Target language code is required." The target language code must be specifically specified using the languagePair parameter in the glossaryConfig object. The following code should be added to the glossaryConfig object to add the target language code. The inputConfig field indicates the path to the glossary file, and the languagePair parameter specifies the source language code and target language code.
Hi @legrandtimonier,
Ensure that [BUCKET_NAME], [SUBDIRECTORY], and [TMX_FILENAME] are changed to the correct values for your configuration.
If your.tmx file's path is accurate but issues persist, you might want to double-check that your Cloud Storage bucket is set up to permit access by your Cloud Translation API service account.