Error: Class "Drupal\auto_translation\TranslateClient appears when Google API entered into config

Created on 3 March 2025, about 1 month ago

Problem/Motivation

There is an issue with the module when using the GOOGLE API option as opposed to leaving the Enable Server Side APIoption unchecked

When a user enters their GOOGLE API key and then attempts to translate a page, the following error appears in the browser:

The website encountered an unexpected error. Try again later.

Error: Class "Drupal\auto_translation\TranslateClient" not found in Drupal\auto_translation\Utility->translateApiServerCall() (line 247 of modules/contrib/auto_translation/src/Utility.php).

Steps to reproduce

After downloading the module, ran through the following steps to configure:

1. Selected GOOGLE TRANSLATE API from the Translator Provider dropdown.
2. Checked the Enable Server Side API field and entered the API KEY.
3. Saved changes.
4. Went to a page with English text (our website has French and Spanish pages).
5. Clicked the TRANSLATE button for that node.
6. Clicked the ADD button next to the French option.
7. The error logged above appears.

When the API KEY field in step 2 is left blank, the module works and the text is translated into French on the node created in step 5.

Using MAC OS and Google Chrome Version 133.0.6943.142 (Official Build) (arm64)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.3

Component

Code

Created by

🇨🇦Canada jayzee

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024