Tired of manually converting translation spreadsheets into .arb files for your Flutter or Dart projects? This command-line tool automates the process, letting you manage your localization in a simple Excel file—and generates all the necessary Application Resource Bundle (.arb) files instantly.
You provide a link to a specially formatted Excel file, and the tool generates the corresponding .arb files for each language, ready to be used in your application.
Excel File → excel2arb Tool → Generated .arb Files
Make sure you have the Dart SDK installed.
Activate the package globally:
dart pub global activate excel2arbThis makes the excel2arb command available globally in your terminal.
Create an Excel sheet following these key formatting rules. You can see a full example here.
| Column | Description |
|---|---|
Name [name] |
Required. Used as the JSON key in .arb files. |
Language {locale} |
Required. Columns with language names and 2-letter locale in {}. E.g., English {en} |
Remark |
Optional. Notes or instructions for translators. |
Placeholders [placeholders] |
Optional. JSON object defining placeholders and their types. |
Name [name] |
Description [description] |
Remark | English {en} |
Myanmar {my} |
Placeholders [placeholders] |
|---|---|---|---|---|---|
greeting |
A welcome message | Hello, World! | မင်္ဂလာပါ လောကကြီး | ||
welcomeUser |
Welcomes a specific user | Keep {} as-is |
Hello {userName} |
မင်္ဂလာပါ {userName} |
{"userName": {"type": "String"}} |
Once your Excel file is published and accessible via URL, run:
excel2arb --excel-url <your-excel-file-url> --output-directory <path-to-output-folder>If the script isn't found, try:
dart pub global run excel2arb --excel-url <your-excel-file-url> --output-directory <path-to-output-folder>| Flag | Alias | Description | Default |
|---|---|---|---|
--excel-url |
-u |
(Required) Public URL of the Excel file | |
--sheet-name |
-s |
Sheet name to parse | Localization |
--output-directory |
-o |
Directory to save .arb files |
Current directory |
--gen-l10n |
-g |
Also generate l10n.yaml config |
false |
excel2arb -u https://example.com/sample.xlsx -s Localization -o output_dir -g trueYou can use Google Sheets instead of Excel:
- Create your spreadsheet in Google Sheets (follow the same format).
- Go to File → Share → Publish to web.
- Under the Link tab, select the specific sheet.
- Change format to Microsoft Excel (.xlsx).
- Click Publish.
- Copy the generated link and use it with
--excel-url.
✅ This gives you a live Excel download link, so your team can collaborate in real-time—just run the generator when you're ready.
If you're using Android Studio or any JetBrains IDE, streamline the sync using the Dart Scripts Runner plugin.
- Install Dart Scripts Runner from JetBrains Marketplace.
- In
pubspec.yaml, add:
scripts:
sync_localization:
script: excel2arb -u https://shorturl.at/abcd -o lib/l10n/locales -g true
description: Sync localization from google sheet- Replace the URL with your actual spreadsheet link.
- Now, you can run
sync_localizationdirectly from the Dart Scripts tool window in your IDE—just one click!
- ✅ Downloads Excel files directly from a URL
- ✅ Generates
.arbfiles for all languages - ✅ Supports custom sheet names
- ✅ Optionally generates
l10n.yaml - ✅ Handles placeholders and their types
Contributions are welcome! Feel free to open an issue or submit a PR on the GitHub repo.
