How to prevent merging segments in SDL Trados Studio

Hi, is it possible to prevent merging segments within same paragraph when creating a project in SDL Trados Studio and sending a package for translation? Further question if we cannot prevent merging segments, is there a way to check if segments have been merged? I know that you can open an sdlxliff file in Studio and visually check if the segment numbering is continous, but is there a way to automate the check?

Many thanks

Jouni

emoji
Parents
  • "Probability score": 0.7

    "Question improvement suggestion": Please provide more information about the version of Trados Studio you are using, the type of documents you are working with, and any recent changes you have made to your system or software. This will help us provide a more accurate solution.

    In the meantime, based on the information you have provided, here is a suggested answer to your question:

    Hello Jouni,

    To prevent merging segments within the same paragraph when creating a project in Trados Studio, you can adjust your segmentation rules. Here's how:

    Step 1: Open Trados Studio.

    Step 2: Go to "File" > "Options" > "Language Pairs" > "All Language Pairs" > "Segmentation".

    Step 3: Click on "Edit Rules".

    Step 4: In the "Segmentation Rules" dialog box, you can modify the existing rules or add new ones to prevent segments from merging.

    As for checking if segments have been merged, there isn't a built-in feature in Trados Studio to automate this process. However, you can visually check if the segment numbering is continuous, as you mentioned.

    Please note that the segmentation rules can vary depending on the language pair and the type of document you are working with. Therefore, it's important to review and adjust your segmentation rules accordingly.

    I hope this answer addressed your question. If not, please reject the answer, add the question improvement suggestion information, and click the RWS Community AI checkbox on the right to try again.

    RWS Community AI

    emoji
  • Thanks AI, but I would need a bit more info. SDL Trados Studio version is 2019 or later, and at least in 2019 there is no Segmentation setting in File>Options>Language Pairs>All Language Pairs. And this would probably apply to all projects, but If I want to prevent merging segments in a particular project, is that possible in any way?

    Jouni

    emoji
  • "Probability score": 0.8

    "Question improvement suggestion": Please provide more information about the type of documents you are working with and any recent changes you have made to your system or software. This will help us provide a more accurate solution.

    In the meantime, based on the information you have provided, here is a suggested answer to your question:

    Hello Jouni,

    In Trados Studio 2019 or later, the segmentation rules are indeed not located under "File > Options > Language Pairs > All Language Pairs". Instead, you can find them under "File > Options > Language Pairs > [Specific Language Pair] > Segmentation".

    If you want to prevent merging segments in a particular project, you can create a specific language pair for that project and adjust the segmentation rules accordingly. Here's how:

    Step 1: Open Trados Studio.

    Step 2: Go to "File" > "Options" > "Language Pairs".

    Step 3: Click on "Add" to create a new language pair.

    Step 4: Select the source and target languages for your project.

    Step 5: Click on "Segmentation" under this new language pair.

    Step 6: Click on "Edit Rules".

    Step 7: In the "Segmentation Rules" dialog box, you can modify the existing rules or add new ones to prevent segments from merging.

    Please note that these settings will only apply to the specific language pair you have created, and therefore only to the projects where this language pair is used.

    I hope this answer addressed your question. If not, please reject the answer, add the question improvement suggestion information, and click the RWS Community AI checkbox on the right to try again.

    RWS Community AI

    emoji
  • Does anyone have more info and perhaps an idea how you can prevent merging sentences within paragraphs by editing the default segmentaton rules (or in any other way.).

    Thanks
    Jouni

    emoji
  •  

    Why don’t you insert a screenshot of the segments merged and explain where it should be split?

    emoji
  • Thanks Jesús for your comment! I do not have screen-shot, this is more like a generic question of how to prevent translator to merge segments in SDL Trados Studio. I have a feeling that it is not possible. I am looking a setting that would not give permission to merge segments when translating content in SDL Trados Studio.

    Regards

    Jouni

    emoji
  •  

    Oh, sorry, I had missunderstood!

    There is no way to prevent the translator for merging segments (more on this below), but you can verify if he/she has done that (which is your 2nd question). 

    To check if the translator has merged segment, go to the Advanced Display Filter, select the Segment tab, tick the following check boxes, and press Apply Filter:

    Screenshot of Trados Studio's Advanced Display Filter 2.0 with 'Merged segments' and 'Merged across paragraphs' options checked.

    If there are merged segments, those segments are merged (you’ll note some segment numbers missing if you remove the filter).

    Last, you can “prevent” the translator from merging segments across paragraphs if you set the project like that:

    Screenshot of Trados Studio's Project Settings showing 'Sample Project 2' with 'Allow source editing' checked and 'Enable merging segments across paragraphs' unchecked.

    or like that:

    Screenshot of Trados Studio's Project Settings showing 'Sample Project 2' with 'Allow source editing' unchecked and 'Enable merging segments across paragraphs' unchecked.

    But nothing prevents the translator to change the projects settings to:

    Screenshot of Trados Studio's Project Settings showing 'Sample Project 2' with both 'Allow source editing' and 'Enable merging segments across paragraphs' checked.

    So back to square one: you can’t prevent translators from merging segments.

    emoji


    Generated Image Alt-Text
    [edited by: RWS Community AI at 4:20 PM (GMT 0) on 24 Feb 2025]
  • Brilliant! I did not realize to check the Advanced Filter settings! This helps a lot.

    Jouni

    emoji
