getTranslator function
- BuildContext context
Implementation
Translator getTranslator(BuildContext context) {
try {
var translator = ShellTranslationService().translate;
return (
String key, {
List<String>? params,
}) =>
translator(context, key, params: params);
} on Exception catch (_) {
return (
String key, {
List<String>? params,
}) =>
key;
}
}