Problem when translating from another language to english

Created on 13 June 2024, 5 months ago
Updated 27 June 2024, 5 months ago

Problem/Motivation

Works nicely otherwise but when I try to translate from another language to english I get this error: "The text and its translation are the same so maybe there was an error trying to translate it. Was the text already written on the current language?"

I'm using DeepL and my language has english language code as "en". When digging deeper, I was able to log the error in DeepLTranslator.php translateText function:

DeepL\DeepLException: targetLang=โ€œenโ€ is deprecated, please use โ€œen-GBโ€ or โ€œen-USโ€ instead.

Since the try fails, it returns the original text.

Steps to reproduce

- Enable the module and folllow the post installation steps
- Have DeepL as the translation backend service
- Have english as language with langcode "en"
- Try to auto translate another language to english

Proposed resolution

Have it accept also "en" as language code for english.

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ซ๐Ÿ‡ฎFinland akseli.miettinen

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024