sync_translations 1.0.3 copy "sync_translations: ^1.0.3" to clipboard
sync_translations: ^1.0.3 copied to clipboard

A Dart CLI tool that synchronizes translation files across multiple locales by ensuring all keys are consistent and complete between source and target files.

sync_translations #

A simple and powerful Dart command-line tool that helps you synchronize translation files across multiple locales in your Flutter or Dart projects.

This tool ensures that all translation keys are consistent across different language files β€” it adds missing keys, removes unused ones, and keeps your localization organized and up to date.


πŸš€ Features #

βœ… Compare and synchronize .json, .arb, or .yaml translation files
βœ… Detect missing or extra keys between locales
βœ… Automatically insert missing keys with default values
βœ… Supports nested translation structures
βœ… Simple command-line usage
βœ… Fast and safe β€” built with pure Dart


πŸ“¦ Installation #

dart pub global activate sync_translations

βš™οΈ Usage #

Run the following command in your project root:

sync_translations

Options #

Option Description
--source The main translation file (e.g., English)
--targets One or more translation files to sync with the source
--dry-run Shows changes without writing them
--overwrite Overwrites files automatically
--indent Sets JSON indentation (default: 2)

Example:

sync_translations

🧩 Example #

en.json #

{
  "hello": "Hello",
  "bye": "Goodbye"
}

ar.json (before) #

{
  "hello": "Ω…Ψ±Ψ­Ψ¨Ψ§"
}

After running: #

sync_translations --source en.json --targets ar.json --overwrite

ar.json (after) #

{
  "hello": "Ω…Ψ±Ψ­Ψ¨Ψ§",
  "bye": "Goodbye"
}

🧠 Why use this? #

Maintaining multiple translation files by hand is error-prone.
sync_translations keeps them clean, synchronized, and complete β€” saving hours of manual editing.


🧰 Contributing #

Contributions are welcome!
If you’d like to improve the tool or add a new feature:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/awesome-improvement)
  3. Commit your changes
  4. Open a Pull Request πŸš€

πŸͺͺ License #

This project is licensed under the MIT License.


1
likes
150
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart CLI tool that synchronizes translation files across multiple locales by ensuring all keys are consistent and complete between source and target files.

Repository (GitHub)
View/report issues

Topics

#localization #translations #cli #dart #automation

Documentation

API reference

License

MIT (license)

Dependencies

path

More

Packages that depend on sync_translations