Skip to content

XML translation - character moves into inline element #142

@matsbert

Description

@matsbert

I am translating large amounts of XML text. Every time when I translate text, a character that preceeds an inline element (superScript) is being moved into the inline element.

Input:

Problemet är att bokstaven före superScript elementet flyttas in i inline elementet: tank rymmer 48 m3 och tanken rymmer 43 m3. Lite mer text här.

Translated output:

The problem is that the letter preceding the superScript element is being moved into the inline element: tank holds 48m3 and the tank holds 43m3. A little more text here.

result = deepl_client.translate_text(
text,
tag_handling="xml",
source_lang="SV",
target_lang="EN-GB",
model_type="prefer_quality_optimized",
split_sentences="nonewlines"
)

I have noticed that adding the superScript element to the 'ignore_tags' attribute will help. The unfortunate thing is that the superScript element can also contain other text that must be translated.

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