Correcting Wordfast and Wordbee XLIFF locale code error

If you export files from Wordbee platform and then try importing them into Wordfast Pro, the latter might report the following error: “Error converting .xlf. … Reason: Invalid locale code”.

Wordfast Pro error display
Wordfast Pro error display

If this happens, you will need to edit the files manually.

  1. Locate your XLIFF file and open it in a text editor. It has to be a plan-text editor to prevent file corruption. I recommend Notepad++ because it formats the XLIFF display.
  2. Search, at the top, for target-language=”sr-Latn-RS”. In my case, because I translate to Serbian, the value is sr-Latn-RS:
    <?xml version="1.0" encoding="utf-8"?><xliff xmlns:wb="http://www.wordbee.com/Xliff" version="1.2" wb:xliffId="foo" wb:sourceId="foo" wb:sourceName="foo" wb:translationsIncluded="1" xmlns="urn:oasis:names:tc:xliff:document:1.2"><file source-language="en-GB" target-language="sr-Latn-RS" original="foo.xlf" datatype="x-xliff" wb:fileId="foo" tool-id="Wordbee"><header><tool tool-id="Wordbee" tool-name="Wordbee" tool-company="Wordbee" /></header><body>
  3. Delete the part that identifies the language. Then, add a new value from ISO 639-2 page with the language codes. The snippet should now look like this: target-language=”sr”. Be careful not to delete other characters (=, “, <, >) to prevent an error.
  4. Reopen the XLIFF in your Wordfast Pro. IMPORTANT: Revert the process to upload to Wordbee (edit the files and insert the initial language code).

Wordfast Pro and Wordbee are examples of commercial CAT (Computer-Assisted Translation) software. Notepad++ is a free and versatile Windows plan-text editor with code highlighting (on Linux you can use Kate or Gedit).

Published by

Romeo Mlinar

Languagebits.com Author

Leave a Reply