Automatic replacement of variables, numbers, dates, etc.

Dear Community:

I often have to deal documents that contain lots of numbers and alphanumeric combinations. And Trados always changes something. I use regex to filter the segments containing ONLY these "non-translatables", and it works quite good (though some combination are still not included, the topic for my next thread:). So, where filter can be applied, the issue easy to fix.

However, many text segments contain these alphanumerical combinations, for example: "Medir la polaridad de las baterías en las bornas +42.03-HA.03-Q100-XH5 (+) y +42.03-F111-XH6 (-)  y comprobar que es correcta." When looking through the pretranslated results, errors are found in 95% of cases, Trados changes a number/numbers or a symbol.

So to avoid this I usually deactivate the automatic replacement of all these numbers and variables in the memory settings of a particular project: 

Trados Studio project settings window showing options for automatic substitution including dates, numbers, alphanumeric chains, measurements, variables, and symbols.

However, this is only applicable to this particular project, and cannot be changed from the General settings of Studio. I mean, I did the same here (actually it led me to the same list of TMs):

Trados Studio general settings window with options to activate or deactivate automatic substitution for dates, times, alphanumeric chains, numbers, measurements, variables, and symbols.

But the result was: if the varibles are unticked from the project configurations but remain activated in the general settings, Trados stops "recognizing" them, however, if they are deactivated in the general settings but activated in those of a particular project, Trados sees them.

Can anyone explain how it works? Because what I do is disconnect this automatic replacement at the project creation stage. And I would  like to define this feature for all my translation projects

And then another question: what do "variables" mean in the list of variables?:)

To me, numbers and dates ARE variables...however, if I choose to deactivate the Variables option only, Trados still reads all this stuff.

Thanks in advance!!!



Generated Image Alt-Text
[edited by: Trados AI at 10:58 AM (GMT 0) on 29 Feb 2024]
emoji
  • If the program recognizes a token (number or alphanumeric string), it places it (must place it) in the target text directly. What´s the point of doing any "automatic replacement" then? And if Trados is programmed to copy these categories of tokens as they are, why do I have so many errors in my tranlsations?

    What did you do so Trados copied the source to Target?

    No, I did nothing, but, if I understand it correctly, a token of this kind is something that does not need translation, so , if recognized as such, must be just copied and inserted in the target segment as it is....

    emoji
  • \d+\.\d+-\w+\.\d+-\w+-\w+\s\(\+\)

    This issue is hopeless, does not even recognize the strings I have in the text: 

    Screenshot of Trados Studio showing translation segment errors with mismatched strings 'd18, b18 y z18' and 'd16, b16 y z16'.

    Screenshot of Trados Studio with a search bar containing a regular expression and translation segments below.

    Will read all these posts once again, of course, and for the time being: Automatic replacement disconnected and manual correction....

    Thank you very much,  and   for your help!

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 11:00 AM (GMT 0) on 29 Feb 2024]
  • Why would you even expect that expression to match what you have shown? I think you need to learn a little about regular expressions so you can use them properly. If you don’t‘ you’ll forever have problems and will always be guessing while you have no idea what you’re using.  They look complicated, but actually they are not and if you take the time to break down the one I created and understand why it matched the examples I provided you’ll definitely understand why it won’t match the text you have shown here.

    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
  •  

    ok - apologies for that rather abrupt response... was on my phone and didn't think I would find time this evening.  Let me try and explain that expression.

    First of al it was an expression designed for use in the RegexAutoSuggest Provider so I omitted the "+" character in the string I was matching for reasons I explained above.  If I wanted to just match this:

    +42.03-HA.03-Q100-XH5

    Then there are many ways to do it.  One way might be this

    \+\d+\.\d+-\w+\.\d+-\w+-\w+\s\(\+\)

    If I break this down:

    \+ (this matches the+ character. A + has a special meaning in regex so I have to escape it to match it as a character which I did with the backslash)

    \d+ (\d matches a number, and the + in this case tells the regex engine to match one or more until you don't find any more.  So this would match the 42)

    \. (a dot (.) also is a special character so to match the dot I have to escape it, again with the backslash)

    - (this just matches the - character.  You can also be literal with regex, so this would also match the exact string with regex: \+42\.03-HA\.03-Q100-XH5)

    \w+ (\w matches a “word character” like numbers and letters for example, and the + in this case tells the regex engine to match one or more until you don't find any more.)

    \s (this matches a single space)

    \( (round brackets also have a special meaning so to match the brackets I have to escape them)

    \) (as above)

    Using these definitions you can probably see how the expression works, and also hopefully why this expression would not match this:

    +42-A208-S10-X1

    To match this I could use something like this:

    \+\d+-\w+-\w+-\w+

    Just work your way through the sequence and try to understand how this would match it:

    \+ (matches the +)

    \d+ (matches 42)

    - (matches the -)

    \w+ (matches A208)

    - (matches the -)

    \w+ (matches S10)

    - (matches the -)

    \w+ (matches X1)

    So you cannot just take an expression created for something else and expect it to work, unless the pattern you are matching is the same.

    You can also write this several ways depending on how strict you think you need to be.  For example this would also do it:

    \+\d{2}-[A-Z]\d{3}-[A-Z]\d{2}-[A-Z]\d

    And there are many other ways to do it as well.  Hopefully that makes some sense for you ad you can see that matching simple strings like this isn't too hard.

    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
  • Dear @Paul! First of all,  why do you apologize? What you said is true, and, besides I have created a good mix of unrelated or very remotely related subjects in one thread, so it´s me who owes an apology...

    The explanations are excellent, so, in the first place, I will improve the regex I use to filter the segments in our projects. And the way you deliver this information is very clear!!! Will get back to this thread with a feedback when I am done with this "homework".

    And sorry for the late answer (holidays+work....)

    Best regards!!!

    emoji