Skip to main content
Inspiring
December 29, 2020
Question

Exclude portion from machine translation

  • December 29, 2020
  • 10 replies
  • 848 views

Hi,

is there a way to exclude portions from a document from machine translation?

I want to prevent RH e.g. from translating productnames, code snippets.....

if would be nice, to excude text by format

 

is this (or sth similar) possible?

 

Thanks

 

uli

    This topic has been closed for replies.

    10 replies

    Peter Grainge
    Community Expert
    Community Expert
    August 12, 2024

    You seem to be saying you don't want variables translated but you also seem to be saying they are not part of the translation process. I must be getting something wrong. 

     

    I thought the way they work is you have different Variable Sets for each language so they would contain different values where you want them to be different and you wouldn't change the default where you don't.

    ________________________________________________________

    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Inspiring
    August 12, 2024

    No, we don't want variables to be translated. Because we don't need variants of our content we're using variables not in their inherent meaning but as a container for strings that bear some trouble in writing. Once set up as a variable, we can pick the correct writing from the variable set. Examples are:

    • Is a product registered with trademarks ® , or just ™ , or not at all?
    • Product names in our company are often a chain of strings that also are short codes containing properties, and as they are separated by blanks we would need to change them to non-breaking spaces every time they come up. Having the naming in the variables panel makes it so much easier to write about them.

    That's why we have a lot of variables in our content but treating them as constants.

     

    But the variables are carrying an attribute that withstands the machine translation attacks of browsers. This is what got me thinking about "faking" another attribute with the same handling in machine translation - even if that attribute wouldn't have any meaning in the RoboHelp UI or for generating an HTML output.

    But as I'm considering the way to integrate that attribute into existing content or while writing I think this wouldn't make any difference to the HTML attribute translate="no".  Both ways, we would need to switch to the code view to set that attribute, because it's not CSS but HTML. The only way to make this easier is a change in the RoboHelp editor itself.

    Inspiring
    August 12, 2024

    Hi there, 

    I'm butting into this (quite old) discussion with an addendum to the HTML standard attribute that @Stefan Gentz mentioned:
    We wanted to use that attribute to prevent machine translation of product names tec. in our published Frameless output that comes as a browser feature nowadays. In fact, users are constantly triggered to translate websites into the language that is the standard in their browser settings.
    All in all machine translation is a good feature for the seldom-translated languages, and it won't go away soon. In Europe, the accessibility of online information gets more and more regulated, e.g. in Germany the "Barrierefreiheitsstärkungsgesetz" becomes effective in less than a year from now.

    First we added the translate="no" attribute to the respective <span> styles we use at those parts of text in our content. That was easy - but it didn't work the way we wanted because the attribute doesn't show up in the Frameless output then. Then we understood: What we did was adding not an HTML attribute but a CSS attribute that has a different meaning (as Stefan Gentz mentioned above). So it's necessary to set that attribute at each and every tag manually in code view.

    Or is it worth a feature request to keep the attribute when generating an HTML-based output?

    Inspiring
    August 12, 2024

    Ah, I forget to tell this:
    We're using variables for some product names, even if those a constants in our context. But these variables aren't touched by machine translation in the browser, even if we didn't add an attribute there. That means: if there would be a simple feature in RoboHelp to "mark" such content by means of a tag containing a data-xyz attribute (like data-keyref that comes with variables and even stays in the output) then browsers would leave those parts of the content untranslated:

    <span data-keyref="Product_name_here" _istranslated="1">Product name</span>

    The _istranslated="1" attribute only shows at those tags built from variables if you let the browser translate the page and look into the code that is momentarily displayed then.

     

    I'm wondering if making up a data-whatever attribute at tags that has no meaning would do trick as well... 😉

    Peter Grainge
    Community Expert
    Community Expert
    January 1, 2021

    Just to add for clarity as this applies to other scenarios,

    • If you want to apply a property to some text within a paragraph, select it and apply the property, such as "don't translate" or apply a colour.
    • If you want to apply that same property to the whole paragraph, don't select the paragraph, just click in it and then apply the property.

     

    I believe that is correct and Stefan will confirm.

    ________________________________________________________
    See www.grainge.org for free Authoring and RoboHelp Information

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Community Manager
    January 1, 2021

    Hi Uli,

     

    this is what the translate attribute is for.

     

    https://www.w3.org/International/questions/qa-translate-flag.en

     

     

    <p>To indicate your translation tool to protect the following term from translation, you can use the translate="no" attribute: <span data-keyref="Product Name" translate="no">MyFanceProductName</span>.</p>
    <p translate="no">This whole paragraph will not be translated.</p>

     

     

    As discussed earlier in this thread, this is what the translate setting in the properties panel does.

     

    BTW, if you want to select a whole paragraph, just click into iti, and then click on "p" in the breadcrumbs navigation at the top of the editing window.

     

    If the MT system is fully HTML5 compliant, they should respect the translate attribute and exclude the the string from translation. If not, it might need to be configured to respect the translate attribute. A professional tool like SDL Trados Studio has a filter framework that can be configured with XPATH, so that you can you use a simple XPATH rule like //*[@translate="no"] to exclude/protect text marked with translate="no".

    I

    ulibbAuthor
    Inspiring
    January 1, 2021

    Hi Stefan,

     

    thanks for explanation. Works.

    But it would be nice, if it would be possible to tell Robohelp, to set the Translation-flag automatically, when a style is applied. FOr example: I discuss in a topic the settings, that can be made in a xml-config-file. The lines from the xml are formatted with a specific style. It would be nice, if Rh would apply the translation attribut automatically. Ok, there are alternatives as i could set it every time manually or run through all the HTML-files and add the attribute, when style is applied.

    I think it would be nice, if Rh could do that. I plan to use the Rh-integrated mt functionality.

     

    uli

    ulibbAuthor
    Inspiring
    December 31, 2020

    https://tracker.adobe.com/#/view/RH-8457

    Feature request for no-translate-attribute at styles

    Community Manager
    January 1, 2021

    As mentioned in my other reply, the standards-compliant way is to use the HTML5 translate attribute.

     

    Also, note that "translate" is already reserved in CSS for a different purpose (repositioning of elements; see here). Therefore no-translate would be very confusing. But more importantly: It would not be of any help to introduce such a proprietary vendor extension in addition to an already existing attribute definied in the standard – no external translation system would know this proprietary vendor extension and therefore igonore it.

    Inspiring
    August 13, 2024

    It seems as if text from variables in the Frameless output still has the "data-keyref" property at its <span> and therefore is left untouched by machine translation tools. Those kinds of <span> are used by RoboHelp a lot:

    • data-keyref for variables
    • data-conref for snippets
    • data-glossterm for glossary terms
    • data-condition for condition tags that work as filter criteria in the content 
    • data-expanded, data-open-text and data-close-text for expanding text sections
    • data-rhwidget, data-targetname, data-target, data-open-text and data-close-textdrop-down sections
    • data-thumbnail for images that shall be shown as a thumbnail first
    • data-type and data-topics for related-topics and see-also sections

    I didn't check all of them in an output that was translated by browser tools but I'm pretty sure that some of them are going into the HTML output. The text part surrounded by <span> tags with those data-xyz property is left untouched by machine translation tools because they don't know the meaning of those proprietary data-xyz property.

    If Adobe doesn't want to set up another proprietary thing for something that is available in the HTML5 standard, then this would be the angle to work with.

    Instead of switching into code view for each and every string you want to keep untranslated and set up a <span translate="no">...</span> you can just set those strings up as variables in all your variable sets.

    Peter Grainge
    Community Expert
    Community Expert
    December 31, 2020

    To the best of my knowledge there is no built in way to exclude a style. It sounds like a good feature request though.

     

    Please follow this link to request features. https://tracker.adobe.com

     

    Post the link to your feature request in this thread and others can vote for it. The more people who do so, the higher it gets prioritised.

    ________________________________________________________
    See www.grainge.org for free Authoring and RoboHelp Information

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    ulibbAuthor
    Inspiring
    December 31, 2020

    Hi Peter,

     

    yes, that works (setting the <span..... manually).

    Question: What is the best practice, to make sure, that text formatted with a specific style is never translated? Develop a script and let it run before translation?

     

    Thanks for great help!

    uli

    Peter Grainge
    Community Expert
    Community Expert
    December 31, 2020

    RoboHelp has an issue with how you select text in some operations. For example, if you double click a paragraph and press Delete or Backspace, the formatting of that paragraph will be applied to the following or previous paragraph. It's a reported bug. Drag across the same text and it's OK.

     

    I'm wondering if something like that is at play? Try it.

     

    If not, apply the exclusion to some text and go into code view. Try applying the same code to the paragraph.

     

    Please let me know if that works.

    ________________________________________________________
    See www.grainge.org for free Authoring and RoboHelp Information

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    ulibbAuthor
    Inspiring
    December 31, 2020

    Hi Peter,

     

    thanks.

    This works, when i select a word (or more), but when i select a whole paragraph, the option disappears, see screenshot

    Hmmmmmmmm......???

     

     

    uli

    Peter Grainge
    Community Expert
    Community Expert
    December 30, 2020

    Select the text that is not to be translated and then go to Properties > General > Attributes > Translate. Set to No.

     

    ________________________________________________________
    See www.grainge.org for free Authoring and RoboHelp Information

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.