mirror of
https://github.com/immich-app/immich
synced 2025-06-08 16:27:58 +00:00
16 lines
379 B
Dart
16 lines
379 B
Dart
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, locale: Intl.defaultLocale ?? 'en')
|
|
.format(args);
|
|
}
|
|
return message;
|
|
} catch (e) {
|
|
return key;
|
|
}
|
|
}
|