sinew_l10n 1.0.0
sinew_l10n: ^1.0.0 copied to clipboard
English and Indonesian translations of Sinew's local error messages.
sinew_l10n #
English and Indonesian translations of Sinew's local error messages.
sinew_exception gives every failure a message key and an English fallback. This package translates those keys, and plugs into Flutter's localization, so an error shown in the app follows the app's language.
Features #
SinewLocalizations: the generated localizations and delegates, in English and IndonesianSinewLocalizer: aLocalizerforSinewException.displayMessage, which asks your own strings first and falls back to Sinew's
Getting started #
flutter pub add sinew_l10n
Usage #
Add the delegates to your app, then render an error with the localizer:
MaterialApp(
localizationsDelegates: SinewLocalizations.localizationsDelegates,
supportedLocales: SinewLocalizations.supportedLocales,
home: const Home(),
);
// in a build method
final localizer = SinewLocalizer.of(context);
Text(error.displayMessage(localizer));
Pass appStrings: to SinewLocalizer.of to translate your own error keys through the same localizer.
Related packages #
Sinew is one architecture for Flutter and Kotlin, released as a set of packages at one version.
Documentation #
- Usage docs: sinew.srctool.com
- API reference: pub.dev/documentation/sinew_l10n
- Source and issues: srctool/sinew-dart
- Design and decisions: the Guide
License #
Apache 2.0, see LICENSE.