l10n_health 0.1.1 copy "l10n_health: ^0.1.1" to clipboard
l10n_health: ^0.1.1 copied to clipboard

Health check for the translation layer of Dart and Flutter apps. Finds unused and missing ARB keys, placeholder mismatches, duplicate and untranslated values, hardcoded UI strings and invisible Unicod [...]

example/lib/main.dart

// A Flutter app would import its generated localizations; this example
// only needs to parse, so the class is declared inline.
class AppLocalizations {
  static AppLocalizations of(Object context) => AppLocalizations();
  String get appTitle => '';
  String greeting(String name) => '';
  String itemCount(int count) => '';
  String get close => '';
}

extension L10n on Object {
  AppLocalizations get l10n => AppLocalizations.of(this);
}

void build(Object context) {
  final l10n = AppLocalizations.of(context);
  label(l10n.appTitle);
  label(context.l10n.greeting('Ana'));
  label(AppLocalizations.of(context).itemCount(3));

  // Bypasses localization: German users see English.
  label('Please select a pharmacy');
  // Already translated as "close".
  label('Close');
}

void label(String text) {}
0
likes
150
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Health check for the translation layer of Dart and Flutter apps. Finds unused and missing ARB keys, placeholder mismatches, duplicate and untranslated values, hardcoded UI strings and invisible Unicode, with a safe prune mode and HTML, Markdown and JSON reports.

Repository (GitHub)
View/report issues

Topics

#l10n #i18n #localization #arb #static-analysis

License

MIT (license)

Dependencies

analyzer, glob, path, yaml

More

Packages that depend on l10n_health