intl_translation
0.22.0, released 4 months ago by dart.dev
Generates Dart code for intl messages from ARB files for localization.
What it does
Extracts translatable messages from Dart source into ARB files, then generates locale‑specific Dart libraries from those ARB files. It works with the intl package to provide runtime message lookup.
AI-written summary of version 0.22.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need compile‑time generation of localized message libraries
- You want to keep translation files in ARB format and integrate with intl
- You prefer a CLI‑driven workflow for extracting and generating messages
Skip it when
- You need hot‑reload translation updates without rebuilding
- You prefer runtime‑only solutions like JSON‑based localization
- You are using Flutter packages that already handle extraction (e.g., easy_localization)
Strengths
- Integrates tightly with the intl package
- Supports code generation for null‑safe Dart
- CLI tools for extraction and generation
Weaknesses
- Requires a build step and regeneration after each translation change
- No support for hot‑reload of translations
- Limited to ARB format, not JSON or other formats
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
dart run intl_translation:extract_to_arb --output-dir=lib/l10n lib/main.dart
dart run intl_translation:generate_from_arb --generated-file-prefix=messages lib/main.dart lib/l10n/intl_*.arbAlternatives
Packages that do the same job and could replace intl_translation.
- easy_localization
Handles ARB/JSON translations at runtime with hot‑reload, no codegen needed
64Compare - slang
Offers code generation for type‑safe localization with a more modern workflow
90Compare
Works with
Packages commonly used together with intl_translation: ones it builds on, ones built on it, and its own family.
- analyzerintl_translation depends on itPerforms static analysis of Dart code for tool integration and embedding.
- pub_semverintl_translation depends on itVersions and version constraints implementing pub's versioning policy.
- package_configintl_translation depends on itRead and write Dart package configuration files.
- dart_styleintl_translation depends on itProvides an API and CLI to format Dart source code automatically.
- argsintl_translation depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- intlintl_translation depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- testSame familyA full featured library for writing and running Dart tests across platforms.
- jniSame familyProvides Dart/Flutter bindings to call native Java code via JNI.