Translating lines separated by a colon ":"
Thread poster: Rolf Klischewski, M.A.

Rolf Klischewski, M.A.  Identity Verified
Local time: 21:55
Member (2008)
English to German
+ ...
Oct 10

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.


Direct link Reply with quote
 

Heinrich Pesch  Identity Verified
Finland
Local time: 22:55
Member (2003)
Finnish to German
+ ...
" :"? Oct 11

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.


Direct link Reply with quote
 
jkmsff
Local time: 21:55
Regular Expression Delimited Text Oct 11

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.


Direct link Reply with quote
 

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

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.


Direct link Reply with quote
 

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

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

Direct link Reply with quote
 

Mirko Mainardi  Identity Verified
Italy
Local time: 21:55
Member
English to Italian
+ ...
Segmentation rules and/or Excel Oct 11

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.


Direct link Reply with quote
 

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

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?


Direct link Reply with quote
 

Mirko Mainardi  Identity Verified
Italy
Local time: 21:55
Member
English to Italian
+ ...
Spreadsheet versatility Oct 11

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.


Direct link Reply with quote
 
jkmsff
Local time: 21:55
Longer example? Oct 11

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


Direct link Reply with quote
 

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

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]


Direct link Reply with quote
 
jkmsff
Local time: 21:55
Opening pattern Oct 11

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 ":"


Direct link Reply with quote
 


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 ":"

Advanced search







SDL Trados Studio 2017 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2017 helps translators increase translation productivity whilst ensuring quality. Combining translation memory, terminology management and machine translation in one simple and easy-to-use environment.

More info »
LSP.expert
You’re a freelance translator? LSP.expert helps you manage your daily translation jobs. It’s easy, fast and secure.

How about you start tracking translation jobs and sending invoices in minutes? You can also manage your clients and generate reports about your business activities. So you always keep a clear view on your planning, AND you get a free 30 day trial period!

More info »



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