Extension | .xml, .xlf, .xliff |
Smartling Identifier | xliff2 |
Example File | (see example below) |
Resources |
Example File
<?xml version="1.0" encoding="UTF-8" ?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0"
xmlns:xmrk="urn:xmarker"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="xliff_core_2.0.xsd" version="2.0"
srcLang="en-US"
trgLang="uk-UA">
<file id="description.properties">
<unit id="1">
<segment>
<source>Various types of model.</source>
<target></target>
</segment>
</unit>
<unit id="2">
<segment>
<source>Machine Learning has drawn a lot of attention.</source>
</segment>
<ignorable>
<source> </source>
</ignorable>
<segment>
<source>Then we introduce the needed mathematical notation.</source>
</segment>
</unit>
</file>
</xliff>
Smartling supports .xlf, .xliff, and .xml files that use the XML Localization Interchange File Format v 2.0 (XLIFF2).
Articulate XLIFF 2.0 is not supported, meaning you cannot upload a translation XLIFF 2.0 file to Articulate Storyline. You must translate XLIFF 1.2 and choose the articulate option for translations to be compatible with Articulate import.
String Instructions
Smartling automatically captures XLIFF notes and makes them translator instructions. See xliff_note_to_instruction for more information.
Excluding Strings
To exclude content from translation, you can use XLIFF’s translate attribute. To exclude a string from translation, set translate=no. See XLIFF Resource Documentation for details on the translate attribute.
Plurals in XLIFF 2.0 Files
XLIFF 2.0 does not support plural translation.
Standard Placeholder Format
See Placeholders in Resource Files for more on placeholders.
XML Characters
The following XML character are always escaped. You can control this by using the entity_escaping directive.
Character (character name) | Escape sequence |
< (less-than) |
< |
> (greater-than) |
> |
& (ampersand) |
& |
' (apostrophe or single quote) |
' |
" (double-quote) |
" |
Directives
File directives are supported, both inline and via our API. Directives are specified in comments within the files, in the following format:
Inline File Format
<!-- smartling.[directive_name] = [value] -->
API Parameter
smartling.[directive_name] = [value]
Here are examples of supported directives for XLIFF 2:
Directive name | Values | Description | Example |
placeholder_format |
|
Used to specify a standard placeholder format. |
<!-- smartling.placeholder_format = IOS --> Specifies iOS-style placeholders for the file. |
placeholder_format_custom |
|
Specifies a custom placeholder format. Any text in your file matching the regular expression you provide will be captured as a placeholder. See Placeholders in Resource Files for more on placeholders. |
<!-- smartling.placeholder_format_custom=\{([^}]+)\} --> Any characters surrounded by curly brackets, e.g., {first name}, will be treated as a placeholder. |
string_format |
|
Control trans-unit level HTML parsing. If this is set to HTML a single trans-unit can be ingested by Smartling as multiple strings, depending on block level tags. |
<!-- smartling.string_format=html --> string_format code example <trans-unit id="HTML string1"> Code example explained The first trans-unit gets the default behavior. One string is captured by Smartling: <p><div>String1 div1</div><div>String1 div2</div></p> and the CAT tool will allow the translator to manage the HTML tags, considered part of the translatable string. The second trans-unit gets HTML parsed. Smartling captures two strings: String2 div1 String2 div2 The third trans-unit returns to default parsing behavior. Smartling captures one string1: <p><div>String3 div1</div><div>String3 div2</div></p> |
whitespace_trim |
|
A whitespace is any character or series of characters that represent horizontal or vertical space in typography. When rendered, a whitespace character is not a visible mark, but does occupy an area or space on a page. Although whitespaces are necessary within a string (typically to separate words), unnecessary whitespaces can be found at the start of a string (leading) and at the end of a string (trailing). With this directive, you can manage whitespace trimming. By default, the leading and trailing whitespaces are trimmed. You can choose to disable trimming or specify trimming for leading or trailing whitespaces. |
<!-- smartling.whitespace_trim=on--> Smartling will trim leading and trailing whitespaces (default)
<!-- smartling.whitespace_trim=off --> Smartling will not trim leading or trailing whitespaces
<!-- smartling.whitespace_trim=leading --> Smartling will trim only leading whitespaces
<!-- smartling.whitespace_trim=trailing --> Smartling will trim only trailing whitespaces |
xliff_notes_to_instruction |
|
Controls where translator instructions are located in the file. By default, all notes inside a unit are ingested as translation instructions. none - disables the ingestion of translators instructions. |
<!-- smartling.xliff_notes_to_instruction=group, unit --> The translator instructions will consist of group-level notes and unit-level notes.
|
xliff_segment_code_strategy |
|
Controls how long strings should be parsed; either as a separate string or as one long string. string - every segment is ingested as a separate original string. |
<!-- smartling.segment_code_strategy=span --> Smartling will parse a long string into one long strings
|