Support placeholder tokens in the translation

Created on 5 December 2023, 7 months ago
Updated 6 December 2023, 7 months ago

Problem/Motivation

Tokens are not supported by the "tmgmt_deepl" translator plugin resulting in the translation of the tokens by the DeepL API.
Example: Translation a locale string from English to Spanish.
English: Estimated read time: @read_time
Spanish translation returned by the "tmgmt_deepl" translator plugin: Tiempo estimado de lectura: @tiempo_de_lectura
Expected Spanish Translation: Tiempo estimado de lectura: @read_time

Steps to reproduce

Translate any Locale source text that contains a placeholder token that stars with "@", "!", or "%".

Proposed resolution

The tmgmt module's TranslatorPluginBase provides methods for escaping / unescaping tokens so that they do not get translated. The tmgmt_deepl plugin should use these methods to escape the text before sending to the DeepL API and then unescape the text received by the DeepL API.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States recrit

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024