End users

Page tree

System configuration navigation

Configuration areaSystem configuration ID in translate5
File formatsruntimeOptions.import.xlf.placeablesXpathes

Versioning

Current translate5 version7.35.5
Changelogs documented up to version7.25.1

Version Published Changed By Comment
CURRENT (v. 2) Apr 28, 2026 16:28
v. 1 Jun 15, 2025 19:23

What are XPaths?

XPath stands for “XML Path Language”. It is a query language that can be used to e.g. select, filter and analyse specific elements, attributes or text content within an XML document.

The XPath expression in the .xml block below on the left specifically targets the “PowerScan 3000” text passage, which should not be translated, but rather directly taken over into the target text.

XPath-Regel
//ph[@translate = 'no']
.xml-Code
<root>
	<segment id="2">
		<source>To install <ph equiv-text="PowerScan 3000" translate="no" locked="true"/>, follow the instructions.</source>
		<target>Um <ph equiv-text="PowerScan 3000" translate="no" locked="true"/> zu installieren, folgen Sie den Anweisungen.<target>
	</segment>
</root>

Identifying placeholders (placeables) in files during import with XPath expressions

First of all: you can use this feature for inline tags originating from various source file formats. In most cases, these would be XML files. However, in translate5, these files are first sent to Okapi for format conversion, and Okapi returns XLIFF 1.2. The process described below is based on these returned XLIFF files.

Placeables are usually marked by internal tags, allowing translate5 to recognize them in the unmasked content of an internal tag when importing Xliff files. The XPath expressions are interpreted relative to the content of the tag, which serves as the root context, rather than relative to the entire document.

If an internal tag is identified as a placeholder, it receives an additional “class” attribute with the designation “t5placeable” and the referenced content is saved in a data property: data-t5content="something".

The placeholder passages are then displayed as protected tags in the editor. However, in such a way that the translator can display them using full tag view.

The following file was used for this example: placeables_example.xliff

Application in translate5

If translate5 does not recognize all placeables in your Xliff files, you can go to the system configuration > “File formats” > “XLIFF Import: Placeables detection XPaths” to insert the XPath expressions that match your placeables.

These settings can be overwritten during import and at client level.
  • No labels