Translating lines separated by a colon ":"
Thread poster: Rolf Klischewski, M.A.
Rolf Klischewski, M.A.
Rolf Klischewski, M.A.  Identity Verified
Local time: 05:05
Member (2008)
English to German
+ ...
Oct 10, 2017

Hi there!

I often work on games that use this kind of structure for their texts:

line 1 :After a long walk you're hungry and thirsty, and you need to take a break.

Only stuff AFTER the colon ":" needs to be translated.

Is there any way I can define a filter in Studio to handle such TXT files? I use 2015.

Thanks in advance,

Rolf.


 
Heinrich Pesch
Heinrich Pesch  Identity Verified
Finland
Local time: 06:05
Member (2003)
Finnish to German
+ ...
" :"? Oct 11, 2017

Usually it would be
line 1: More...

I don't know about txt-files, but I have these in Excel tables quite often, and Studio creates automatically two segments, one including the colon and the next for the text after the colon.


 
jkmsff
jkmsff
Local time: 05:05
Regular Expression Delimited Text Oct 11, 2017

This is how I'd do it in Trados 2011. It should be similar in your version.

1. Create a new file type as Regular Expression Delimited Text (either in Project > Project Settings > File types, or globally in Tools > Options > File types)

2. In the 'Create file type' dialog, define the file name extension (.txt or whatever)

2. In the 'Document structure' dialog, delete any preset patterns.

3. Define a new pair of patterns:

Opening pa
... See more
This is how I'd do it in Trados 2011. It should be similar in your version.

1. Create a new file type as Regular Expression Delimited Text (either in Project > Project Settings > File types, or globally in Tools > Options > File types)

2. In the 'Create file type' dialog, define the file name extension (.txt or whatever)

2. In the 'Document structure' dialog, delete any preset patterns.

3. Define a new pair of patterns:

Opening pattern
^line \d+ :
(line starts ^ with 'line ' followed by one or more digits \d+ and a colon)

Closing pattern
$
(end of line)

4. Click 'Add'

5. In the file types list of your Trados project, move the new file type to the top. That way, Trados will automatically pick this filter for all files with the extension you defined earlier.
Collapse


 
Rolf Klischewski, M.A.
Rolf Klischewski, M.A.  Identity Verified
Local time: 05:05
Member (2008)
English to German
+ ...
TOPIC STARTER
Thanks, I'll try that! :) Oct 11, 2017

jkmsff wrote:

This is how I'd do it in Trados 2011. It should be similar in your version.

1. Create a new file type as Regular Expression Delimited Text (either in Project > Project Settings > File types, or globally in Tools > Options > File types)

2. In the 'Create file type' dialog, define the file name extension (.txt or whatever)

2. In the 'Document structure' dialog, delete any preset patterns.

3. Define a new pair of patterns:

Opening pattern
^line \d+ :
(line starts ^ with 'line ' followed by one or more digits \d+ and a colon)

Closing pattern
$
(end of line)

4. Click 'Add'

5. In the file types list of your Trados project, move the new file type to the top. That way, Trados will automatically pick this filter for all files with the extension you defined earlier.


 
Rolf Klischewski, M.A.
Rolf Klischewski, M.A.  Identity Verified
Local time: 05:05
Member (2008)
English to German
+ ...
TOPIC STARTER
It won't work... Oct 11, 2017

I followed your advice, created a file type and put it 2nd in the list, behind SDLXLIFF. Won't work... )C:

 
Mirko Mainardi
Mirko Mainardi  Identity Verified
Italy
Local time: 05:05
Member
English to Italian
Segmentation rules and/or Excel Oct 11, 2017

Technically, since it's just about punctuation, changing the segmentation rules should do the trick (if the one you're using doesn't take the colon into account).

E.g. ... See more
Technically, since it's just about punctuation, changing the segmentation rules should do the trick (if the one you're using doesn't take the colon into account).

E.g. http://producthelp.sdl.com/sdl%20trados%20studio/client_en/Ref/A-G/AE_SegRul.htm
http://producthelp.sdl.com/sdl%20trados%20studio/client_en/TM_View/Cre-Man_TM/LRG/How_to_Edit_a_Segmentation_Rule.htm

At any rate, as Heinrich was saying, you could just go the Excel (or other spreadsheet) way. If you have simple text as source, it should be a breeze to copy-paste it into a spreadsheet and automatically split the text in two columns using the colon as a delimiter.
Collapse


 
Rolf Klischewski, M.A.
Rolf Klischewski, M.A.  Identity Verified
Local time: 05:05
Member (2008)
English to German
+ ...
TOPIC STARTER
Excel Oct 11, 2017

