Translation Tool

A CLI tool for Flutter/Dart to extract strings from your app and generate localization files with automatic translations.

Features

  • Extracts string constants from your app.
  • Generates locale keys (locale_keys.g.dart) for easy access.
  • Creates JSON translation files for multiple languages.
  • Supports automatic translations using the translator package.

Installation

Add the following to your pubspec.yaml:

yaml

dependencies: translator: ^1.0.4+1

Developer

👨‍💻 Developed by Ahmed Hantop. 🔗 LinkedIn
📂 GitHub ✉️ Email: ahmedhantop@gmail.com

Usage

  1. Add your main language strings
    Place all your string keys in lib/core/strings.dart. This file will act as the source for translations.

your file path must be in lib/core/strings.dart otherwise it won't work

  1. Add your main language code ' <language_code>'
    ar or en or any other language code you prefer.

  2. Run the translation command
    Use the following command in your terminal to generate translations for a specific language:

    dart run multi_languages:translation <source_file> <language_code>
    

Example

dart run multi_languges:translation lib/core/app_strings.dart ar

''''