mirror of
https://github.com/immich-app/immich.git
synced 2025-12-18 01:11:07 +03:00
chore(mobile): translate toast messages (#17964)
This commit is contained in:
14
mobile/lib/utils/translation.dart
Normal file
14
mobile/lib/utils/translation.dart
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user