ARB Metadata Tools
A collection of Python scripts to automatically manage metadata in ARB (Application Resource Bundle) localization files.
Works with: Flutter, Angular, Chrome Extensions, and any application using ARB format for internationalization (i18n/l10n).
Problem
When using ARB files for localization, the Google ARB VS Code extension shows warnings for keys without metadata. Manually adding metadata to hundreds of keys is tedious and time-consuming.
This affects developers using:
- Flutter apps
- Angular applications
- Chrome extensions
- Any project using ARB format for i18n/l10n
Solution
These tools automatically add and manage metadata for your ARB files:
- add_arb_metadata.py - Adds empty metadata blocks to all keys
- add_descriptions_intelligently.py - Intelligently generates contextual descriptions based on key names and values
Features
- ✅ Automatically adds metadata to all ARB keys
- ✅ Intelligently generates contextual descriptions
- ✅ Preserves existing metadata with placeholders
- ✅ Supports multiple ARB files
- ✅ Pattern-based description generation
- ✅ Handles bilingual keys (e.g.,
*Bnfor Bengali)
Installation
Option 1: Install from PyPI (Recommended)
pip install arb-metadata-tools
Option 2: Install from Source
# Clone the repository
git clone https://github.com/JehadurRE/arb-metadata-tools.git
cd arb-metadata-tools
# Install in development mode
pip install -e .
# Or install directly
pip install .
Requirements: Python 3.6+ (no external dependencies)
Usage
After installation, you can use the command-line tools:
Basic Metadata Addition
# Process default files (lib/l10n/app_en.arb, lib/l10n/app_bn.arb)
arb-metadata
# Process specific files
arb-metadata path/to/file1.arb path/to/file2.arb
# Show help
arb-metadata --help
# Show version
arb-metadata --version
This adds empty metadata blocks to all keys without metadata.
Intelligent Description Generation
# Process default files
arb-descriptions
# Process specific files
arb-descriptions path/to/file1.arb path/to/file2.arb
# Show each description being added (verbose mode)
arb-descriptions --verbose path/to/file.arb
# Show help
arb-descriptions --help
# Show version
arb-descriptions --version
This generates contextual descriptions based on:
- Key naming patterns (Label, Hint, Desc, etc.)
- Action verbs (send, create, confirm, etc.)
- Content analysis (questions, exclamations, labels)
- Context clues (Dashboard, Management, History, etc.)
Examples
Before
{
"loginButton": "Login",
"enterPassword": "Enter your password"
}
After
{
"loginButton": "Login",
"@loginButton": {
"description": "Button text to login to the application"
},
"enterPassword": "Enter your password",
"@enterPassword": {
"description": "Placeholder text to enter password field"
}
}
Configuration
For Command-Line Usage
The tools look for ARB files in the standard Flutter location: lib/l10n/
For Custom Paths
Edit the file paths in the scripts to match your project structure:
arb_files = [
'lib/l10n/app_en.arb',
'lib/l10n/app_bn.arb',
# Add more ARB files as needed
]
Pattern Recognition
The intelligent description generator recognizes:
- Labels:
*Label→ "Label for {field} input field" - Hints:
*Hint→ "Placeholder or hint text for {field}" - Actions:
send*,create*,confirm*→ Action descriptions - Validation:
please*,*Must*→ Validation messages - Status:
*Successful,*Failed→ Status messages - Screens:
*Dashboard,*Management→ Screen titles
Requirements
- Python 3.6+
- No external dependencies
📋 Changelog
See CHANGELOG.md for a complete list of changes and release notes for each version.
Latest Release (v1.1.0):
- Added proper
--helpand--versioncommand-line arguments - Enhanced CLI with
argparsefor better user experience - Added
--verboseflag for detailed output - Improved error messages and documentation
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details
👨💻 Author
Acknowledgments
Created to solve ARB metadata management for Flutter localization projects.
Support
If you find this tool helpful, please ⭐ star the repository!
Related
Metadata
Release files for arb-metadata-tools 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| arb_metadata_tools-1.1.0.tar.gz | 10.0 kB | Without provenance | Details for arb_metadata_tools-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| arb_metadata_tools-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for arb_metadata_tools-1.1.0-py3-none-any.whl |
Total release size: 19.8 kB
Release files / arb_metadata_tools-1.1.0.tar.gz
| Download URL | arb_metadata_tools-1.1.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d8c6282c03dacfffd958557029464ca4dcf91395c9641bda67cfc1a7844795a
|
|
BLAKE2b-256 checksum How to use checksums |
520527c550390aa7ff96991690775271d38ee9790dd69412913c5a830b1639c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / arb_metadata_tools-1.1.0-py3-none-any.whl
| Download URL | arb_metadata_tools-1.1.0-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7688dabd7ae501614030ee3724bea36cac93114036bb6df92d61d84eca755326
|
|
BLAKE2b-256 checksum How to use checksums |
957508e6c0f3a3e1a4384bbd16642b80ac0775837e02d1a900612a3910a0884c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for arb-metadata-tools 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.