{"id":26477521,"url":"https://github.com/thanhhaidev/easy_localization_cleaner","last_synced_at":"2026-05-04T20:32:35.246Z","repository":{"id":283110764,"uuid":"950722320","full_name":"thanhhaidev/easy_localization_cleaner","owner":"thanhhaidev","description":"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.","archived":false,"fork":false,"pushed_at":"2025-03-20T16:29:48.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-05T10:46:58.437Z","etag":null,"topics":["cli","flutter","localization"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/easy_localization_cleaner","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thanhhaidev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-18T15:34:42.000Z","updated_at":"2025-03-20T16:29:52.000Z","dependencies_parsed_at":"2025-03-18T16:41:34.124Z","dependency_job_id":"f03e9cc0-3010-4ca0-813e-4e0fc37eb0ad","html_url":"https://github.com/thanhhaidev/easy_localization_cleaner","commit_stats":null,"previous_names":["thanhhaidev/easy_localization_cleaner"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/thanhhaidev/easy_localization_cleaner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanhhaidev%2Feasy_localization_cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanhhaidev%2Feasy_localization_cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanhhaidev%2Feasy_localization_cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanhhaidev%2Feasy_localization_cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thanhhaidev","download_url":"https://codeload.github.com/thanhhaidev/easy_localization_cleaner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanhhaidev%2Feasy_localization_cleaner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32624079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","flutter","localization"],"created_at":"2025-03-20T00:47:31.517Z","updated_at":"2026-05-04T20:32:35.231Z","avatar_url":"https://github.com/thanhhaidev.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# easy_localization_cleaner\n\n[![pub package](https://img.shields.io/pub/v/easy_localization_cleaner.svg)](https://pub.dartlang.org/packages/easy_localization_cleaner)\n\n`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.\n\n## Features\n\n- **Extract Localization Keys**: Scans your Dart files for localization keys.\n- **Identify Unused Keys**: Compares the keys in your JSON files with the ones used in your code.\n- **Remove Unused Keys**: Safely removes unused keys from your JSON files while preserving base keys.\n- **Manually Remove Keys**: Specify keys to remove using the `--remove-keys` option.\n- **Export Logs**: Generates a log file listing unused keys for review.\n- **Format JSON Files**: Allows you to specify the indentation format for JSON files (e.g., tabs or spaces).\n- **Configuration Support**: Supports configuration via `easy_localization_cleaner.yaml` or `pubspec.yaml`.\n\n## Installation 💻\n\n### Install via dev dependency\n\n```shell\n$ flutter pub add --dev easy_localization_cleaner\n\n# And it's ready to go:\n$ dart run easy_localization_cleaner [options]\n```\n\n### or [Globally activate][] the package:\n\n[globally activate]: https://dart.dev/tools/pub/cmd/pub-global\n\n```shell\n$ dart pub global activate easy_localization_cleaner\n\n# And it's ready to go:\n$ easy_localization_cleaner [options]\n```\n\n## Usage 🚀\n\nTo use `easy_localization_cleaner`, run the following command:\n\n```shell\n$ easy_localization_cleaner --current-path=/path/to/project --assets-dir=assets/translations\n```\n\n### Options\n\n| Option                        | Description                                                                                | Default Value           |\n| ----------------------------- | ------------------------------------------------------------------------------------------ | ----------------------- |\n| `--current-path` , `-p`       | The current path of the project.                                                           | Current directory (`.`) |\n| `--generated-class-key`, `-g` | The name of the generated class key.                                                       | `LocaleKeys`            |\n| `--assets-dir`, `-a`          | The directory where the JSON files are located.                                            | `assets/translations`   |\n| `--remove-keys`, `-k`         | Manually specify keys to remove from JSON files (comma-separated).                         | None                    |\n| `--[no-]export`, `-e`         | Save unused keys as a .log file in the path provided.                                      | false                   |\n| `--json-indent`, `-j`         | Specify the JSON indentation format. Use `\\t` for tabs or a number (e.g., `4`) for spaces. | 2 spaces                |\n| `--auto-remove-keys`, `-r`    | Automatically remove unused keys without confirmation.                                     | true                    |\n| `--help`, `-h`                | Display the help message.                                                                  |\n\n### Examples\n\n1. **Default Usage**:\n\n   ```shell\n   $ easy_localization_cleaner\n   ```\n\n2. **Specify JSON Indentation with Tabs**:\n\n   ```shell\n   $ easy_localization_cleaner --json-indent=\\t\n   ```\n\n3. **Specify JSON Indentation with 4 Spaces**:\n\n   ```shell\n   $ easy_localization_cleaner --json-indent=4\n   ```\n\n4. **Manually Remove Specific Keys**:\n\n   ```shell\n   $ easy_localization_cleaner --remove-keys=key1,key2,key3\n   ```\n\n5. **Run with All Options**:\n\n   ```shell\n   $ easy_localization_cleaner --current-path=/path/to/project --assets-dir=assets/translations --json-indent=4 --export --remove-keys=key1,key2\n   ```\n\n## Configuration 📄\n\nYou can configure `easy_localization_cleaner` using either `easy_localization_cleaner.yaml` or the `easy_localization_cleaner` section in `pubspec.yaml`. Below is an example configuration:\n\n```yaml\neasy_localization_cleaner:\n  current_path: .\n  remove_keys:\n    - \"key1\"\n    - \"key2\"\n  auto_remove_keys: false\n  export_log: true\n  assets_dir: assets/translations\n  json_indent: 2\n```\n\n### Configuration Options\n\n- `current_path`: Specifies the current project path for locating files and resources.\n- `remove_keys`: A list of keys to remove from JSON files.\n- `auto_remove_keys`: A flag to enable or disable automatic removal of unused keys.\n- `export_log`: A flag to enable or disable exporting unused keys to a log file.\n- `assets_dir`: Specifies the directory where the JSON files are located.\n- `json_indent`: Specifies the number of spaces or tab character for JSON indentation.\n\n## Contributing 🤝\n\nContributions are welcome! Please open an issue or submit a pull request.\n\n## License 📄\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthanhhaidev%2Feasy_localization_cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthanhhaidev%2Feasy_localization_cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthanhhaidev%2Feasy_localization_cleaner/lists"}