Translate only specific text with a particular pattern (txt file)

Hello all,

In the sample below, we would like to translate only the red text from the text exists in {{curly}} brackets.

<li>Klicken Sie {{clik|ff|OK}} und {{clik|OK}}.</li>
==some text here {{click|..\path}} bzw {{click|..\path}} some other text here.==

<ol>some text here [[click|..\path]] bzw [[click|text|..\path]] some other text here.</ol>

(tags and "==" have been already taken care of).

Is there a quick way how to do that? Please note that source is in txt format.

/cfs-file/__key/communityserver-discussions-components-files/171/custom_5F00_txt.zip

/cfs-file/__key/communityserver-discussions-components-files/171/test.zip

Thanks!

Parents


  • This was a really complicated regex question for me and I couold not do it. But I did get some help from the developer of regex buddy ;-)

    (?:[^OK.\\path]|O(?!K)|(?<!O)K|\.(?!\.?\\path)|\\(?!path)|(?<!\.\.)\\|p(?!ath)|(?<!\.\.\\)p|a(?!th)|(?<!\.\.\\p)a|t(?!h)|(?<!\.\.\\pa)t|(?<!\.\.\\pat)h)+

    He also provided some very valuable comments and I will raise an idea for this as it makes complete sense:

    "You can achieve what you want with a single regular expression. It's a very laborious solution. You need to spell out everything at the character level. For any of the characters in OK or ..\path you need to spell out what cannot come before them or cannot come after them so that your regex will match these characters if and only if they are not part of OK or ..\path. If you have many things to exclude this quickly becomes far too complicated.

    What you really need is a negation option in your application so that you can use the simple regex OK|\.\.\\path to match OK or path and then have your application take everything except those matches."

    The negation option, as we have already added to the Community Advanced Display Filter, makes complete sense and would be a very nice addition to the filetypes that support the use of regex for tagging non-translatable content.

    Hope this helps though... and if you have variants of the example source you provided I can only say "good luck!".

    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


  • This was a really complicated regex question for me and I couold not do it. But I did get some help from the developer of regex buddy ;-)

    (?:[^OK.\\path]|O(?!K)|(?<!O)K|\.(?!\.?\\path)|\\(?!path)|(?<!\.\.)\\|p(?!ath)|(?<!\.\.\\)p|a(?!th)|(?<!\.\.\\p)a|t(?!h)|(?<!\.\.\\pa)t|(?<!\.\.\\pat)h)+

    He also provided some very valuable comments and I will raise an idea for this as it makes complete sense:

    "You can achieve what you want with a single regular expression. It's a very laborious solution. You need to spell out everything at the character level. For any of the characters in OK or ..\path you need to spell out what cannot come before them or cannot come after them so that your regex will match these characters if and only if they are not part of OK or ..\path. If you have many things to exclude this quickly becomes far too complicated.

    What you really need is a negation option in your application so that you can use the simple regex OK|\.\.\\path to match OK or path and then have your application take everything except those matches."

    The negation option, as we have already added to the Community Advanced Display Filter, makes complete sense and would be a very nice addition to the filetypes that support the use of regex for tagging non-translatable content.

    Hope this helps though... and if you have variants of the example source you provided I can only say "good luck!".

    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

Children