Skip to content
pubscout

intl_translation

0.22.0, released 4 months ago by dart.dev

Generates Dart code for intl messages from ARB files for localization.

$ flutter pub add intl_translation
Source repository

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_*.arb

Alternatives

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

  • slang

    Offers code generation for type‑safe localization with a more modern workflow

Works with

Packages commonly used together with intl_translation: ones it builds on, ones built on it, and its own family.