Conditional text from Help+Manual

Hello!

I am looking at Trados to translate user manuals created with the help of the Help+Manual tool. The problem is that this tool generates quite specific XML files.

I have some conditional text in the created manuals that should not be translated. How is it possible to mark that text or conditions so that they are visible or non-translatable?

Here is an example:

<para styleclass="Normal"><conditional-text type="IF" value="CHM"/><text styleclass="Normal" translate="true">Sample text non-translatable.</text><conditional-text type="END"/></para>

The tags that mark conditional text are highlighted bold, and the text is in italics.

Also how is it possible to mark placeholders that should be left as is? For example, <%NOW%>

  • Can you provide a better example?  This is a little unclear... for example.

    <text styleclass="Normal" translate="true">Sample text non-translatable.</text>

    Your sample text is non-translatable but the translate attribute is set to true?  Is this really how it is?

    What values for the conditional text are to be used to define whether the text within the <text> element should be translated or not?

    Can you provide an example inside the appropriate translatable text of where this placeholder would be?  Are they inline placeholders?

    These things should be possible one way or t'other.  But better information would make it easier to give you something that will work for you.

  • <text styleclass="Normal" translate="true"

    these tags are in the original file and they are generated automatically by Help+Manual, and they should not be taken into account. The only tags that define conditions are CONDITIONAL-TEXT tags, as marked in my sample. In between them can be anything.

    The value of the VALUE attribute defines which text should be translated, for example, if VALUE="CHM", the text should not be translated. If VALUE="HTML", it should be translated.

    Also there are placeholders <%VERSION%> and <%NOW%> in the example below

    Here is a full example:

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
    <topic template="Default" modified="2020-09-22T15:54:47.571+03:00" lasteditedby="Julia.Samarska" xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
    <title translate="true">API</title>
    <body>
    <header>
    <para styleclass="Heading1"><text styleclass="Heading1" translate="true">Overview</text></para>
    </header>
    <para styleclass="Normal"><conditional-text type="IF" value="CHM"/><text styleclass="Normal" translate="true">Sample under condition CHM non-translatable</text><conditional-text type="END"/></para>
    <para styleclass="Normal"><conditional-text type="IFNOT" value="HTML"/><text styleclass="Normal" translate="true">Sample under condition HTML translatable</text><conditional-text type="END"/></para>
    <para styleclass="Normal"><text styleclass="Normal" translate="true">Text </text><link displaytype="text" defaultstyle="true" type="topiclink" href="VeoApi.GettingStarted" styleclass="Normal" translate="true">Link</link><text styleclass="Normal" translate="true"> more text</text></para>
    <para styleclass="Heading2"><text styleclass="Heading2" style="font-family:Verdana; font-weight:bold; vertical-align:baseline; color:#000000;" translate="true">See Also</text></para>
    <para styleclass="Normal"><link displaytype="text" defaultstyle="true" type="topiclink" href="VeoApi.GettingStarted" styleclass="Normal" translate="true">Getting Started</link></para>
    <para styleclass="Normal"></para>
    <para styleclass="Normal"><text styleclass="Normal" translate="true">Version: API ver. </text><var styleclass="Normal">&lt;%VERSION%&gt;</var><text styleclass="Normal" translate="true">, </text><var styleclass="Normal">&lt;%NOW%&gt;</var><text styleclass="Normal" translate="true">.</text></para>
    </body>
    </topic>

  • Your xml is invalid... but I think you want something like this:

    //text[not(preceding-sibling::conditional-text/@value='CHM')]

    That should get all text elements unless they are preceded by a sibling where the value attribute is CHM.

    To handle the variables you need to make sure you create your custom XML using the "XML (Legacy Embedded Content)" filetype:

    This is the only one that will let you use regex to catch placeables... like this:

    So my filetype was actually this:

    Gets me a preview like this:

    If I want to see the variables then I just need to change the segmentation  hint:

    Just a note.  You could also use the newer XML filetypes for this but it requires additional steps as you need to use the embedded content processor with a separate filetype as opposed to doing the same thing in the XML filetype you have created.