l10n_plus 0.1.0
l10n_plus: ^0.1.0 copied to clipboard
Minimal runtime for type-safe generated Flutter/Dart localizations.
l10n_plus #
Runtime for translations generated by
l10n_plus_generator.
Zero dependencies, pure Dart, no Flutter. Generated translations are usable
from servers, CLIs and unit tests; add
l10n_plus_flutter for the
widget layer.
This package is small on purpose. Everything that can be decided while generating code is decided there, so what ships is:
L10nLocale— a locale value type with canonical parsing.L10nLocaleResolver— thelocale → language → fallbackchain.PluralOperands— the CLDR operandsn, i, v, w, f, t. The rules themselves are inlined into the generated code, so no rule table ships.- The interfaces generated classes implement.
You do not call any of this directly. Add it as a dependency, point the generator at your translations, and use the API it writes:
final t = AppLocalizations.forLocale(AppLocale.en);
t.auth.login.title; // 'Log in'
t.wallet.cards(count: 3); // '3 cards'
Full guide, configuration and design notes: the repository README and docs/architecture.md.