How to create custom parser rules based on attribute values in xliff-files

Hello everybody,

we are struggleing with a xliff-file containig segments for which our costumer doesn't want any translation.

Screenshot of an XML code snippet with UTF-8 encoding, showing trans-unit tags with id attributes for localized fields such as Headline and Subline.

The segments are the tags with the following attributes:

  • <trans-unit id="localizedfield~-~Headline">
  • <trans-unit id="localizedfield~-~subline">
  • ...

The files are bilingual, so we can not save them in xml for the translation process ... at least I think so. Smiley

In xml-filetype i was able to create the right parser rules:

Screenshot of Trados Studio parser rules interface with rules set to not translate certain trans-unit ids like localizedfield~-~LvText, Subline, and Headline.

I also tried with "tag-definition rules" in "Embedded content" in the xliff-filetyp, but without success.

Screenshot of Trados Studio tag definition rules interface showing regular expressions for start and end tags for a trans-unit id localizedfield~-~Headline.

Is there a solution for xliff-filetype?

Thanks a lot in advance.



Generated Image Alt-Text
[edited by: RWS Community AI at 12:52 PM (GMT 1) on 10 Jul 2024]
emoji
  • Hello,

    Based on your query, it seems you want to create custom parser rules for xliff files in Trados Studio. Here's how you can do it:

    Step 1: Open Trados Studio and go to File > Options > File Types.

    Step 2: If you already have a custom file type filter that you are using, select it. If not, you can create a new file type from scratch with the "New..." command on the top left side of the File Types window.

    Step 3: Once you've selected or created your file type, go to the Parser settings.

    Step 4: In the Parser window, click on Add... to set up a parser rule. You can create a rule similar to the one you've used in the xml-filetype.

    Step 5: You also need to add a rule for the main element (for example, "text" in this case), for its content to be translated if the attribute value is not "no".

    Step 6: If you have attributes with several values (not just "yes" and "no"), and you want to extract only one or some of these, it is more efficient to set the entire element as "Not translatable", and the element with the desired attribute value as "Always translatable".

    Please note that these steps are a general guide and may need to be adjusted based on your specific xliff file and translation requirements.

    I hope this helps! If you have any other questions, feel free to ask.

    Best regards,

    RWS Community AI

    emoji