i18n_builder
A Dart builder that automatically updates i18n translation files.
Features
- Automatically detects .i18n keys in your Dart files
- Updates translation JSON files
- Maintains existing translations
- Removes obsolete keys
- based on format of translations in i18n_extension
Usage
- Add to your
pubspec.yaml:
dev_dependencies:
i18n_builder: ^1.1.1
- (Optional) Add to your
build.yamlor create ai18n_builder.yamlfile:
builders:
i18n_builder:
enabled: true
base_locale: en-US # default
translations_dir: assets/translations # default
key_is_base_text: true # default - if true, the key will be set to the base locale text
Suggestions
- You can use the BabelEdit to make easy translate your files.
To run standalone
Usage: dart run bin/i18n_standalone.dart <source_dir> <translations_dir> [options]
Options:
--base-locale <locale> Base locale (default: en)
--key-is-base-text Use key as base text (default: false)
--remove-obsolete Remove obsolete keys (default: false)
License
MIT