Skip to main content

XLIFF Format Guide

Learn about the XLIFF format and how to prepare your files for translation

What is XLIFF?

XLIFF (XML Localization Interchange File Format) is an XML-based format designed to standardize the way localizable data are passed between tools during a localization process. It was created to provide a single interchange format that tool vendors, system integrators, and localization providers can use to exchange data.

Key Benefits

  • Standardization: Widely adopted industry standard
  • Interoperability: Works with most translation tools
  • Rich Metadata: Preserves context and formatting
  • Version Control: Easy to track changes

XLIFF Versions

XLIFF 1.2

The most widely supported version, used by many tools and platforms.

  • • Stable and mature
  • • Extensive tool support
  • • Good for most use cases
  • • Legacy compatibility

XLIFF 2.0

The modern standard with enhanced features and better structure.

  • • Improved structure
  • • Better metadata support
  • • Enhanced validation
  • • Future-proof

XLIFF Structure

Basic Structure

<?xml version="1.0" encoding="UTF-8"?>
<xliff version="2.0" srcLang="en" trgLang="es">
<file id="1" original="app.xliff">
<unit id="1">
<segment>
<source>Hello world</source>
<target>Hola mundo</target>
</segment>
</unit>
</file>
</xliff>

Key Elements

  • <xliff> - Root element with version and language attributes
  • <file> - Represents a source file being translated
  • <unit> - Contains translatable content
  • <segment> - Individual translation unit
  • <source> - Original text to be translated
  • <target> - Translated text (may be empty)

Common Attributes

  • srcLang - Source language code (e.g., "en")
  • trgLang - Target language code (e.g., "es")
  • id - Unique identifier for elements
  • original - Original filename
  • state - Translation state (new, translated, reviewed)

Advanced Features

Comments and Notes

Add context and instructions for translators:

<unit id="1">
<notes>
<note>This is a button label</note>
<note>Keep it short and clear</note>
</notes>
<segment>
<source>Submit</source>
<target>Enviar</target>
</segment>
</unit>

Placeholders and Variables

Handle dynamic content and formatting:

<source>Welcome, <ph id="1">%s</ph>!</source>
<target>¡Bienvenido, <ph id="1">%s</ph>!</target>

Translation States

Track the progress of translations:

initial

New segment, not yet translated

translated

Translation completed

reviewed

Translation reviewed and approved

Preparing Your XLIFF Files

1. Validate Your File

Ensure your XLIFF file is valid before uploading:

  • • Check XML syntax with an XML validator
  • • Verify XLIFF schema compliance
  • • Ensure proper UTF-8 encoding
  • • Test with XLIFF validation tools

2. Clean Up Content

Prepare your content for better translation results:

  • • Remove HTML tags if not needed
  • • Ensure consistent terminology
  • • Add context notes where helpful
  • • Check for placeholder text

3. Handle Existing Translations

Decide how to handle existing target content:

  • • Clear target content for fresh translations
  • • Keep existing translations for reference
  • • Mark segments that need review
  • • Preserve important metadata

Supported Formats

Primary Formats

  • XLIFF 1.2 (.xlf, .xliff)
  • XLIFF 2.0 (.xlf, .xliff)
  • PO files (.po)
  • JSON translation files (.json)

File Size Limits

  • Web interface: 10MB max
  • API: 50MB max
  • Recommended: Under 5MB

Tools and Resources

XLIFF Editors

Validation Tools

Documentation & Resources

Ready to Start?

Now that you understand XLIFF format, you're ready to begin translating: