l10n_plus 0.1.0
l10n_plus: ^0.1.0 copied to clipboard
Minimal runtime for type-safe generated Flutter/Dart localizations.
Changelog #
0.1.0 #
First release. The runtime half of l10n_plus, with zero dependencies.
L10nLocale: a locale value type with canonical parsing ofen,pt_BR,zh-Hant-TWand friends.L10nLocaleResolver: thelocale → language → fallbackchain used by generatedAppLocalizations.of. With no exact match and no bare language it takes the first supported locale sharing the language, in the order given —en_NZresolves toen_AUoveren_GBbecauseAUsorts first, and for no other reason. Arbitrary, stable, and documented rather than dressed up as a preference.PluralOperands: the CLDR operandsn, i, v, w, f, t, computed from anum. The rules themselves are inlined into generated code, so no rule table ships in an application. Note that anumcannot carry what CLDR callsv:1.0and1are the same value in Dart, so both have no visible fraction digits here.BaseTranslationsandAppLocaleBase, the interfaces generated code implements.L10nCurrent: the cell behindAppLocalizations.currentwithglobal_translations: true. It holds a locale, not translations, so a deferred locale reads as itself once its chunk arrives; one owner at a time, asserted in debug.