v1.3.2

xlf-sync

The definitive CLI tool for synchronizing Angular XLIFF (1.2 & 2.0) locale files

by Anastasios Theodosiou

npm install -D xlf-sync

Key Features

🔄

Full Synchronization

Automatically adds missing keys from messages.xlf to all locale files

🧠

Metadata Preservation

Keeps notes, contexts, and attributes intact. Zero data loss during sync.

🛡️

Data Safety

Never overwrites existing translations. Your work is always safe

🧬

Multi-Version Support

Seamlessly handles XLIFF 1.2 and 2.0 in the same project

🤖

CI/CD Ready

Dedicated check command with strict exit codes for pipelines

💀

Graveyard Mode

Preserve obsolete keys in separate files instead of deleting

📊

Translation Reports

Generate detailed coverage reports for all locales

🎨

Web Dashboard

Interactive HTML dashboard with translation matrix and search

⚙️

Config File Support

Manage settings with xlf-sync.json for consistent workflows

80% Test Coverage

Comprehensive test suite ensuring reliability and stability

Quick Start

1 Sync Command

Update your locale files with new translations from the source

npx xlf-sync sync --source src/locale/messages.xlf --locales "src/locale/messages.*.xlf"

2 Check Command

Verify translation status in CI/CD pipelines

npx xlf-sync check --fail-on-missing --verbose

3 Report Command

Generate translation coverage statistics

npx xlf-sync report

4 Dashboard Command

Generate modern HTML dashboard with translation matrix

npx xlf-sync dashboard --out report.html
✅ Translation Matrix 🔍 Search Keys 📊 Visual Stats 📱 Responsive

❓ Frequently Asked Questions

What XLIFF versions are supported?

xlf-sync supports both XLIFF 1.2 and XLIFF 2.0 formats. You can even mix both versions in the same project - the tool automatically detects and handles each file appropriately.

Will xlf-sync overwrite my existing translations?

Never! xlf-sync is designed to be safe. It only adds missing keys and marks obsolete ones. Your existing translations are always preserved and never modified.

How do I use the dashboard feature?

Run the dashboard command to generate a beautiful HTML report:

npx xlf-sync dashboard --out report.html

Then open report.html in any browser to see your translation matrix, search keys, and visual statistics.

Can I use xlf-sync in CI/CD pipelines?

Absolutely! Use the check command with --fail-on-missing to validate translations:

npx xlf-sync check --fail-on-missing

This command exits with code 1 if there are missing translations, making it perfect for automated workflows.

What is Graveyard Mode?

Graveyard Mode preserves obsolete translation keys in separate files instead of deleting them. This is useful for:

  • Keeping a history of removed translations
  • Recovering accidentally deleted keys
  • Auditing translation changes over time
npx xlf-sync sync --graveyard-file graveyard.xlf
How do I configure default settings?

Create an xlf-sync.json file in your project root:

{ "source": "src/locale/messages.xlf", "locales": "src/locale/messages.*.xlf", "dryRun": false }

All commands will use these defaults unless overridden by CLI flags.

Is xlf-sync only for Angular?

While xlf-sync was designed with Angular in mind, it works with any XLIFF 1.2 or 2.0 files. If your framework uses standard XLIFF format, xlf-sync will work perfectly.

Does it preserve developer notes and attributes?

Yes! All metadata, including <note> elements, <context-group>, and custom attributes (like approved="yes" or translate="no"), are strictly preserved. We guarantee Zero Data Loss for your metadata.

Does it sort the translations?

Yes! xlf-sync automatically reorders the translation units in your locale files to match the exact order of your source file. This keeps your git diffs clean and your files organized.

Support the Project

🌟 Love xlf-sync?

Help us grow by starring the project on GitHub, contributing to make it even better, or supporting development!