Tool · fix a file

Fix an XLIFF file that won't open

Trados Studio or memoQ refuses the file, or says it is damaged? Drop it here. The file doctor reads it in this browser tab and tells you what is wrong, where, and how to fix it. The problems it can fix without touching anything else, it fixes.

XLIFF 1.2 and 2.0, SDLXLIFF, MQXLIFF and PO. Nothing is uploaded: the file is read here and the fixed copy is handed straight back to you.

What it checks

The rules of the formats themselves, in the order a reader meets them: first the bytes, then the XML, then what XLIFF, SDLXLIFF, MQXLIFF and PO require. A problem early in that order hides the ones after it from every tool, so the doctor reads past each one it finds to give you the whole list at once.

The file and its encoding

  • An empty file
  • A package or archive instead of a bilingual file
  • A file that is not text
  • XML that is not a translation file
  • A file in no format the doctor knows
  • A file that was cut off
  • Bytes after the end of the document · fixed here when they are zero bytes or blank space
  • A byte order mark
  • UTF-32 text
  • A byte order mark that disagrees with the declaration · fixed here
  • Text saved in a Windows code page instead of UTF-8 · fixed here
  • Two encodings in one file · fixed here
  • A declaration that names the wrong encoding · fixed here
  • Text in a legacy encoding · fixed here when it is a single-byte code page
  • Text converted to UTF-8 twice
  • Characters lost in an earlier conversion
  • A byte order mark in the middle of the text
  • Zero bytes inside the text

XML

  • Something before the XML declaration · fixed here when it is blank space, zero bytes or a second byte order mark
  • A bare & · fixed here
  • An HTML entity XML does not know · fixed here for the common HTML entities
  • An entity nothing defines
  • A character XML does not allow
  • Leftover merge-conflict markers
  • A bare < in the text
  • Tags closed in the wrong order
  • A tag that is never closed
  • A broken attribute
  • An attribute given twice
  • A prefix the file never declares
  • Two documents in one file
  • Any other XML error, with where it is

XLIFF, SDLXLIFF and MQXLIFF

  • An XLIFF version that does not match the file
  • A missing XLIFF namespace
  • A missing source language
  • A missing target language
  • A language code in the wrong form · fixed here when it is written with an underscore, as en_US
  • Targets in a different language than the file says
  • Several language pairs in one file
  • A <file> without original or datatype
  • Units without ids
  • Duplicate unit ids
  • Duplicate segment ids
  • Duplicate memoQ segment GUIDs
  • Status values the format does not define · fixed here when only the capitalization is wrong
  • yes/no attributes with other values
  • Target segments with no source segment
  • Source segments missing from the target
  • Target segments out of order
  • Segments without Trados segment data, or the reverse
  • SDLXLIFF units without segmentation
  • Paired inline tags that do not pair up
  • SDLXLIFF tags the file does not define
  • Targets whose tags differ from the source
  • A file with nothing to translate
  • Anything else that stops the editor opening it

PO

  • PO lines that are not PO
  • The same msgid twice
  • Plural entries without plural translations, or the reverse
  • Plural entries without a Plural-Forms header
  • Fewer plural forms than the language needs
  • A missing header or Language line

What it fixes, and what it never touches

A fix replaces the exact bytes of the problem and nothing else: the file is not read in and written out again, which is how the editor's own export works. So a bare & becomes &amp; and every byte around it stays as it was, vendor data, comments and spacing included. The 11 kinds of problem marked "fixed here" above are the ones where the right change is certain.

Every change is listed with its line and column, before and after, and the fixed file is checked again before you download it, so you see what is left.

Ids, segmentation and text are never changed. Trados Studio and memoQ match the file you return to their project by its unit ids and its segments, so a file with an id renumbered or a segment merged would open, and then import into the wrong place. The doctor says where those problems are and leaves the decision to you.

Steps

  1. Drop the file that will not open. The XLIFF, SDLXLIFF, MQXLIFF or PO file Trados Studio, memoQ or another tool refused, or says is damaged. It is read in this browser tab; nothing is uploaded.
  2. Read the diagnosis. Each problem says what it is, what it means for the file, where it is, by line and column and by unit and segment, and how to fix it. The most serious come first.
  3. Check the changes. Where a problem can be fixed without touching anything else, the fix is listed change by change, before and after, and the fixed file is checked again.
  4. Download the fixed file, or open it in the editor. The download has the same name as your file. Keep the original until the CAT tool has opened the fixed one. What could not be fixed here is fixed by hand, in the editor or in the tool that made the file.

The gotchas

A file can pass here and still be refused. The doctor checks what the formats require; each CAT tool's import adds its own expectations, and those have not been tested against Trados Studio or memoQ themselves. If a file passes and still will not open, please send it to us.

Bytes that are not UTF-8 are read in a guess. The file's declaration says which code page it is in when it says one; otherwise the doctor takes the Windows code page of the file's languages, Windows-1251 for Russian, Windows-1250 for Polish. Each converted character is listed, so check that they read right before you use the file.

It checks the file, not the translation. Missing numbers, placeholders and terminology are the QA check's business.

Run QA checks on the fixed file before it goes out