layrz_i18n 1.0.1 copy "layrz_i18n: ^1.0.1" to clipboard
layrz_i18n: ^1.0.1 copied to clipboard

Lightweight internationalization engine for Flutter — translations, plurals, rich text and locale detection. No Material dependency.

Changelog #

1.0.1 #

  • Adjusted version constraints to support parity and smooth migration from legacy packages.

1.0.0 #

  • Breaking: LayrzAppLocalizations is now LayrzI18n
  • Breaking: LayrzAppLocalizationsDelegate is now LayrzI18nDelegate
  • Breaking: debugCheckHasLayrzAppLocalizations(BuildContext) is now debugCheckHasLayrzI18n(BuildContext)
  • New: BuildContext extension LayrzI18nContextExtension with i18n and maybeI18n getters for ergonomic access to translations (context.i18n.t('key') instead of LayrzI18n.of(context).t('key'))
  • Note: Depends on the Flutter SDK, freezed_annotation, json_annotation, collection, and web. No dependency on Material Design or layrz_models; works with WidgetsApp and custom widget trees.
  • New: Single-pass tokenizer with template caching for efficient message rendering
  • New: Content-keyed template cache (up to 1,024 entries) — entries never stale across locale switches
  • New: Optimized load() method using locale-keyed index instead of repeated locale parsing
  • Change: tc() now splits plural forms before interpolating (fixes corruption when argument values contain ' | ')
  • Change: shouldReload() now compares delegates by value instead of always returning true
  • Change: Removed unused padding parameter from te()
  • Change: AvailableLanguage.messages map returned as-is (not wrapped in EqualUnmodifiableMapView) for performance — avoids allocations on the hottest path (every translate call); callers must not mutate it
  • Fix: Fixed locale parsing bug where 'en-' and 'en_' produced invalid Locale('en','')

0.0.1 #

  • Initial release: the i18n engine extracted from layrz_models into a standalone package with performance optimizations
0
likes
160
points
293
downloads

Documentation

API reference

Publisher

verified publisherlayrz.com

Weekly Downloads

Lightweight internationalization engine for Flutter — translations, plurals, rich text and locale detection. No Material dependency.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

collection, flutter, freezed_annotation, json_annotation, web

More

Packages that depend on layrz_i18n