tr function
Imperative resolve from a context (for snackbars/dialogs).
Implementation
String tr(BuildContext context, sl.StringLocale string,
{Map<String, Object?> args = const {}}) {
final scope = StringLocaleScope._inherited(context);
return scope.bundle.has(string.id)
? scope.bundle.resolve(scope.locale, string.id, args)
: string.resolve(locale: scope.locale, args: args);
}