sinew_l10n

pub package License Docs

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 Indonesian
  • SinewLocalizer: a Localizer for SinewException.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.

Sinew is one architecture for Flutter and Kotlin, released as a set of packages at one version.

Documentation

License

Apache 2.0, see LICENSE.

Libraries

sinew_l10n
English and Indonesian translations of Sinew's local error messages.