File Import settings

Multilingual XML Files

Introduction

Memsource only supports XML files that have both source and target elements present for all paragraphs (even if the target is empty). The individual language elements must all be descendants of the same trans-unit element and one language cannot be contained in the other (see the example below).

File Type must be specified in order to distinguish multilingual XML from monolingual XML.

When the source and target segmentation are different, the source segmentation is determining.

Multilingual XML Sample

Sample of partially translated text from English to German and French. Note that all <tuv lang="en">, <tuv lang="de"> and <tuv lang="fr"> are children of the same <tu> element.

<?xml version="1.0" encoding="utf-8"?>
<root>
Not translatable text.
<tu note="context note" key="ID 254" maxlen="16"> 
  <tuv lang="en">
    <seg>First segment.</seg>
  </tuv>
  <tuv lang="de">
    <seg>Erste segment</seg>
  </tuv>
  <tuv lang="fr">
    <seg></seg>
  </tuv>
</tu>
<tu note="another context note" key="ID 255" maxlen="18"> 
  <tuv lang="en">
    <seg>Second segment.</seg>
  </tuv>
  <tuv lang="de">
    <seg></seg>
  </tuv>
  <tuv lang="fr">
    <seg></seg>
  </tuv>
</tu>
</root>

Multilingual XML Import Settings

 For the import of Multilingual XML files, the XPath query language must be used.

See the sample Multilingual XML above and its import settings on the screenshot.

  • Elements containing source and target sub-elements: //tu
  • Elements containing source text: tuv[@lang='en']/seg (in relation to the parent element //tu)*
  • Elements containing target text (de): tuv[@lang='de']/seg (in relation to the parent element //tu)*
  • Elements containing target text (fr): tuv[@lang='fr']/seg (in relation to the parent element //tu)*
  • Non-translatable inline elements: (all elements in source or target are considered Translatable inline elements unless specified here as Non-translatable inline elements)*
  • Convert to Memsource tags (use regexp): (see our Regexp page for help)
  • Context key - value that constitutes TM context (101% match) if applicable*
  • Context note - import element or attribute of context for each element*
  • Max. target length - import element or attribute of max. target length for each element*
  • Convert to character entities - enter a comma separated list of character references required in the output file. For example when you want quotes " represented as &quot; and character Σ represented as &#x3A3; use &quot;,&#x3A3;. Please note that & and < are always exported as &amp; and &lt;.
*Xpath is relative to "Elements containing source and target sub-elements:" and only sub-elements in this parent element are evaluated.

 
Multilingual XML Import Rules


Please note that the XPath expression should define the elements which text/value should be translated and not the actual text node.

See more information on XPath.

HTML Subfilter

XML files with html tags (such as &lt;p&gt;) can be imported with option HTML Subfilter. In this case it is possible to set additional setting in the HTML (such as Break tag (<br/>) creates new segment).

Please note that paragraph tags (such as &lt;p&gt;) will create a new segments even if the Segment Multilingual XML is unselected.

It is important that target (unless is empty) has the same HTML structure as source, otherwise it can result in different segmentation of source and target and can cause troubles (target paragraph might be replaced with source paragraph).

 
HTML settings 

File Type

 The Multilingual XML file filter will imports files only when it is specifically selected in Import Settings:
  • File Type: Multilingual XML

 
File Type

Jobs in Project

Multilingual jobs have a slightly different icon then general XML jobs so they are easily distinguished from monolingual jobs.

If the file was imported as multilingual into several target languages, the Completed file will be always composed from all the target languages.

 
File Type

HTML Preview with XSLT stylesheet

Multilingual_XML_preview.png

XSLT Preview File

XSLT language (Extensible Stylesheet Language Transformations) can be used to transform XML documents into HTML format for in-context preview purposes. Memsource currently supports XSLT 2.0.

To import the Multilingual XML file with a stylesheet (XSL or XSLT), simply navigate to the bottom of the Multilingual XML import settings and choose an XSLT file. When you import an XML with a stylesheet, the Preview Translation (Document -> Preview Translation) in Memsource Desktop Editor will generate an HTML preview instead of an XML one (video). Once used for file import, XSLT can also be downloaded from the file import settings page.

Download_XSLT.png

Download XSLT Preview File

Tag Content Visualized

The tag content of the source XML file can be visualized via Edit - Expand Tags and edited via F2 in MemSource Editor.