chore(mobile): translate toast messages (#17964)

This commit is contained in:
Ben 2025-04-29 15:26:41 -04:00 committed by GitHub
parent d89e88bb3f
commit ac73e163df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 3 deletions

View file

@ -0,0 +1,14 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:intl/message_format.dart';
String t(String key, [Map<String, Object>? args]) {
try {
String message = key.tr();
if (args != null) {
return MessageFormat(message).format(args);
}
return message;
} catch (e) {
return key;
}
}