How to Exclude Particular Text from Being Translated


XTM Cloud can be configured to exclude specific text fragments. With this configuration, text fragments are extracted from source files using regular expressions (REGEX) and converting them into inline tags or placeholders. These are called custom-variables.
One <custom-variables/> tag is used to identify one type of variable within a file. There can be more <custom-variables/> tags and they will be processed in the order that they occur in the file.

The configuration, which uses regular expressions, can be created at all three configuration levels (client, customer and project template). It cannot be configured per language. For more information about which configuration levels are available in XTM Cloud, see How can a source file be processed and what are configuration levels?.

How does the configuration work?

The configuration mentioned above (or a filter template) will exclude every word that is placed in square brackets [ ] from translation and put it in an inline tag. Text in square brackets will be visible in XTM Workbench but displayed as an inline tag which cannot be translated or affected by the Linguist.

Before the configuration is applied:


After the configuration is applied:


The inline tag is displayed in the { } Inline tags section of the docked panel.


Keep in mind that the start and end inline tags are hidden by default in XTM Workbench. The XTM International Support team would need to implement an additional configuration to make them visible.

A custom-variable (inline tag) of the kind described above can contain no more than 300 characters inside the square brackets. A filter template of this kind will not work for older projects (that were created before the configuration was applied) unless the project is reanalyzed. You cannot search for these inline tags in the translation memory (TM) base. Once you generate the target file, you will be able to find the original sentence, which will contain placeholders.

In addition, such placeholders are not sent to machine translation (MT) engines so you do not have to worry that they might be translated.

If you have TM matches in which the custom variables have not been added, and the configuration described above is implemented, these TM matches will be returned as Fuzzy matches.