How to make only a specific content translatable in Trados 2019 Professional?

Hello, does anyone have any idea how to make a word: "network" translatable in Trados?

<meta name="search-keywords" content="network"/>

I tried to create a condition for "meta" element, but it didn't work properly. I must have done something wrong. When I made "content" translatable, I got also all other meta data translatable in Trados which I'd rather avoid. Is there a way to make it more specific?

Parents
  • This word is within the "attribute".  Attributes are typically not translated so if you need to translate one you must specify the rule to extract the content from the content attribute.  If you only want the content attribute when it's part of the meta element then you need a rule something like this:

    //meta/@content

    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

  • Hi @Paul, thank you for your quick answer. I didn't use Regex, but I made the content of the "content" attribute within the meta element translatable in the Parser of HTML5. In this way all meta content became translatable, which wasn't my intention. Please take a look at other examples, which as a result were extracted for translation in Trados:

    <meta name="generator" content="Adobe RoboHelp 2020" />
    <meta name="Originator" content="ImportMif" />
    <meta name="OriginalFile" content="C:\(...).fm" />
    <meta name="search-keywords" content="network" />

    That's why I was wondering is there a way to make the content attribute translatable only if it's paired with the "search-keywords" within the meta element, but probably it's just my wishful thinking. Should I otherwise advise the content creators to place search keywords as a plain text, not within attributes? What would you recommend? I'm in contact with them, so I'm pretty sure they will be also willing to help.

  • I didn't use regex for that, I used XPath.  However, this won't help as it will only do exactly what you have now explained.  If you could get this file as an XML file as opposed to HTML then you could solve this using XPath and specifically extracting the content attribute only when it has the sibling name="search-keywords".

    Failing that I think the best solution is to do one of two things:

    1. move this content into a new element intended only for translatable keywords, OR
    2. move this content into an attribute intended only for translatable keywords

    If this is not possible then the other solution would be to use the Advanced Display Filter and do the following:

    1. filter on the TAGs DSI
    2. lock all the segments that don't have a translatable keyword in there

    Messy though, might be faster to simply search/replace the string content="network" with the translated content in the html file itself and then don't extract this attribute at all?.

    Not sure any of this really helps?

    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
  • I didn't use regex for that, I used XPath.  However, this won't help as it will only do exactly what you have now explained.  If you could get this file as an XML file as opposed to HTML then you could solve this using XPath and specifically extracting the content attribute only when it has the sibling name="search-keywords".

    Failing that I think the best solution is to do one of two things:

    1. move this content into a new element intended only for translatable keywords, OR
    2. move this content into an attribute intended only for translatable keywords

    If this is not possible then the other solution would be to use the Advanced Display Filter and do the following:

    1. filter on the TAGs DSI
    2. lock all the segments that don't have a translatable keyword in there

    Messy though, might be faster to simply search/replace the string content="network" with the translated content in the html file itself and then don't extract this attribute at all?.

    Not sure any of this really helps?

    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