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
translatorpackage.
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
- Add your main language strings
Place all your string keys inlib/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
-
Add your main language code ' <language_code>'
arorenor any other language code you prefer. -
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
''''