easy_localization_cleaner 0.0.2
easy_localization_cleaner: ^0.0.2 copied to clipboard
A Dart CLI tool designed to clean up unused localization keys from JSON/Arb files used with the `easy_localization` package.
easy_localization_cleaner #
easy_localization_cleaner
is a Dart CLI tool designed to clean up unused localization keys from JSON files used with the easy_localization
package. It helps developers maintain clean and organized localization files by identifying and removing unused keys.
Features #
- Extract Localization Keys: Scans your Dart files for localization keys.
- Identify Unused Keys: Compares the keys in your JSON files with the ones used in your code.
- Remove Unused Keys: Safely removes unused keys from your JSON files while preserving base keys.
- Export Logs: Generates a log file listing unused keys for review.
Installation 💻 #
Install via dev dependency #
$ flutter pub add --dev easy_localization_cleaner
# And it's ready to go:
$ dart run easy_localization_cleaner:main [options]
or Globally activate the package: #
$ dart pub global activate easy_localization_cleaner
# And it's ready to go:
$ easy_localization_cleaner [options]
Usage 🚀 #
To use easy_localization_cleaner
, run the following command:
$ easy_localization_cleaner --current-path=/path/to/project --assets-dir=assets/translations
Options #
Option | Description | Default Value |
---|---|---|
--current-path , -c |
The current path of the project. | Current directory (. ) |
--generated-class-key , -g |
The name of the generated class key. | LocaleKeys |
--assets-dir , -a |
The directory where the JSON files are located. | assets/translations |
--export-log-file , -e |
The path to export the log file. | easy_localization_cleaner.log |
--help , -h |
Display the help message. |
Contributing 🤝 #
Contributions are welcome! Please open an issue or submit a pull request.
License 📄 #
This project is licensed under the MIT License - see the LICENSE file for details.