layrz_i18n 1.0.1
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:
LayrzAppLocalizationsis nowLayrzI18n - Breaking:
LayrzAppLocalizationsDelegateis nowLayrzI18nDelegate - Breaking:
debugCheckHasLayrzAppLocalizations(BuildContext)is nowdebugCheckHasLayrzI18n(BuildContext) - New:
BuildContextextensionLayrzI18nContextExtensionwithi18nandmaybeI18ngetters for ergonomic access to translations (context.i18n.t('key')instead ofLayrzI18n.of(context).t('key')) - Note: Depends on the Flutter SDK,
freezed_annotation,json_annotation,collection, andweb. 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
paddingparameter fromte() - Change:
AvailableLanguage.messagesmap returned as-is (not wrapped inEqualUnmodifiableMapView) 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 invalidLocale('en','')
0.0.1 #
- Initial release: the i18n engine extracted from
layrz_modelsinto a standalone package with performance optimizations