Stu
Stu

Reputation: 1317

Anyone seen Google Translate API with glossary return empty result with no errors?

We've successfully used the translate API previously with a glossary, but today the API has started returning an empty translation result with no errors or explanations:

{
  "translations": [
    {}
  ],
  "glossaryTranslations": [
    {}
  ]
}

API URL: "https://translation.googleapis.com/v3/projects/{apiProjectId}/locations/us-central1:translateText"

If the glossaryConfig is removed from the translate API call, then the text is translated correctly. The glossary itself is created without errors and the API indicates that it has all terms (entryCount) from the cloud bucket CSV file.

Wondering if anyone has seen this behavior and if not then maybe this is a temporary bug?

Upvotes: 0

Views: 53

Answers (1)

Stu
Stu

Reputation: 1317

After more testing, it appears that setting contextual_translation_enabled = true is causing this. This setting is supposed to only include the glossaryTranslations text, but it's omitting both results for some reason. Using false, which includes both results seems to fix it. Clearly this is a bug with Google's API.

Upvotes: 0

Related Questions