feat: localisation with en, de, fr and it
This commit is contained in:
@@ -23,6 +23,7 @@ class OptimizedStorageService {
|
||||
static const String _activeServerIdKey = 'active_server_id';
|
||||
static const String _rememberCredentialsKey = 'remember_credentials';
|
||||
static const String _themeModeKey = 'theme_mode';
|
||||
static const String _localeCodeKey = 'locale_code_v1';
|
||||
static const String _localConversationsKey = 'local_conversations';
|
||||
static const String _onboardingSeenKey = 'onboarding_seen_v1';
|
||||
static const String _reviewerModeKey = 'reviewer_mode_v1';
|
||||
@@ -226,6 +227,20 @@ class OptimizedStorageService {
|
||||
await _prefs.setString(_themeModeKey, mode);
|
||||
}
|
||||
|
||||
/// Locale Management
|
||||
String? getLocaleCode() {
|
||||
// Returns a locale code like 'en', 'de', 'fr', 'it'. Null means system.
|
||||
return _prefs.getString(_localeCodeKey);
|
||||
}
|
||||
|
||||
Future<void> setLocaleCode(String? code) async {
|
||||
if (code == null || code.isEmpty) {
|
||||
await _prefs.remove(_localeCodeKey);
|
||||
} else {
|
||||
await _prefs.setString(_localeCodeKey, code);
|
||||
}
|
||||
}
|
||||
|
||||
/// Onboarding
|
||||
Future<bool> getOnboardingSeen() async {
|
||||
return _prefs.getBool(_onboardingSeenKey) ?? false;
|
||||
|
||||
@@ -182,12 +182,12 @@ class UserFriendlyErrorHandler {
|
||||
List<ErrorRecoveryAction> _getServerRecoveryActions() {
|
||||
return [
|
||||
ErrorRecoveryAction(
|
||||
label: 'Try Again',
|
||||
label: 'Retry',
|
||||
action: ErrorActionType.retry,
|
||||
description: 'Retry your request',
|
||||
),
|
||||
ErrorRecoveryAction(
|
||||
label: 'Wait & Retry',
|
||||
label: 'Retry',
|
||||
action: ErrorActionType.retryLater,
|
||||
description: 'Wait a moment then try again',
|
||||
),
|
||||
@@ -223,7 +223,7 @@ class UserFriendlyErrorHandler {
|
||||
description: 'Sign in to your account',
|
||||
),
|
||||
ErrorRecoveryAction(
|
||||
label: 'Try Again',
|
||||
label: 'Retry',
|
||||
action: ErrorActionType.retry,
|
||||
description: 'Retry the request',
|
||||
),
|
||||
@@ -280,7 +280,7 @@ class UserFriendlyErrorHandler {
|
||||
description: 'Select another file',
|
||||
),
|
||||
ErrorRecoveryAction(
|
||||
label: 'Try Again',
|
||||
label: 'Retry',
|
||||
action: ErrorActionType.retry,
|
||||
description: 'Retry the operation',
|
||||
),
|
||||
@@ -314,7 +314,7 @@ class UserFriendlyErrorHandler {
|
||||
description: 'Open app settings to grant permissions',
|
||||
),
|
||||
ErrorRecoveryAction(
|
||||
label: 'Try Again',
|
||||
label: 'Retry',
|
||||
action: ErrorActionType.retry,
|
||||
description: 'Retry after granting permission',
|
||||
),
|
||||
@@ -324,7 +324,7 @@ class UserFriendlyErrorHandler {
|
||||
List<ErrorRecoveryAction> _getGenericRecoveryActions() {
|
||||
return [
|
||||
ErrorRecoveryAction(
|
||||
label: 'Try Again',
|
||||
label: 'Retry',
|
||||
action: ErrorActionType.retry,
|
||||
description: 'Retry the operation',
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user