Skip to main content

Automatically manage metadata in ARB (Application Resource Bundle) localization files for Flutter, Angular, Chrome extensions, and more

Project description

ARB Metadata Tools

PyPI version PyPI downloads Python versions GitHub stars License

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:

  1. add_arb_metadata.py - Adds empty metadata blocks to all keys
  2. 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., *Bn for 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

# If installed from PyPI
arb-metadata

# Or if running from source
python add_arb_metadata.py

This adds empty metadata blocks to all keys without metadata.

Intelligent Description Generation

# If installed from PyPI
arb-descriptions

# Or if running from source
python add_descriptions_intelligently.py

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

👨‍💻 Author

Md. Jehadur Rahman Emran

Software Engineer • Researcher • Full-Stack Developer

GitHub LinkedIn Twitter Portfolio Email

Acknowledgments

Created to solve ARB metadata management for Flutter localization projects.

Support

If you find this tool helpful, please ⭐ star the repository!

Related

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arb_metadata_tools-1.0.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arb_metadata_tools-1.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file arb_metadata_tools-1.0.0.tar.gz.

File metadata

  • Download URL: arb_metadata_tools-1.0.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for arb_metadata_tools-1.0.0.tar.gz
Algorithm Hash digest
SHA256 48383946142ec38b152a30d8de00b57c442436f7044af97f7a86d6c2314222a7
MD5 6668825c7c6a4fba026e6f03053fe77f
BLAKE2b-256 389af06d9a8a248e120a0118d31fb1530cf26ce0a3feeee3679dfcda44fbc949

See more details on using hashes here.

File details

Details for the file arb_metadata_tools-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for arb_metadata_tools-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62ff58529ec3286c224ee1f8c6694174aee9b5d3087713d3dd868295a6c66bc2
MD5 aa047b833cb2a9fcd4b2bac892c266df
BLAKE2b-256 42fff1efda665605ea6324b13e1aa15da41359c9a2c811d4252dac292927c49e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page