Salesforce

How to create a segmentation rule for hard return (carriage return followed by new line) in a Language Resource Template in Trados Studio

« Go Back

Information

 
Article TypeSolution Article
Scope/EnvironmentTrados Studio
Symptoms/Context
You need to create a segmentation rule for hard returns in Trados Studio using a Language Resource Template, but you do not know how this works.
Resolution

Adding a segmentation rule for an existing translation memory

  1. Open Trados Studio.
  2. Go to Translation Memory View.
  3. Click on File > Open > Open Translation Memory to add the translation memory you wish to change to the list of translation memories.
  4. Right-click on the listed translation memory and select Settings from the menu; this opens the Translation Memory Settings dialog box.
  5. Click on Language Resources.
  6. On the right-hand side highlight Segmentation Rules and press Edit.
  7. In the Segmentation Rules dialog box, click Add to open the Add Segmentation Rule dialog box.
  8. Enter for example Hard Return in the Description field.
  9. Click Advanced View.
  10. In the field Before break replace the existing regular expression with the following:
    [\w\p{P}][\r\n]+
  11. In the field After break replace the existing regular expression with a single dot:
    .
  12. Click OK several times to confirm the changes until you are back in the Translation Memory View.

The segmentation rule for hard returns will now be used when using this translation memory in translation.
 

Adding a segmentation rule to an existing language resource template

  1. Open Trados Studio.
  2. Go to the Translation Memory View.
  3. Click File > Open > Language Resource Template to add the language resource template you wish to change to the list.
  4. Right-click on the language resource template and select Settings from the menu to open the Language Resource Template Settings dialog box.
  5. Select Segmentation Rules and press Edit.
  6. In the Segmentation Rules dialog box, click the button Add to open the Add Segmentation Rule dialog box.
  7. Enter for example Hard Return in the Description field.
  8. Click Advanced View.
  9. In the field Before break replace the existing regular expression with the following:
    [\w\p{P}][\r\n]+
  10. In the field After break replace the existing regular expression with a single dot:
    .
  11. Click OK several times to confirm the changes until you are back in the Translation Memory View.

The segmentation rule for hard returns will be used when basing a new translation memory on the modified language resource template.

You can also download three example language resource templates that you can open in Trados Studio or use for your translation. They are available in the following languages:

  • English (United Kingdom)
  • English (United States)
  • German (Germany)

Download the file Language Resource Templates.zip from the attachments area of this article and extract it to a location of your choice.

NOTE
When working with XML files, you also need to select the option to  "Always preserve" whitespaces, under File > Options > File Types > [Your File Type] > Whitespaces, otherwise whitespaces are normalized and the rule does not "catch".

Root Cause
In Trados Studio a rule for segmenting text at a hard return (same as carriage return followed by new line) is not available by default. Common documents can contain such hard returns within a sentence, for example to apply a particular layout within a cell in a Microsoft Excel document.

If Trados Studio always segmented sentences with a hard return, this would lead to split sentences even if this is not wanted. However, in other and more rare cases a hard return constitutes a segment boundary, and in this case it can be useful to create a segmentation rule.
Reference
Attachment 2 
Attachment 3 
Attachment 4 
Attachment 5 

Powered by