Replace empty target segments with a space?

We really like the new filtering option introduced in 2021 (and also in the Community advanced display filter for 2019). But there is one thing that we haven’t discovered how to do and that we often need to do: Filter after empty segments. Is there any way to do that? And ideally also insert a specific content (e.g, a space) into all segments that correspond to your filtering.

  • Typically empty segments would be "Not Translated":

    Trados Studio interface showing two segments with 'Not Translated' status and a search bar with regex '$' entered.

    So easily filtered.  But sometimes they may be empty and not have the status "Not Translated" in which case it now becomes trickier.  So here you could search for a regex like this in the target:

    ^$

    Trados Studio interface with a 'Replace' dialog box open, showing an empty 'Search for' field and 'Replace with' field containing a space.

    So also not too tricky.

    And ideally also insert a specific content (e.g, a space) into all segments that correspond to your filtering.

    That should be simple... or so I thought.  But it's actually not simple because you can't replace the results of a search that finds nothing, with something.

    So I have a question here... why is this important?

    Tagging two people I'm pretty sure mentioned this in the past...

    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


    Generated Image Alt-Text
    [edited by: Trados AI at 3:46 AM (GMT 0) on 5 Mar 2024]
  • Hi ,

    Interesting. Although the regex works fine in either display filter, it doesn't work in the Find (or Replace) dialog. It doesn't even FIND a target segment containing nothing, using ^$:

    Trados Studio Find and Replace dialog box with regex $ entered in 'Find what' field, 'Current Document' selected, 'Target' radio button selected, and 'Regular expressions' checkbox checked.

    I didn't know that. Any other regex I've used in the Find tool has worked OK. For example, a search for ^\s$ works just fine at finding a segment with only a space in it.

    Hmmmm! Let me have a think about this...

    All the best,

    Ali Smiley

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 3:47 AM (GMT 0) on 5 Mar 2024]
  • There are several other situations where the standard Find/Replace regex support "misbehaves". It is frustrating because Find/Replace has some advantages compared with the Display Filters, principally marking the matched elements and, of course, replace functionality.

  • Perhaps you could provide some clear examples?

    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

  • One example, that should search for repeated words, matches all wordsScreenshot of Trados Studio's 'Find and Replace' feature with a search for 'matches all words' showing an error message that the text box is empty.

    Another example I had seems to have been fixed.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 3:47 AM (GMT 0) on 5 Mar 2024]
  • Indeed... that should work.  Just in case you weren't aware you can workaround this using named backreferences... for example:

    \b(?<repeat>\w+)\s+\k<repeat>\b

    Thanks for the feedback though, we should fix this as named backreferences are a little more advanced and not all users would know this.

    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

  • In first place it would be interesting to know, why the segments are empty... For all file types I know the only "empty" content are tags. But I have never seen a segment with zero content having been made available by any file type.

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

  • In reality every filetype is capable of opening up in Studio without any target content.  Of course you can populate everything with TM matches, MT or even a copy of the source.  But in this case I am just trying to answer the question in my mind which is if you have a project containing empty segments, then what's the usecase for adding a space?

    I think populating them all is easy, but then how would you know which ones needed to have the space instead of text (assuming this is what's important here).  I guess where the source equalled the target it might be the right ones, but I'd like to understand why this whole thing is needed in the first place.  I think it's probably related to what said in the other thread:

    https://community.sdl.com/product-groups/translationproductivity/f/elevate/38228/reporting-spaces-in-draft-translation/125220

    But I'd like to make sure.

    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

  • In reality every filetype is capable of opening up in Studio without any target content.

    In such cases I always assume something is wrong with the file type. In fact I have never seen an empty segment on source side. I have seen file with no content = no segments. But if there are segments, there is always some content on the source side. The question is, why to put a space on target side instead of proper translation? The answer by Alison you mention in your post may indeed be here the answer, because we are seeing this on daily basis. Also in case someone is translating a PDF directly in Studio or using a crappy conversion there may be a lot of segments which are either badly segmented or do not need translation (dirt on paper interpreted as letters). in such case, however, I would simply at least lock such segments. Then the QA checker would ignore these. But changing to "sign-off rejected" and then locking is really the best way. You can ignore such segments, have them reported as separate category, you see the number of words in such segments in editor and such segments will not be imported in any case in your TM. On top of this such segments will never be changed in any Studio process—translation, revision or sign-off.

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

  • In fact I have never seen an empty segment on source side.

    Me neither... except when they come from WorldServer where I have seen this before.  But this is not what this question is about.

    in such case, however, I would simply at least lock such segments. Then the QA checker would ignore these.

    Indeed.  But as I hoped you'd understand, I'm not looking for workarounds, I think I could figure them out.  I'm interested in why they are even needed so we can see what the importance is for changing the behaviour in Trados Studio so a workaround isn't needed in the first place.

    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

1 2