chore: migrate mobile translations accessor (1) (#30667)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2026-08-11 14:41:11 +05:30 committed by GitHub
parent 235daff561
commit 565fbe4917
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 207 additions and 177 deletions

View file

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