Skip to main content
Skip table of contents

Automatic XLIFF export and import

censhare supports the XLIFF format 1.2 to exchange texts with external systems during the translation process. Configure the modules for automatic XLIFF import and export.



Share translations with external systems: external translation system (1), translation (2), XLIFF export (3), XLIFF import (4).

Context

The automatic XLIFF import and export isconfigured in the censhare Admin Client.

Prerequisites

The configuration ofthe manual server actions for the XLIFF import and export must be done before configuration for the automatic server actions.

Introduction

censhare supports the translation process with external translation systems. To do that, the text to be translated needs to be exported in an XML file with XLIFF-1.2 format and then imported into the external system. After completing the work, the translated text is once again exported in an XLIFF file format and imported into censhare. The text to be translated needs to be available in censhare as an XML or Adobe InCopy text.

Segmentation

To export the file, censhare divides the text into so-called segments that then form the basis for the translation. Usually, one segment corresponds to one sentence. The segmentation is done based on the XML or InCopy elements in the text. The way the individual elements are treated is determined by the tag mapping for the XML dialect in question. That then forms the segment structure of the XLIFF text.

If the rules for the XML dialect are not yet available in censhare, you need to configure them in the censhare Admin Client. This is done in the "Tag mapping configuration" in the folder "Configuration/Modules/XLIFF2" of the censhare Admin Client. In addition, censhare applies the SRX rules (Segmentation Rules eXchange) for the segmentation process. For more information see the article "XLIFF - Configuring the XML Structure".

The export

It is possible to export assets with XML or Adobe InCopy texts. Before the export takes place, the asset to be exported needs to have a variant with or without update flag and the target language. If an InCopy asset has multiple text sections as files, censhare saves all of them in an XLIFF file.

The individual text sections are placed in different group elements. If you are dealing with a layout with placed InCopy texts, then before the export you need to have created a structure duplicate with the target language that is linked to the source layout. After the export, you will have an XLIFF file in which the individual InCopy texts are stored in different group elements.

During the export, censhare also saves the asset ID in the XLIFF file. censhare needs this ID to import the XLIFF file in order to link the translation with the asset for the source text. Without this ID the import is not possible. You therefore can't import any XLIFF files that were not initially exported from censhare.

The manual server actions

Before configuring the automatic XLIFF export and import you first need to set up the manual import and export. If this is true, the server actions "Export XLIFF" and "Import XLIFF" are available in the Java Client. The "Export XLIFF" and "Import XLIFF" options are available in the censhare Admin Client in the folder "Configuration/Modules/XLIFF2". 

Using the manual import and export you can also check whether the process is working properly, including the segmentation. This needs to be functioning in order to configure the automatic import and export.

If you only export XLIFF files occasionally, then the manual import or export will probably suffice. Automatic imports or exports of XLIFF files make sense if you need to perform those actions regularly. For example, you may hand off your translations for product documentation to a service provider who works with an external translation system that imports XLIFF files.

The automatic server actions

To set up the automatic export, specify a file directory where censhare can store the exported XLIFF files. If the service provider has access, for example, through the censhare FTP server, then the files can be downloaded directly from there.

For automatic exports, you need to tell censhare when they should be carried out. To do that you define certain asset events that trigger the export. This could be reaching a certain workflow step within a process such as the "Export XLIFF" step of the workflow "External translation". Workflows are defined in the censhare Admin Client in the Master data in the "Workflows" table.

You can also define asset filters that trigger events. Here you can specify that only "Text" assets or only "Layout" assets should be used.

To be sure the automatic export takes place you have to trigger the event for the translation variant. That way, censhare knows the translation variant (i.e. the language) for which you want to create the XLIFF file. The reason for this is that a source text can have multiple language variants. For a manual export, you have to select in a dialog the language variant that the XLIFF export should have. This choice is not available for automatic export.

The same goes when you want to carry out an automatic export for a layout with placed InCopy texts. You have to trigger the event for the structure duplicate of the layout with the desired target language. After the export, censhare locks the exported language variant, just like with the manual export.

censhare checks while the export if there is a well-formed XML structure. If the XLIFF file is not well-formed, censhare creates an error message in the ".../work/error/..." folder of the censhare server.  For example, if an opening XML tag has no closing XML tag. Here is a part of an ICML file with an error:    

CODE
<content> Alice started to get <it>bored. </content>

