XLIFF

Languine supports XLIFF (XML Localization Interchange File Format), an XML-based format designed for exchanging localization data. This format is widely used in professional translation workflows and supports both XLIFF 1.2 and 2.0 versions.


Setting Up

First, make sure you've got a languine.json config file in your project root. Here's an example:

typescript
{
  "locale": {
    "source": "en",
    "targets": ["sv", "de", "fr"]
  },
  "files": {
    "xliff": {
      "include": ["locales/[locale].xlf"]
    }
  }
}

Translating

With your config set, run:

typescript
npx languine@latest translate

When you run this command, Languine will:

  • Load your source XLIFF file (e.g., locales/en.xlf)
  • Detect any new or modified translation units
  • Generate translations for your target languages
  • Create or update the target language XLIFF files (e.g., locales/sv.xlf)
  • Preserve notes, context information, and state attributes
  • Maintain compatibility with CAT (Computer-Aided Translation) tools