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
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;
}
}