Reply Children
  •  

    And in case it's useful... here's a python script you can run on a folder with SDLXLIFF files in it:

    import os
    import xml.etree.ElementTree as ET
    from pathlib import Path
    
    def parse_sdlxliff_file(file_path):
        try:
            tree = ET.parse(file_path)
            root = tree.getroot()
            
            namespaces = {
                'sdl': 'http://sdl.com/FileTypes/SdlXliff/1.0',
                '': 'urn:oasis:names:tc:xliff:document:1.2'
            }
            
            results = []
            for trans_unit in root.findall('.//trans-unit', namespaces):
                seg_mrk = trans_unit.find('.//seg-source/mrk[@mtype="seg"]', namespaces)
                segment_id = seg_mrk.get('mid') if seg_mrk is not None else "Not found"
                
                source_elem = trans_unit.find('source', namespaces)
                source_text = source_elem.text if source_elem is not None else "Not found"
                
                merge_status_elem = trans_unit.find(
                    './/sdl:seg-defs/sdl:seg/sdl:value[@key="MergeStatus"]', 
                    namespaces
                )
                merge_type = merge_status_elem.text if merge_status_elem is not None else None
                
                if merge_type in ["MergedParagraph", "MergedSegment"]:
                    results.append({
                        'segment_id': segment_id,
                        'source_text': source_text,
                        'merge_type': merge_type,
                        'filename': file_path.name  # Add filename from the path
                    })
            
            return results
            
        except ET.ParseError:
            return []
        except Exception:
            return []
    
    def process_sdlxliff_folder():
        folder_path = input("Please enter the folder path containing sdlxliff files: ")
        
        if not os.path.isdir(folder_path):
            return
        
        sdlxliff_files = list(Path(folder_path).glob('*.sdlxliff'))
        
        for file_path in sdlxliff_files:
            results = parse_sdlxliff_file(file_path)
            
            for result in results:
                print(f"File: {result['filename']}")
                print(f"Segment #{result['segment_id']}:")
                print(f"Source: {result['source_text']}")
                print(f"Merge Type: {result['merge_type']}")
                print("-" * 50)
    
    def main():
        try:
            process_sdlxliff_folder()
        except KeyboardInterrupt:
            pass
    
    if __name__ == "__main__":
        main()

    Returns something like this:

    Please enter the folder path containing sdlxliff files: c:\Users\pfilkin\OneDrive - RWS\Documents\SDL\TESTING\Jouni Jakonen\Merged Segments\


    File: 02 - merged.xlsx.sdlxliff
    Segment #2:
    Source: Parameter Specification
    Merge Type: MergedParagraph
    --------------------------------------------------
    File: 02 - merged.xlsx.sdlxliff
    Segment #7:
    Source: 50 Hz Capacity
    Merge Type: MergedParagraph
    --------------------------------------------------
    File: 04 - merged.docx.sdlxliff
    Segment #49:
    Source: The Green Future Wind Farm is a sustainable project that aligns with global climate goals. By implementing robust mitigation measures, the project aims to minimise environmental impact while maximising clean energy production.
    Merge Type: MergedSegment
    --------------------------------------------------

    Could be helpful if you have a lot of files and don't want to have to manually check every one.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji