Working With XLIFF
In this article, you'll learn more about XLIFF-based translation workflows using Scroll Translations. Before reading on, make sure you've learned about the basics of external translation.
Structure of the XLIFF Translation ZIP
Working with XLIFF in Translation Management System usually doesn't require additional configuration. For certain cases in which this might be necessary, below is an example of the XLIFF structure generated by Scroll Translations:
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file xmlns:ns0="k15t" datatype="xml" ns0:exportTimestamp="1486977717145" ns0:spaceKey="ALXDOCS" ns0:variantId="all" ns0:versionId="current" original="Users Guide" source-language="en" target-language="it">
<header>
<ns0:scrollHeader pageId="1179665" revision="3" scrollPageId="2EA377EC0145F04501137F043E495641" spaceKey="ALXDOCS" versionId="current"/>
</header>
<body>
<trans-unit id="ScrollPageTitle">
<source>Users Guide</source>
</trans-unit>
<group xmlns:ac="http://atlassian.com/content" xmlns:ri="http://atlassian.com/resource/identifier" restype="x-storageFormat">
...
</group>
</body>
</file>
</xliff>
For a detailed description of the elements, refer to table below.
Line | Element | Description |
---|---|---|
3 | Translation Descriptor | The attributes of the |
5 | Scroll Header | The attributes of the <scrollHeader> element contain all the page specific data like pageId, revision, ScrollPageId, spaceKey and versionId. |
8 | Scroll Page Title | The <trans-unit> element with the id "ScrollPageTitle" contains the original scroll page title of the exported page and needs to be translated. |
11 | Page content | The <group> element with the restype "x-storageFormat" contains the actual page content which needs to be translated. It consists out of multiple <group> and <trans-unit> elements which represent the structure of the storage format and contain the text to be translated. |
Specify Which Macros Should Be Translated
If you chose the XLIFF translation format, then by default, the parameters and body of "unknown" macros (custom user macros and third-party macros) will not be translated. If you want to translate them, you need to define which parameters should be translated. You can only specify text parameters to be translated – all other parameter types can't and shouldn't be translated.
To specify which text parameters and macro bodies should be translated, log in as a global admin and navigate to General Configuration > Scroll Runtime > Advanced Plugin Settings > Scroll Platform > translations.custom.macro.translation.
The plugin setting value has to be a JSON object consisting of multiple key/value pairs representing macros. The key represents the macro name, while the value is another JSON object consisting of a "parameters" and "body" attribute:
- "parameters" is an object with parameter names as attributes and booleans as values. Boolean values indicate if parameters should be translated or not. Every parameter not listed here will not be translated.
- "body" is a boolean value indicating if the body should be translated or not.
For example, the following JSON will cause the body of "warning" and "code" macros not to be translated, while the "title" parameter for the "code" and "status" macros will be translated, whereas the "theme" parameter will not:
{
"warning": {"body": false},
"status": {"parameters": {"title" : true}},
"code": {"parameters": {"title" : true , "theme" : false}, "body": false}
}
If a macro is specified in the plugin settings, the default values for this macro will be overwritten.