Trados Studio 2019: XML source is converted to target

Hi, I've experienced something I haven't seen before in the translated target files I delivered to my client.

The untranslated source files have the following structure:

<loc language="en">

<note>

<para>This is a sentence in English.</para>

</note>

        </loc><loc language="sv-SE">

          <note>

<para> This is a sentence in English.</para>

</note>

However, when I generate target translations both fields are translated, it looks like this:

<loc language="en">

<note>

<para>This is a sentence in Swedish.</para>

</note>

        </loc><loc language="sv-SE">

          <note>

<para> This is a sentence in Swedish.</para>

</note>

 Why is Trados not protecting the source fields?

emoji
Parents Reply
  •  

    I understand about not sharing the file. An XML file needs a root element, however it's called. I called mine “root” in the below example. The structure is important.

    In the parser, you describe the location of the translatable text to Trados Studio using a language called XPath. That's all total standard.

    Your example was a bit incomplete, so I completed it, and it looks like this:

    Screenshot of an XML file with root and loc elements, showing English text within para tags.

    You want to tell Studio: Translate all content of all “para” elements, if they are descendents of a “loc” element where the attribute “language” has the value “sv-SE”.

    In this case, it's this:

    /root/loc[@language="sv-SE"]/note/para

    (The code module has “CoffeeScript” but it does not have XPath!!)

    In Studio, you select File Types in “Project Settings” and then “New”. Base your file type on XML 2.

    Trados Studio 'Create File Type' window with 'Anders Larsson' as the file type name and other XML file type details.

    In one of the following screens, select “XPath rules”, not “Element rules”.

    Forward to the "Parser" screen, then enter a catch-all for what you don't want to translate:

    Trados Studio 'Add Rule' window with a default XPath rule that excludes all text from translation.

    Then enter your XPath expression of what you DO want to translate:

    Trados Studio 'Add Rule' window with a custom XPath expression to include specific text for translation.

    Finish and try to preview your file, it should look like this:

    Preview window in Trados Studio showing the English sentence to be translated from the XML file.

    If your root node is different you have to adjust accordingly.

    Hope this helps

    Daniel

    PS Good read: https://multifarious.filkin.com/2014/06/01/custom-xml/ and lots more blog posts on XML filetypes on that website.

    emoji


    Generated Image Alt-Text
    [edited by: RWS Community AI at 1:50 PM (GMT 1) on 29 Aug 2024]
Children