mirror of https://github.com/immich-app/immich.git
chore(mobile): translate toast messages (#17964)
parent
d89e88bb3f
commit
ac73e163df
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue