Skip to content
pubscout

translations_cleaner

0.2.1, released 5 months ago by chinmaykabi.com

Command-line tool to find, delete, and sort unused translations in .arb files.

$ flutter pub add translations_cleaner
Source repository

What it does

Searches Dart files using AST parsing to detect key usage and automatically cleans, sorts, or lists unused translation keys across all languages in .arb files. Designed for flutter_localizations.

AI-written summary of version 0.2.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You use flutter_localizations with .arb files and want to remove dead or unused translation keys.
  • You want to sort translation keys alphabetically.
  • You want to enforce unused translation checks in a CI pipeline.

Skip it when

  • Your project uses localization formats other than .arb files, such as JSON or YAML.
  • You need automated runtime localization loading rather than a build-time/dev-time cleanup utility.

Strengths

  • AST-based detection drastically reduces false positives compared to raw regex searches.
  • Supports multiple commands including cleaning, listing unused terms, and sorting translations.
  • Can be easily integrated into CI workflows with the abort flag.

Weaknesses

  • Limited exclusively to .arb files and flutter_localizations.
  • Does not support other localization formats like JSON or YAML.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

Add translations_cleaner as a dev dependency in your pubspec.yaml and run via dart run or flutter pub run.

dart pub add --dev translations_cleaner
dart run translations_cleaner clean-translations

Alternatives

Packages that do the same job and could replace translations_cleaner.

Works with

Packages commonly used together with translations_cleaner: ones it builds on, ones built on it, and its own family.