SDL Trados provides users various powerful filters. On this page, I want to discuss how to use a regular expression delimited text filter in SDL Trados Studio 2011/2014. I chose the following .po file as a sample to translate using Trados. Of course, there is a predefined filter for translating .po files. Here, I just want to show how SDL Trados filter actually helps you translate complex text-based files by translating a simple .po file.
First, create a custom Delimited Text Document Filter by clicking "New..." in the "Filter Types" screen as shown in the following figure.
In the newly created Regular Expression Delimited Text filter, specify the name of the filter and add file extension *.po to "File dialog wildcard expression:." List items should be separated with a semicolon.
In the sample .po file, the strings which need to be translated are placed between [msgstr "] and ["] as follows:
msgstr "Monthly Archives: %s"
In the "Document structure" section under the filter, add the following patterns:
Opening pattern: msgstr "
Closing pattern: "\s*$
Now, we are ready to load .po file into SDL Trados.
Please click "Open Document..." and select the file to be translated. In the "Open Document" dialog, please select the custom filter defined above as "File Type:"
The sample po file is now loaded into SDL Trados Studio for translation. But you will notice there is a html tag in the strings above. We need to specify some settings in the custom regular expression delimited text filter. In the "Inline tags" section under the relevant filter, we can add inline tags.
In the sample .po file, one tag <span> is used. It can be added as shown above.
The following figure shows the .po file re-loaded with a modified filter in SDL Trados Studio. Now, it's easier to translate.
It's easy to process complicated text based files using a custom regular expression delimited text filter provided by SDL Trados Studio.
In addition, some knowledge in regular expressions will help you process various file formats using a custom filter. RegexBuddy is a useful tool which enables you to create regular expressions with ease.
More efficient patterns for inline tags
In the above sample, there are some strings which do not need to be translated. It's more efficient to process them as inline tags in Trados. Then, how can I convert "→", "”", "“"... to inline tags? In the "Inline tags" section, add the following pattern in "Opening pattern":
For such tags as <b>, <br />, <span class="top-nav">, you can use the following pattern:
If this rule processes unexpected results, you might be able to add them one by one.