The ICML file is malformed because the"<it>" XML tag lacks the "</it>" closing tag. 

There can be HTML codes for characters like "&#34;" for double quotes in the text. If there is a malformed HTML code like "&;", censhare will escape it. These characters are then exported as they are and do not influence the export.

The import

The automatic XLIFF import uses censhare's hot folder utility. censhare imports all the files in the folder defined as the hot folder. No check is carried out as to whether the file is an XLIFF file. If this is not the case, or an error occurs during the import, censhare can move the file to an error folder.

If the import is successful, censhare saves the translation in the asset variant and automatically removes the lock on the translation variant.

During the import, censhare checks if the XLIFF file is well-formed. If the XLIFF file is not well-formed, censhare creates an error message in the ".../work/error/..." folder of the censhare server. If there is a malformed HTML code like "&;", censhare will escape it. For more information on malformed XML and HTML codes, see the previous section.

If workflow has be specified in the translation variant for the further handling of the file, this needs to be done manually. For manual imports, you still have the option of keeping the lock on.

Configuring automatic XLIFF exports

The configuration of the automatic XLIFF export is done in the censhare Admin Client folder "Configuration/Modules/XLIFF2". Open the associated dialog by double-clicking the entry "Export assets to XLIFF (automatic)".

The automatic XLIFF export uses censhare's asset automation function. The sections "Trigger events", "Asset structure", "Asset update" and "Send new asset events" relate to this topic.

The specific settings for the export can be configured in the section "Special setup". The most important setting is the location where censhare copies the XLIFF file. This consists of the fields "File system" and "Path". The latter indicates the relative file path within the file system. If the folder doesn't exist yet, censhare will automatically create it.

There are no special rules for selecting the file system. You can use the "Temp" file system, for example. For the path you have to enter "file:" as the prefix. The path can look like this, for instance:

" file:xliff/exported/ "

censhare then writes the files to the following location:

" .../temp/xliff/exported/ ".

For the export, censhare can copy the source elements of the text to be translated into the target elements. This will initially generate the source text as the text in the target text area. To do this, select the option "Fill target elements with source".

Tip: If the XLIFF document is to be translated with SDL Trados Studio, then the option "Fill target elements with source" must not be selected. Otherwise, the translated XLIFF document can no longer be imported back to censhare. This is due to a bug in SDL Trados Studio.

The option "Export target language" exports the text of the target language variant into an XLIFF file.

Text in the target language variant will be exported to the XLIFF file.

During the export, censhare writes information about the process to the server log. If you select the option "Detailed export report", the log will contain comprehensive information about the export process.

To activate the module, select the option "Enabled" under "General setup".

Click OK to confirm your settings or exit the dialog with CANCEL. Click the "Update Server Configuration" button in the censhare Admin Client toolbar to send the changed configuration to the server.

Configuring automatic XLIFF imports

The configuration of the automatic XLIFF import is done in the censhare Admin Client folder "Configuration/Modules/XLIFF2". Open the associated dialog by double-clicking the entry "XLIFF import from directory (automatic)".

The specific settings for the import can be configured in the section "Filesystem-Setup". It contains the corresponding configuration for the hot folder utility. Leave the area "Mapping Setup" empty.

To use the hot folder utility you have to configure four directories. censhare scans the input directory for XLIFF files to be imported. censhare then moves the XLIFF file to the working directory for further processing. After the import is complete, censhare moves the file to the output directory.

If an error occurs during the import, censhare moves the file to the error directory. This happens when a file doesn't have a valid XLIFF structure, for example. An error can also occur if the XLIFF file was not originally exported from censhare.

For every directory, you need to enter a file system and a path within the file system. There are no special rules for selecting the file system. The path must begin with the prefix "file:".


File system

Path

Input dir

Temp

file:xliff/in/

Working dir

Temp

file:xliff/work/

Output dir

Temp

file:xliff/completed/

Error dir

Temp

file:xliff/error/

In the event of an error, if files should remain in the input directory, then select the option "Don't move non-matching files in the Error dir".

If censhare should also scan subdirectories of the input directory, select the option "Recursive (scan subfolders)".

To activate the module, select the option "Enabled" under "General setup".

Click OK to confirm your settings or CANCEL to exit the dialog. Click the "Update server configuration" button in the censhare Admin Client toolbar to send the changed configuration to the server.

Result

You successfully configure the automatic server actions for XLIFF import and export.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.