Change a segment, if the segment before has certain content

I have the following situation:

In Polish the name of the color will get a different ending, depending on the gender. So I have for example for "red" "czerwony, czerwona, czerwone".

This makes it impossible to translate red to one of those in a highly repetitive file, where I have partially >2000 such position. To make this translation fast, I translated all colors like this "red = kolor: czerwony" (which simply means adding the word "color" before each color name, what makes this repetitive again, as then the name of the color does not depend on gender). This was a good idea, until the customer has changed his file. Now in some places I have this structure:

Part name
color name

which translates perfectly to

Part name
color: name

But then he added

Part name
Color
color name

and I cannot now translate like above

Part name
Color
color: name

Using the advanced display filter I could display all segments, where I have in source either color or color name (for example (Color|red|blue<yellow<brown) in source and "^color: ..." in Polish. But the problem is, I need only to change this segments, where "Color" is followed by "color: ...".

But in my view sometimes the segments do not really follow each other.

Looks like this:

 

Does anyone have an idea, how to automate this?

_________________________________________________________

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.

Parents
  • Hi Jerzy,

    I don't really follow you here.  It would help to see the real text instead of this:

    Unknown said:

    Part name
    color name

    which translates perfectly to

    Part name
    color: name

    But then he added

    Part name
    Color
    color name

    and I cannot now translate like above

    Part name
    Color
    color: name

    Or perhaps create a small file just to demonstrate the problem.  Too many "colors" and I wind up not seeing the difference in your final screenshot.  Might be just me!!

    Regards

    Paul

    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

  • To many colors, indeed :)
    The problem is hopefully obsolete here, but should I still find it, the idea now is:
    Use Notepad++ to find all subsequent segments, where one segment contains only the word "kolor" (Polish for color), which is directly followed by a segment, starting with the word "kolor:". As these segments are problematic only if the appear in target in that sequence:

    Kolor
    kolor: czerwony

    or similar (while "Kolor" is followed by "kolor:"), I shall be quite easily able to find a regex to remove "kolor:" from the second segment.

    I'm afraid this is something beyond Studio capacities, but hey - who else has so many colors?

    Best regards and thanks for looking, Jerzy

    _________________________________________________________

    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.

  • ok - I think I get it now. Thanks for elaborating. I also think Notepad++ is your best option now and you seem to have sorted 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

Reply Children
No Data