arb_excel_converter_tool 1.1.1
arb_excel_converter_tool: ^1.1.1 copied to clipboard
A complete CLI tool to export Flutter ARB files to Excel for translators and import them back into your project.
🚀 ARB Excel Converter Tool #
Bridge the gap between developers and translators. Convert Flutter .arb localization files into Excel spreadsheets and back again with ease.
🔄 The Full Localization Loop #
- Export: Generate an Excel sheet from your primary ARB file.
- Translate: Give the Excel sheet to your translators (no JSON knowledge required).
- Import: Convert the translated Excel sheet back into a valid ARB file.
✨ Features #
- 📦 Two-Way Sync: Support for both
export(ARB → Excel) andimport(Excel → ARB). - 🔍 Metadata Support: Extracts and injects
@descriptionmetadata to provide context for translators. - 🛡️ Type Safety: Built with the latest
excel 4.xstandards for robust file handling. - 🎨 Pretty Formatting: Imported ARB files are automatically formatted with 2-space indentation.
- 💻 Zero Config: Optimized for standard Flutter localization paths (
lib/l10n/).
📦 Installation #
This is a global command-line tool. Install it once and use it in any Flutter project:
dart pub global activate arb_excel_converter_tool
Note: Ensure your Dart SDK
binfolder is in your system PATH to run the tool from anywhere.
📖 How to Use #
Use the arb_tool command from your project root.
1. Export (ARB ➡️ Excel) #
Convert your source ARB file into a spreadsheet for translation.
# Default: Converts lib/l10n/app_en.arb ➡️ localization_export.xlsx
arb_tool export
# Custom paths
arb_tool export -i lib/l10n/intl_en.arb -o translations_v1.xlsx
2. Import (Excel ➡️ ARB) #
Bring translated strings back into your Flutter project.
# Default: Converts localization_export.xlsx ➡️ lib/l10n/app_en.arb
arb_tool import
# Custom paths (e.g., importing a specific language)
arb_tool import -i translations_es.xlsx -o lib/l10n/app_es.arb
🛠 Available Options #
| Option | Short | Default (Export) | Default (Import) | Description |
|---|---|---|---|---|
--input |
-i |
lib/l10n/app_en.arb |
localization_export.xlsx |
Path to source file. |
--output |
-o |
localization_export.xlsx |
lib/l10n/app_en.arb |
Path/Name for result. |
--help |
-h |
N/A | N/A | Show usage instructions. |
📝 Mapping Example #
Your metadata is preserved! The tool maps ARB structures to Excel columns like this:
| ARB Key | ARB Value | @Description | ➡️ | Excel Columns |
|---|---|---|---|---|
loginBtn |
"Sign In" | "Button on login" | Key |
💡 Troubleshooting #
- "Command not found": You likely need to add the pub-cache bin to your PATH. On macOS/Linux, this is usually
~/.pub-cache/bin. - Empty Rows: The tool automatically skips empty rows or rows missing a "Key" during the import process.
- Indentation: The tool enforces a 2-space JSON indentation to keep your git diffs clean.
🤝 Feedback & Issues #
I created this tool to make Flutter localization easier! If you find it helpful, please give it a Like on pub.dev.
Found a bug? Report it on GitHub.
Created by Mohit