flutter_i18n_translator 0.2.2 copy "flutter_i18n_translator: ^0.2.2" to clipboard
flutter_i18n_translator: ^0.2.2 copied to clipboard

A Flutter/Dart CLI tool that detects missing keys in JSON localization files, auto-translates them, and can regenerate Dart i18n helpers.

Changelog #

All notable changes to this project are documented in this file.

0.2.2 — 2026-07-07 #

Changed #

  • json_string_map is now a part of flutter_i18n_translator_shared.dart; CLI and runtime loader share one library.
  • Removed unused path dependency.

0.2.1 — 2026-07-07 #

✨ Added #

  • JSON-backed tr("key") lookup in generated I18n (enabled by default with --enhanceGeneratedFile).
    • Embeds one canonical key per translation at codegen time (no duplicate aliases).
    • Key format is configurable: dot, camel, pascal, snake, or kebab via flattenKeyStyle in i18nconfig.json or --flatten-key-style.
    • Default is dot (flat keys unchanged; nested keys become profile.title).
    • --key-case also applies to flatten style when --flatten-key-style is not set.
  • Runtime loader library — import package:flutter_i18n_translator/i18n_loader.dart for standalone JSON loading:
    • I18nJsonLoader.fromJsonString(...), fromJsonMap(...), fromFile(...)
    • loader.tr("key") with the same flattening rules as codegen.
  • --addTrLookup / --no-addTrLookup CLI flags to control injection of tr() into generated I18n.

0.2.0 — 2025-03-02 #

✨ Added #

  • Added setup steps for integrating the package with:
    • VS Code
    • Cursor
    • Android Studio
  • Added additional missing WidgetsLocalizations overrides.

0.1.9 — 2025-12-10 #

  • Added a donation link.

PayPal:
https://paypal.me/mazenelgayar

InstaPay:
https://ipn.eg/S/mazenel-gayarcib/instapay/0ecfXw
Tag: mazenel-gayarcib@instapay

0.1.8 - 2025-09-29 #

Added #

  • --enhanceGeneratedFile and --no-enhanceGeneratedFile CLI flags
    • Enhances the generated I18n file by:
      • Modifying the locale setter to automatically reload and update calling onLocaleChanged automatically
      • Adding a static current instance of I18n so you can access translations without BuildContext
    • Default is --enhanceGeneratedFile enabled; can be explicitly disabled with --no-enhanceGeneratedFile.
  • New example in example.dart for --enhanceGeneratedFile.

0.1.7 - 2025-09-25 #

  • Added --autoDartFixGeneratedFile and --no-autoDartFixGeneratedFile CLI flags
    • Allows automatically running dart fix --apply on generated files after code generation
    • Enabled by default, can be disabled with --no-autoDartFixGeneratedFile

0.1.6 - 2025-09-25 #

Fixed #

  • Corrected all key case conversion functions:
    • _toCamelCase, _toPascalCase, _toSnakeCase, _toKebabCase.
    • Now accurately converts any input without breaking internal capitalization or producing incorrect outputs.

0.1.5 - 2025-09-25 #

Added #

  • Steps in README for adding flutter_i18n_translator as an External Tool in Android Studio.
  • Example shortcuts via Keymap for quick access.

Changed #

  • i18PrintNormal now prints to stdout instead of stderr so normal messages are no longer displayed in red.
  • i18PrintError still prints to stderr in red.
  • i18PrintDebug prints to stderr in green (if debug is enabled).

0.1.4 - 2025-09-25 #

Added #

  • --key-case flag to automatically convert all JSON keys to a specific case.
  • Supported key case styles:
    • camel, camelcase, camel_case → camelCase
    • pascal, pascalcase, pascal_case → PascalCase
    • snake, snakecase, snake_case → snake_case
    • kebab, kebabcase, kebab_case, dash, dashcase, dash_case → kebab-case
  • New examples in example.dart for each --key-case style.
  • Updated README with --key-case documentation.

Changed #

  • Updated CLI help to show all supported --key-case options.

0.1.3 - 2025-09-25 #

Added #

  • --autoGenerate flag to automatically regenerate i18n files (runs dart run i18n_json).
  • --no-autoGenerate flag to explicitly disable automatic generation.
  • --addMissingOverrides flag to ensure missing WidgetsLocalizations overrides are injected into the root I18n class after generation.
  • --no-addMissingOverrides flag to skip injecting missing overrides.

Changed #

  • Updated CLI help message to include the new options.

0.1.0 - 2025-09-24 #

  • Initial release of i18n_translator CLI tool.
  • Features:
    • Detects missing keys in JSON localization files.
    • Supports automatic translation using Google Translator.
    • Allows batching translations with a configurable character limit.
    • Options to auto-translate and apply without manual confirmation.
    • Debug logging with --show-debug and --no-debug.
    • CLI help with --help.
2
likes
160
points
28
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter/Dart CLI tool that detects missing keys in JSON localization files, auto-translates them, and can regenerate Dart i18n helpers.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

translator

More

Packages that depend on flutter_i18n_translator