Skip to content

Issues with Text Translation Using Special Characters in Deepl (API) #28

Open
@Abbis-1

Description

@Abbis-1

Hello I have a Problem with the Deepl API in ABAP.

The Problem:
I have a text that is in a table format. Each table row can contain a maximum of 72 characters. The text can have a structure, as shown in the example, where the texts are separted by bullet points. The text should be maintained during the translation.

This is how a text can look like.

Screenshot 2024-10-02 111545

This is the text in table format I have to work with.

image

The solution I have tried but dont work:

I take the text from the table and convert it into a string. I insert a special character {@} between the lines each time. I also use the ignored_tags function, and use the tag <x></x> with it. I wrap my ignored_tags around my placeholder and it looks like this <x>{@}<x>. I thought the tags and placeholders would then be ignored in the translation, but it dosnt look like it works. At last, I split the string back <x>{@}</x> with this placeholder back, so I get the translated text into a table form. Thats why I need this placeholder.

This is the text that I am sending to the Deepl API, translated from english to portuguese (brasil).

english I translate:
image

portuguese (brasil) I get back from the Deepl API:

image

As you can see, the complete sentence "e.g. <x>{@}</x> DataScope) is applied, the client needs to adjust the link <x>{@}</x>." is doubled in the portuguese (brasil) translation).

I would say Deepl apparently has trouble handling such special characters. There are duplicates of words or sentences.

Also if I use the Deepl Webtranslator instead of the Deepl API, I get the problem with duplicates.

english -> portuguese (brasil)
image

english -> french
Screenshot 2024-10-02 115521

english -> german
Screenshot 2024-10-02 115709

In french I get the same problem.
In german it dont double the sentence but doubles the e.g. to z z.B.

Is there a way to use a special character as a placeholder that is completely ignored by the Deepl API translation? Or do you have a solution that you could recommend?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions