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.flutter-io.cn.
Found a bug? Report it on GitHub.
Created by Mohit