Skip to content
pubscout

flutter_string_extractor

3.0.0, released 13 days ago by an unverified publisher

Extract Flutter translation strings and keys to JSON catalogs with optional AI discovery and translation.

$ flutter pub add flutter_string_extractor
Source repository

What it does

Parses Flutter/Dart source files to extract static localization strings and keys into JSON catalogs. It preserves existing translations and keys across runs, and supports optional AI-powered discovery and translation using OpenAI, Claude, Gemini, or local models.

AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to extract hardcoded strings or localization keys into a JSON catalog for your Flutter app.
  • You use localization libraries like GetX, Easy Localization, Flutter Translate, FlutterI18n, i18n_extension, or Intl.
  • You want optional AI assistance to discover unmarked text and translate it into multiple languages.

Skip it when

  • You need automated runtime string extraction or widget rewriting inside source code.
  • You are strictly prohibited from using third-party AI APIs for content translation.

Strengths

  • Supports multiple popular localization patterns and custom wrapper functions or getters.
  • Preserves existing translation values and nested dictionary structures on subsequent runs.
  • Offers optional local or cloud AI discovery and translation with validation of placeholders and markup.

Weaknesses

  • AI-generated translations can make mistakes or require manual review for accuracy and context.
  • Does not resolve package imports or rewrite source code automatically.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

Activate via dart pub global activate flutter_string_extractor and run from your project root.

flutter_string_extractor -s lib -o assets/translations/en.json

Alternatives

Packages that do the same job and could replace flutter_string_extractor.

  • i18n_extension

    Translation and localization for Flutter using Dart extensions to reduce boilerplate.

  • slang

    Type-safe i18n solution generating Dart translation classes from JSON, YAML, CSV, or ARB files

  • l10n_languages

    Provides CLDR-like translations for language names across 157 locales.

  • l10n_currencies

    Provides CLDR-like currency name translations for 149 locales in pure Dart with zero dependencies.

Works with

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