XLIFF files (XML Localization Interchange Format)
XLIFF (XML Localization Interchange File Format) is an XML-based format created to standardize the way localizable data are passed between tools during translation and localization. It's also a common format for translation tools.
XLIFF files are bilingual - XLIFF is not a source document format. The files contain entire segments, similarly to the way memoQ shows them in the translation editor. There is status information; there are tags; and match rates may also be saved. In addition, the XLIFF file may contain "skeleton" data, required to export translated documents. But if the XLIFF file comes from a different tool, memoQ can't interpret the skeleton data.
memoQ can pick up preview information from XLIFF files:
In XLIFF 1 files, preview IDs can be in an attribute or a newly defined child element of the <trans-unit> element, or in the context-type attribute of the <context> element.
XLIFF is a standard: XLIFF was standardized by OASIS in 2002. Its current specification is v2.1, released on 2018-02-13.
Use this to import XLIFF files from different tools: When you receive an XLIFF file that was saved in another translation tool, use this filter to import it. Don't use it to import memoQ XLIFF files.
Don't use this for memoQ XLIFF, it's special: Normally, memoQ exports bilingual documents in its own flavor of XLIFF. The files have the MQXLZ extension. To import those, use the simple Import command, or drop the files on the Translations pane in Project home.
Import SDLXLIFF with the special SDLXLIFF filter: Normally, memoQ uses the SDLXLIFF filter to import XLIFF files saved in SDL Trados Studio. But you can import these using this generic XLIFF filter, too. For instructions, scroll down on this page.
XLIFF comes in, XLIFF goes out: After memoQ imports an XLIFF file from a different tool, it can export an XLIFF file only. memoQ can't export the translation in the original format: for that, you need the original tool.
In this window, you can set up how memoQ imports XLIFF files.
How to get here
- Start importing an XLIFF file.
- In the Document import options window, select the XLIFF files, and click Change filter and configuration.
-
The Document import settings window appears. From the Filter dropdown, choose XLIFF filter.
What can you do?
XLIFF files can be multilingual. In addition, the languages in the XLIFF file may be different from the languages of the project.
Normally, memoQ looks for the main languages of the project in the XLIFF file. If they are found, memoQ imports the text that belongs to those languages. But the sublanguages can be different in the project and the XLIFF file.
- This can be a problem if the XLIFF file has different sublanguages of the same main language (such as US English and UK English). In this case, memoQ won't know which one to import.
- Another problem is if the XLIFF file doesn't have one or more of the languages of the project.
To sort this out: Use the radio buttons on the General tab, under Languages:
- To import only those parts where even the sublanguages are the same as in the project: Click the Import only content where languages match project languages exactly radio button.
- To import every unit from the XLIFF file, regardless of the languages: Click the Import all content regardless of language radio button.
To export the translation with the correct target language code: The target-language segments may be missing from the XLIFF file. When these are translated, memoQ exports them with the target language of the project. If, for any reason, you need to keep the language codes in the XLIFF file after export, clear the Use project's target language in export if it is not specified check box.
Text in the XLIFF strings can contain XML-like markup. It's not necessarily XML, though.
XLIFF can handle any kind of markup because it uses "masking" tags to separate any form of markup from the rest of the text. These masking tags are:
- bpt: Marks an opening tag in the original format
- ept: Marks a closing tag in the original format
- ph: Marks a placeholder in the original format
- it: Marks a miscellaneous inline tag in the original format
The XLIFF file contains the actual markup in the <bpt>...</bpt>, <ept>...</ept> etc. elements.
Normally, memoQ imports these as regular opening, closing, ph and it tags. In the translation editor, a <bpt>...</bpt> sequence becomes one single inline tag. For example, <bpt><span class="head"></bpt> will be imported as <bpt val="<span class="head">">.
If you are entirely sure that the markup between the <bpt>...</bpt>, <ept>...</ept>, etc. tags is well-formed XML: You can import the markup without the <bpt>, <ept>, <ph>, <it> masking. To do that, click the Interpret as XML tags radio button. As a result, the masking tags won't appear in the translation editor. For example, <bpt><span class="head"></bpt> will be imported as <span class="head">. From the type of the tag, memoQ will know if it must export a <bpt>, <ept>, <ph>, or <it> sequence.
To distinguish XLIFF tags from other inline tags in the document: Check the Prefix inline tags with "xliff:" check box. For example, <bpt><span class="head"></bpt> will be imported as <xliff:span class="head">
Careful when importing markup without masking: If the markup between the masking tags isn't well-formed XML, memoQ won't import the XLIFF document.
Normally, an XLIFF file contains segmented text, either in the form of trans-unit or mrk elements. You can decide whether or not you need to segment the text inside these elements.
memoQ segments and pairs the <segment> elements that have the same number of <source> and <target> elements inside. In case of different number of elements, segmentation is not possible.
For <segment> elements that do not have a <target> element inside, you can decide whether or not you need to segment the text inside their <source> elements.
Under the Segmentation section, you can:
- Segment text if there are no segment boundaries defined by <seg-source> - to split untranslated, unsegmented text in the trans-unit elements. memoQ won't segment the text if the segment boundaries (marked with seg-source) are already there.
-
Only import segmented content inside <mrk> elements - check this check box if you are importing SDLXLIFF files saved from SDL Trados Studio.
When importing SDLXLIFF files, always use the SDLXLIFF filter.
-
Start a new segment at newline characters - check the A newline breaks the text if there are no segment boundaries defined by <seg-source> check box. This won't work if the segment boundaries (marked with <seg-source>) are already there.
Normally, memoQ leaves spaces between words as it finds them in the XLIFF file. But if you need them differently, you can normalize the whitespace (sequences of only spaces and tabs) - replace it with a single space character: Check the Normalize whitespace by default check box. There are formats where the extra spaces disrupt the formatting or the alignment of text.
Normally, memoQ drops whitespace at the beginning and end of XLIFF segments. To keep those in the imported document: Check the Import spaces at the beginning and end of source and target check box.
Normally, memoQ does not import XLIFF segments that are empty or contain only spaces. To change this: Check the Import segments where the source is empty or Import segments where the source only contains spaces check box as needed.
XLIFF documents may contain <mrk> tags that do not start a new segment, and memoQ does not know how to handle them. This depends on the other tool that exported the XLIFF document.
Normally, memoQ will import these tags as inline tags, complete with all attributes. To omit them, clear the Import mrk tags that don't define segment boundaries - as inline tags check box.
If you import these <mrk> tags, you may have a lot of tags in each segment. You need to copy them to the target segment, according to the translation. If paired tags get mixed up, or some pairs go missing, the XLIFF document becomes invalid. To export a valid XLIFF document even in this case, check the Check correct pairing of tags upon export; drop all problematic tags check box.
This setting applies to plain XLIFF documents only: From SDLXLIFF, WorldServer XLZ, or XLIFF:doc files, memoQ imports "mrk" tags it can process, and drop those it cannot.
XLIFF is a document format that has everything that a translation tool needs. So, the context of segments can also be stored in XLIFF files.
Normally, memoQ treats XLIFF as a structured document: from each translation unit (trans-unit element), it imports an attribute called resname as context. This way, the previous and next segments (the text-flow context) don't count. If the resname attribute isn't there, memoQ normally doesn't import context.
To change this, click the Advanced tab. Use the radio buttons under Context.
- To use the trans-unit's id attribute for context: Click the Import trans-unit's "id" value as context radio button. memoQ will import the id attribute of each trans-unit element as that segment's context.
- To treat the XLIFF document as running text: Click the Do not import context radio button. memoQ will use the text-flow context (previous and next segments), not identifiers.
XLIFF documents contain alternate translations (often in different languages) and comments. These can be imported into memoQ.
To change this, click the Advanced tab. Use the radio buttons under Comment.
Normally, memoQ imports XLIFF notes as comments. In addition, memoQ imports the alternate translations and the context information as comments.
- To ignore alternate translations: Clear the Import "alt-trans" for other languages as comment check box.
- To drop the context identifier from the comments: Clear the Import <context> as comment check box. memoQ will still import context information as context, but you won't see it in segment comments.
Normally, memoQ doesn't export the comments in the XLIFF files, but it keeps the notes that are already there.
- To export memoQ comments: Check the Export comment as XLIFF 1 "note" check box.
- To replace the original notes with memoQ comments: Clear the Also keep original XLIFF 1 notes in export check box. If you do this, memoQ deletes all original notes, and exports the memoQ comments only as XLIFF notes.
In an XLIFF document, some segments may be marked as not to be translated. Each trans-unit element has a translate attribute. If a segment is not to be translated, this attribute is set to "no".
To change this, click the Advanced tab. Use the radio buttons under Translation units with "translate" attribute set to "no".
To leave these segments out from the import completely: Click the Do not import radio button.
In XLIFF, translation units may contain the match rate from the resources. But XLIFF doesn't have a standard place for this. Each translation tool can decide where to save it.
To import the match rate, click the Advanced tab. Use the controls under Match rate.
Check the Import match rate check box. Type the name of the attribute that has the match rate in the XLIFF file.
The attribute must belong to the <trans-unit> element in the XLIFF file. To find it, you may need to look at the XLIFF file in a web browser or a plain-text editor.
XLIFF is a document format that has everything that a translation tool needs. So, the status of segments can also be stored in XLIFF files.
Standard XLIFF has a specific set of states, but translation tools can also add their own status elements, attributes, and values - so it is not entirely standard.
memoQ can read the segment states from the XLIFF documents, and translate (map) them into memoQ segment statuses that you can see in the translation editor.
Normally, memoQ imports and exports the segments' status codes. You can turn this off on the Advanced tab. Use the check boxes under State and state-qualifier.
If status codes are imported, they are also translated (mapped) into memoQ segment statuses: To view and change the actual mapping, click the States tab.
- To forget about the XLIFF states and state qualifiers: Clear the Map XLIFF states to memoQ states at import from any source check box. If you do this, memoQ will not import the status information from XLIFF. If this is checked, memoQ will read the standard XLIFF state qualifiers that are included in the XLIFF file, and map them to memoQ segment status information. You can set up mapping on the States tab of this dialog.
- Normally, memoQ exports the segment status for segments where the XLIFF document had no status. To turn this off: Clear the Export "state-qualifier" attribute if missing from original and Export "state" attribute if missing from original check boxes.
To see (and change) how XLIFF states are mapped into memoQ segment statuses: Click the States tab.
On this tab, you can match the segment status codes in memoQ to the standard trans-unit states in XLIFF. For example, memoQ may import the final state in XLIFF a Reviewer 2 confirmed. In turn, memoQ may export the Reviewer 2 confirmed status as signed-off in XLIFF.
memoQ works with standard XLIFF trans-unit states only: memoQ can process segment status information from SDL Trados Studio. But proprietary status attributes from other tools are not visible to memoQ.
The Import list shows how XLIFF states are translated into memoQ segment status codes when memoQ imports an XLIFF document.
To change the mapping: In one of the dropdowns next to an XLIFF state, choose a different memoQ status.
If the XLIFF document has a state value that is not on the list, you can add it. At the bottom of the list, click the Add link. The New XLIFF state mapping window appears:
Type the state label in the "state" attribute value in XLIFF box. From the Segment status in memoQ dropdown, choose a memoQ segment status. You can choose from Not started, Translator confirmed, Reviewer 1 confirmed, Reviewer 2 confirmed, Fragments, Edited, Pre-translated, Rejected, or Machine Translated. To add the mapping: Click OK.
To delete a mapping: Click the mapping, then click the Remove link.
Caution: memoQ will not ask for confirmation.
To export the memoQ segment status values as XLIFF trans-unit state labels: Check the Map memoQ states to XLIFF states at export check box.
In the Export section, you can set an XLIFF state attribute for each memoQ segment status value. To change the XLIFF state label: Click the label next to the segment status. Type a new XLIFF state label. Press Enter or click outside the cell. You cannot add new export mappings, because the segment status codes are hard-coded in memoQ.
SDLXLIFF is the XLIFF file format from SDL Trados Studio. memoQ enables you to import this file format directly into a memoQ project.
When importing SDLXLIFF files, always use the SDLXLIFF filter.
You may have problems exporting metadata: This filter may fail to export all metadata that are originally there in the SDLXLIFF document. The direct SDLXLIFF filter can treat these properly. Always use the direct SDLXLIFF filter to import SDLXLIFF documents - this part of the generic XLIFF filter is obsolete, and should not be used, except for troubleshooting.
To import SDLXLIFF documents through the standard XLIFF filter:
- Start importing an SDLXLIFF document with options.
- In the Document import options window, select the SDLXLIFF files, and click Change filter and configuration.
- The Document import settings window appears. From the Filter drop-down list, choose XLIFF 1 filter. The standard XLIFF 1 settings appear.
- Click the General tab. Check the Only import segmented content inside "mrk" elements check box.
- Click the SDLXLIFF tab.
- Choose what happens to confirmed segments that come from a translation memory. Normally, memoQ imports them as Translator confirmed. Under Confirmed segments, you can change that, and import them as Pre-translated: Click the Pre-translated radio button.
- Under Additional comments, you can choose what happens to reviewing statuses that come with the SDLXLIFF document. In memoQ, these will appear as comments. Normally, memoQ indicates all these statuses by adding comments.
- Add this comment for translations rejected by a reviewer: memoQ will append this to the comment field in memoQ.
- Add this comment for translations rejected by a reviewer: memoQ will append this to the comment field in memoQ.
- Add this comment for translations with "Rejected sign-off" status: memoQ will append this to the comment field in memoQ.
- Add this comment for translations with "Approved sign-off" status: memoQ will append this to the comment field in memoQ.
memoQ uses a hard-coded mapping to translate SDLXLIFF status codes into memoQ status codes. The mapping is as follows:
Studio | memoQ |
---|---|
Not translated | Not started |
Draft | Edited |
Translated | Translator confirmed or Reviewer 1 confirmed |
Translation Approved | Reviewer 2 confirmed |
Signed Off | Reviewer 2 confirmed |
Translation Rejected | Rejected |
Sign-off Rejected | Rejected |
When you finish
-
To confirm the settings, and return to the Document import options window: Click OK.
In the Document import options window: Click OK again to start importing the documents.
-
To return to the Document import options window, and not change the filter settings: Click Cancel.
-
If this is a cascading filter, you can change the settings of another filter in the chain: Click the name of the filter at the top of the window.