mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
chore: migrate mobile translations accessor (1) (#30667)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
235daff561
commit
565fbe4917
30 changed files with 207 additions and 177 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/generated/translations.g.dart';
|
||||
|
||||
part 'sync_status.provider.freezed.dart';
|
||||
|
||||
|
|
@ -12,11 +12,12 @@ enum SyncStatus {
|
|||
error;
|
||||
|
||||
String localized() {
|
||||
final t = StaticTranslations.instance;
|
||||
return switch (this) {
|
||||
SyncStatus.idle => "idle".tr(),
|
||||
SyncStatus.syncing => "running".tr(),
|
||||
SyncStatus.success => "success".tr(),
|
||||
SyncStatus.error => "error".tr(),
|
||||
SyncStatus.idle => t.idle,
|
||||
SyncStatus.syncing => t.running,
|
||||
SyncStatus.success => t.success,
|
||||
SyncStatus.error => t.error,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue