Error interpreting a new File Type using Regex (Trados 2011)
Thread poster: Louis_PM

Louis_PM
Canada
Local time: 13:27
English to French
+ ...
Jul 2, 2014

Hi people,

I'll soon start localizing a piece of software with Trados Studio 2011 and I wish to create a File Type to avoid translating pieces of code. Translating those could effectively break the software.

Here's an excerpt from the text I'll be translating:

[A#4]
Otilia
[A#5]
Robbers #Nose1
[A#6]
Robbers #Nose2
[A#7]

So I'm trying to put together a Regular Expression that would turn everything between square brackets, as well as the brackets themselves, into a tag. Tags cannot be translated, so that fits my purpose. I don't want to remove those strings from the target text, I just don't want to be able to touch them inadvertedly.

According to documentation, Trados 2011 abides by the .NET Regex flavour.
Here's the Regex I cooked up:

\[.+\]

I believe it works. I used the software Regex Buddy, and my expression catches every required string.

However, Trados is being naughty. It won't "Convert to Translatable Format" whenever I try processing my file with the File Type filter I created. I'd like to add a screen capture, but I don't know how.

Here's the error message:
"Value cannot be null.
Parameter name: encoding"

I'm led to believe this has something to do with UTF-8 business, but I don't see how this could play a role with what I'm doing. As a side note, my translation will be from English to French.


 

SDL Community  Identity Verified
United Kingdom
Local time: 19:27
English
Can I see the file? Jul 2, 2014

Hi,

I have created a custom regex filetype as per your instructions, and used the text you provided... and used Studio 2011. The file works and saves fine for me.

Perhaps you can share your file and I'll test that in case I'm missing information you have that I don't.

Regards

Paul
pfilkin@sdl.com


 

Louis_PM
Canada
Local time: 13:27
English to French
+ ...
TOPIC STARTER
Here's the file Jul 3, 2014

Thanks Paul!

I'll send you my ".sdlftsettings" file. It's very nice of you to help out with this tricky part of Trados' functions.


 

Louis_PM
Canada
Local time: 13:27
English to French
+ ...
TOPIC STARTER
Wrapping up Jul 10, 2014

Hello you, who are looking for a solution to a similar problem. After a few exchanges with Paul Filkin, I managed to create inline tags that worked exactly as per my expectations.

My first issue was that since the file I received had the custom format .ENG, Trados could not read it. So, I chose to save it as .DOCX. Then, I created a file type for .DOCX. However, such a file type already exists for .DOCX files, and I got an error message when trying to convert my file to translatable format.

I discarded this extra .DOCX file type I had created by resetting File Types to default settings. Paul sent me a file with the required regular expressions (as "inline tags"), but with "*.eng" is the box "File dialog wildcard expression". This .eng is actually the file type for which I will be processing with Regex.

In "document structure", I left things as they were as default.
Opening pattern => ^
Closing pattern => $
Multiline => False

Here's what I got for my "inline tags". I'll describe every expression in four lines. Empty fields are just that, i.e. without any input.

Ex.:
EXPRESSION 123
Opening pattern =>
Closing pattern =>
Tag type =>
Translatable =>


EXPRESSION 1
Opening pattern =>\[.+\]
Closing pattern =>
Tag type => Placeholder
Translatable => False

EXPRESSION 2
Opening pattern =>
Closing pattern =>
Tag type => Placeholder
Translatable => False

EXPRESSION 3
Opening pattern =>
Closing pattern =>
Tag type => Tag pair
Translatable => True

EXPRESSION 4
Opening pattern =>
Closing pattern =>
Tag type => Tag pair
Translatable => True

EXPRESSION 5
Opening pattern =>

Closing pattern =>
Tag type => Placeholder
Translatable =>

EXPRESSION 6
Opening pattern => #heroname
Closing pattern =>
Tag type => Placeholder
Translatable => False

Expressions 3 and 4 are set to "Translatable = True", meaning that what is between the closing and opening tag can be translated.

The other tricky part was to display the inline tags. I needed to move them around in my target segments, and also sometimes needed them for context clues. But the reason I created them was to make them un-translatable, so that I could not inadvertedly break the code. Anyway, here's what to do to display them:

1) Select the expression for which you want to display the tag, by left-clicking on that expression in the "Inline tags" sub-menu.

2) Click "Edit rule".

3) Click "Advanced".

4) Select the radio button "Include with text".

5) Confirm with "OK".

6) Confirm the next dialog window with "OK" once again.

7) Once your text has been successfully imported and converted to translatable format, you can start editing it in the Editor tab. However, tags might not be set to full display. In my case, it was useful to set them to display fully. This creates clutter, but also provides context for my translation. It was actually necessary to know who was the speaker of such or such string.

I hope this will be help some adventurous soul! Localizing without Passolo is indeed possible!


 

Louis_PM
Canada
Local time: 13:27
English to French
+ ...
TOPIC STARTER
Testing regular expressions online Jul 10, 2014

For your information, I used this nifty tool to help me devise my regular expressions. Check it out, there are also explanations of the code you can use. It's called the "Regex Tester".

http://www.freeformatter.com/regex-tester.html


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Error interpreting a new File Type using Regex (Trados 2011)

Advanced search







SDL Trados Studio 2017 only €435 / $519
Get the cheapest prices for SDL Trados Studio 2017 on ProZ.com

Join this translator’s group buy brought to you by ProZ.com and buy SDL Trados Studio 2017 Freelance for only €435 / $519 / £345 / ¥63000 You will also receive FREE access to Studio 2019 when released.

More info »
Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search