Mirko Mainardi wrote:

Technically, since it's just about punctuation, changing the segmentation rules should do the trick (if the one you're using doesn't take the colon into account).

E.g. http://producthelp.sdl.com/sdl%20trados%20studio/client_en/Ref/A-G/AE_SegRul.htm
http://producthelp.sdl.com/sdl%20trados%20studio/client_en/TM_View/Cre-Man_TM/LRG/How_to_Edit_a_Segmentation_Rule.htm

At any rate, as Heinrich was saying, you could just go the Excel (or other spreadsheet) way. If you have simple text as source, it should be a breeze to copy-paste it into a spreadsheet and automatically split the text in two columns using the colon as a delimiter.


But can I save the file again with the colon in place?


 
Mirko Mainardi
Mirko Mainardi  Identity Verified
Italy
Local time: 05:05
Member
English to Italian
Spreadsheet versatility Oct 11, 2017

Rolf Klischewski, M.A. wrote:

Mirko Mainardi wrote:

At any rate, as Heinrich was saying, you could just go the Excel (or other spreadsheet) way. If you have simple text as source, it should be a breeze to copy-paste it into a spreadsheet and automatically split the text in two columns using the colon as a delimiter.


But can I save the file again with the colon in place?


If you use a CSV file format (for instance), you should have no problem doing that (in my case, I use OpenOffice/LibreOffice more than Excel). At any rate, in a spreadsheet it's relatively easy to manipulate text anyway, so you could even just add a new column full of ":" and then save as text, although the CSV file filter should handle that by itself if you specify the colon as a field delimiter.

Anyway, you can just try it out for yourself and see if it does what you need, the way you need it.


 
jkmsff
jkmsff
Local time: 05:05
Longer example? Oct 11, 2017

Rolf Klischewski, M.A. wrote:

I followed your advice, created a file type and put it 2nd in the list, behind SDLXLIFF. Won't work... )C:


That's strange. I've verified my pattern with your "line 1 :" example and it worked.
Maybe there's a misunderstanding about the line format. Could you post a longer example?

Screenshots:
Text file
File type settings
Project (note the file type description)
Translation editor


 
Rolf Klischewski, M.A.
Rolf Klischewski, M.A.  Identity Verified
Local time: 05:05
Member (2008)
English to German
+ ...
TOPIC STARTER
Longer example Oct 11, 2017

jkmsff wrote:

Rolf Klischewski, M.A. wrote:

I followed your advice, created a file type and put it 2nd in the list, behind SDLXLIFF. Won't work... )C:


That's strange. I've verified my pattern with your "line 1 :" example and it worked.
Maybe there's a misunderstanding about the line format. Could you post a longer example?

Screenshots:
Text file
File type settings
Project (note the file type description)
Translation editor


headline :Collectible Stickers
button quitK
button help :Help
help line 1 :Stickers are all the rage in the Dwarf Land. They are spread out all over the game and really hard to find!
help line 2 :If you manage to get all 3 stickers of a series, you're awarded a bonus.
button ok K

Sorry about the emoticons, that's not me.

[Edited at 2017-10-11 15:58 GMT]


 
jkmsff
jkmsff
Local time: 05:05
Opening pattern Oct 11, 2017

I had misinterpreted your first example and thought all lines would begin with the word "line" followed a number and a colon.

Try using the following opening pattern and everything else as before.
The pattern cuts off the beginning of every line to the first colon preceded by a blank.

^[^:]+ :

Regular Expression explained:
^ = the beginning of a line
[^:] = random character except ":"
[^:]+ = one or more random characters except
... See more
I had misinterpreted your first example and thought all lines would begin with the word "line" followed a number and a colon.

Try using the following opening pattern and everything else as before.
The pattern cuts off the beginning of every line to the first colon preceded by a blank.

^[^:]+ :

Regular Expression explained:
^ = the beginning of a line
[^:] = random character except ":"
[^:]+ = one or more random characters except ":"
Collapse


 
Rolf Klischewski, M.A.
Rolf Klischewski, M.A.  Identity Verified
Local time: 05:05
Member (2008)
English to German
+ ...
TOPIC STARTER
It works! Jan 24, 2018

Thank you so much for your help, and sorry about the REALLY late reply, you saved me and my client!!!

 


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


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

Translating lines separated by a colon ":"







Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

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 »