Skip to content

Commit 9d4f14b

Browse files
committed
feat(l10n): add app status and update URLs
- Added translations for app statuses: Maintenance, Operational. - Added translations for update URLs: iOS and Android. - Improved app status descriptions. - Added labels and descriptions for update URL fields. - Removed obsolete `helloWorld` translation.
1 parent f8f0cdc commit 9d4f14b

File tree

6 files changed

+214
-50
lines changed

6 files changed

+214
-50
lines changed

lib/app_configuration/view/app_configuration_page.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import 'package:ht_dashboard/l10n/l10n.dart';
55
import 'package:ht_dashboard/shared/constants/app_spacing.dart';
66
import 'package:ht_dashboard/shared/widgets/widgets.dart';
77
import 'package:ht_shared/ht_shared.dart';
8-
import 'package:ht_shared/src/enums/app_user_role.dart';
98

109
/// {@template app_configuration_page}
1110
/// A page for managing the application's remote configuration.
@@ -887,8 +886,8 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> {
887886
Widget build(BuildContext context) {
888887
final userPreferenceConfig = widget.remoteConfig.userPreferenceConfig;
889888

890-
switch (AppUserRole.values.byName(widget.userRole)) {
891-
case AppUserRole.guestUser:
889+
switch (widget.userRole) {
890+
case 'guestUser':
892891
return Column(
893892
children: [
894893
widget.buildIntField(
@@ -927,7 +926,7 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> {
927926
),
928927
],
929928
);
930-
case AppUserRole.standardUser:
929+
case 'standardUser':
931930
return Column(
932931
children: [
933932
widget.buildIntField(
@@ -967,7 +966,7 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> {
967966
),
968967
],
969968
);
970-
case AppUserRole.premiumUser:
969+
case 'premiumUser':
971970
return Column(
972971
children: [
973972
widget.buildIntField(
@@ -1007,11 +1006,12 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> {
10071006
),
10081007
],
10091008
);
1010-
case AppUserRole.none:
1011-
case AppUserRole.admin: // Assuming admin doesn't have specific limits here
1012-
case AppUserRole.publisher: // Assuming publisher doesn't have specific limits here
1009+
case 'none':
1010+
case 'admin': // Assuming admin doesn't have specific limits here
1011+
case 'publisher': // Assuming publisher doesn't have specific limits here
1012+
return const SizedBox.shrink();
1013+
default:
10131014
return const SizedBox.shrink();
1014-
}
10151015
}
10161016
}
10171017

lib/l10n/app_localizations.dart

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ abstract class AppLocalizations {
9898
Locale('en'),
9999
];
100100

101-
/// The conventional newborn programmer greeting
102-
///
103-
/// In en, this message translates to:
104-
/// **'Hello World!'**
105-
String get helloWorld;
106-
107101
/// Headline for the main authentication page
108102
///
109103
/// In en, this message translates to:
@@ -1430,12 +1424,6 @@ abstract class AppLocalizations {
14301424
/// **'Active'**
14311425
String get appStatusActive;
14321426

1433-
/// Text for the 'Maintenance' app status
1434-
///
1435-
/// In en, this message translates to:
1436-
/// **'Maintenance'**
1437-
String get appStatusMaintenance;
1438-
14391427
/// Text for the 'Disabled' app status
14401428
///
14411429
/// In en, this message translates to:
@@ -1453,6 +1441,66 @@ abstract class AppLocalizations {
14531441
/// In en, this message translates to:
14541442
/// **'For demo, use code: {code}'**
14551443
String demoCodeHint(String code);
1444+
1445+
/// Text for the 'Maintenance' app status
1446+
///
1447+
/// In en, this message translates to:
1448+
/// **'Maintenance'**
1449+
String get appStatusMaintenance;
1450+
1451+
/// Text for the 'Operational' app status
1452+
///
1453+
/// In en, this message translates to:
1454+
/// **'Operational'**
1455+
String get appStatusOperational;
1456+
1457+
/// Label for the 'is under maintenance' switch
1458+
///
1459+
/// In en, this message translates to:
1460+
/// **'Under Maintenance'**
1461+
String get isUnderMaintenanceLabel;
1462+
1463+
/// Description for the 'is under maintenance' switch
1464+
///
1465+
/// In en, this message translates to:
1466+
/// **'Toggle to put the app in maintenance mode, preventing user access.'**
1467+
String get isUnderMaintenanceDescription;
1468+
1469+
/// Label for the 'is latest version only' switch
1470+
///
1471+
/// In en, this message translates to:
1472+
/// **'Force Latest Version Only'**
1473+
String get isLatestVersionOnlyLabel;
1474+
1475+
/// Description for the 'is latest version only' switch
1476+
///
1477+
/// In en, this message translates to:
1478+
/// **'If enabled, users must update to the latest app version to continue using the app.'**
1479+
String get isLatestVersionOnlyDescription;
1480+
1481+
/// Label for iOS Update URL
1482+
///
1483+
/// In en, this message translates to:
1484+
/// **'iOS Update URL'**
1485+
String get iosUpdateUrlLabel;
1486+
1487+
/// Description for iOS Update URL
1488+
///
1489+
/// In en, this message translates to:
1490+
/// **'URL for iOS app updates.'**
1491+
String get iosUpdateUrlDescription;
1492+
1493+
/// Label for Android Update URL
1494+
///
1495+
/// In en, this message translates to:
1496+
/// **'Android Update URL'**
1497+
String get androidUpdateUrlLabel;
1498+
1499+
/// Description for Android Update URL
1500+
///
1501+
/// In en, this message translates to:
1502+
/// **'URL for Android app updates.'**
1503+
String get androidUpdateUrlDescription;
14561504
}
14571505

14581506
class _AppLocalizationsDelegate

lib/l10n/app_localizations_ar.dart

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import 'app_localizations.dart';
88
class AppLocalizationsAr extends AppLocalizations {
99
AppLocalizationsAr([String locale = 'ar']) : super(locale);
1010

11-
@override
12-
String get helloWorld => 'مرحبا بالعالم!';
13-
1411
@override
1512
String get authenticationPageHeadline => 'الوصول إلى لوحة التحكم';
1613

@@ -745,9 +742,6 @@ class AppLocalizationsAr extends AppLocalizations {
745742
@override
746743
String get appStatusActive => 'نشط';
747744

748-
@override
749-
String get appStatusMaintenance => 'صيانة';
750-
751745
@override
752746
String get appStatusDisabled => 'معطل';
753747

@@ -760,4 +754,36 @@ class AppLocalizationsAr extends AppLocalizations {
760754
String demoCodeHint(String code) {
761755
return 'للعرض التجريبي، استخدم الرمز: $code';
762756
}
757+
758+
@override
759+
String get appStatusMaintenance => 'صيانة';
760+
761+
@override
762+
String get appStatusOperational => 'تشغيلي';
763+
764+
@override
765+
String get isUnderMaintenanceLabel => 'تحت الصيانة';
766+
767+
@override
768+
String get isUnderMaintenanceDescription =>
769+
'تبديل لوضع التطبيق في وضع الصيانة، مما يمنع وصول المستخدمين.';
770+
771+
@override
772+
String get isLatestVersionOnlyLabel => 'فرض أحدث إصدار فقط';
773+
774+
@override
775+
String get isLatestVersionOnlyDescription =>
776+
'إذا تم التمكين، يجب على المستخدمين التحديث إلى أحدث إصدار من التطبيق لمواصلة استخدامه.';
777+
778+
@override
779+
String get iosUpdateUrlLabel => 'رابط تحديث iOS';
780+
781+
@override
782+
String get iosUpdateUrlDescription => 'رابط تحديثات تطبيق iOS.';
783+
784+
@override
785+
String get androidUpdateUrlLabel => 'رابط تحديث Android';
786+
787+
@override
788+
String get androidUpdateUrlDescription => 'رابط تحديثات تطبيق Android.';
763789
}

lib/l10n/app_localizations_en.dart

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import 'app_localizations.dart';
88
class AppLocalizationsEn extends AppLocalizations {
99
AppLocalizationsEn([String locale = 'en']) : super(locale);
1010

11-
@override
12-
String get helloWorld => 'Hello World!';
13-
1411
@override
1512
String get authenticationPageHeadline => 'Dashboard Access';
1613

@@ -743,9 +740,6 @@ class AppLocalizationsEn extends AppLocalizations {
743740
@override
744741
String get appStatusActive => 'Active';
745742

746-
@override
747-
String get appStatusMaintenance => 'Maintenance';
748-
749743
@override
750744
String get appStatusDisabled => 'Disabled';
751745

@@ -758,4 +752,36 @@ class AppLocalizationsEn extends AppLocalizations {
758752
String demoCodeHint(String code) {
759753
return 'For demo, use code: $code';
760754
}
755+
756+
@override
757+
String get appStatusMaintenance => 'Maintenance';
758+
759+
@override
760+
String get appStatusOperational => 'Operational';
761+
762+
@override
763+
String get isUnderMaintenanceLabel => 'Under Maintenance';
764+
765+
@override
766+
String get isUnderMaintenanceDescription =>
767+
'Toggle to put the app in maintenance mode, preventing user access.';
768+
769+
@override
770+
String get isLatestVersionOnlyLabel => 'Force Latest Version Only';
771+
772+
@override
773+
String get isLatestVersionOnlyDescription =>
774+
'If enabled, users must update to the latest app version to continue using the app.';
775+
776+
@override
777+
String get iosUpdateUrlLabel => 'iOS Update URL';
778+
779+
@override
780+
String get iosUpdateUrlDescription => 'URL for iOS app updates.';
781+
782+
@override
783+
String get androidUpdateUrlLabel => 'Android Update URL';
784+
785+
@override
786+
String get androidUpdateUrlDescription => 'URL for Android app updates.';
761787
}

lib/l10n/arb/app_ar.arb

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"helloWorld": "مرحبا بالعالم!",
3-
"@helloWorld": {
4-
"description": "التحية التقليدية للمبرمج حديث الولادة"
5-
},
62
"authenticationPageHeadline": "الوصول إلى لوحة التحكم",
73
"@authenticationPageHeadline": {
84
"description": "عنوان صفحة المصادقة الرئيسية"
@@ -902,10 +898,6 @@
902898
"@appStatusActive": {
903899
"description": "نص حالة التطبيق 'نشط'"
904900
},
905-
"appStatusMaintenance": "صيانة",
906-
"@appStatusMaintenance": {
907-
"description": "نص حالة التطبيق 'صيانة'"
908-
},
909901
"appStatusDisabled": "معطل",
910902
"@appStatusDisabled": {
911903
"description": "نص حالة التطبيق 'معطل'"
@@ -929,5 +921,45 @@
929921
"example": "123456"
930922
}
931923
}
924+
},
925+
"appStatusMaintenance": "صيانة",
926+
"@appStatusMaintenance": {
927+
"description": "نص حالة التطبيق 'صيانة'"
928+
},
929+
"appStatusOperational": "تشغيلي",
930+
"@appStatusOperational": {
931+
"description": "نص حالة التطبيق 'تشغيلي'"
932+
},
933+
"isUnderMaintenanceLabel": "تحت الصيانة",
934+
"@isUnderMaintenanceLabel": {
935+
"description": "تسمية مفتاح 'تحت الصيانة'"
936+
},
937+
"isUnderMaintenanceDescription": "تبديل لوضع التطبيق في وضع الصيانة، مما يمنع وصول المستخدمين.",
938+
"@isUnderMaintenanceDescription": {
939+
"description": "وصف مفتاح 'تحت الصيانة'"
940+
},
941+
"isLatestVersionOnlyLabel": "فرض أحدث إصدار فقط",
942+
"@isLatestVersionOnlyLabel": {
943+
"description": "تسمية مفتاح 'فرض أحدث إصدار فقط'"
944+
},
945+
"isLatestVersionOnlyDescription": "إذا تم التمكين، يجب على المستخدمين التحديث إلى أحدث إصدار من التطبيق لمواصلة استخدامه.",
946+
"@isLatestVersionOnlyDescription": {
947+
"description": "وصف مفتاح 'فرض أحدث إصدار فقط'"
948+
},
949+
"iosUpdateUrlLabel": "رابط تحديث iOS",
950+
"@iosUpdateUrlLabel": {
951+
"description": "تسمية رابط تحديث iOS"
952+
},
953+
"iosUpdateUrlDescription": "رابط تحديثات تطبيق iOS.",
954+
"@iosUpdateUrlDescription": {
955+
"description": "وصف رابط تحديث iOS"
956+
},
957+
"androidUpdateUrlLabel": "رابط تحديث Android",
958+
"@androidUpdateUrlLabel": {
959+
"description": "تسمية رابط تحديث Android"
960+
},
961+
"androidUpdateUrlDescription": "رابط تحديثات تطبيق Android.",
962+
"@androidUpdateUrlDescription": {
963+
"description": "وصف رابط تحديث Android"
932964
}
933965
}

lib/l10n/arb/app_en.arb

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"helloWorld": "Hello World!",
3-
"@helloWorld": {
4-
"description": "The conventional newborn programmer greeting"
5-
},
62
"authenticationPageHeadline": "Dashboard Access",
73
"@authenticationPageHeadline": {
84
"description": "Headline for the main authentication page"
@@ -902,10 +898,7 @@
902898
"@appStatusActive": {
903899
"description": "Text for the 'Active' app status"
904900
},
905-
"appStatusMaintenance": "Maintenance",
906-
"@appStatusMaintenance": {
907-
"description": "Text for the 'Maintenance' app status"
908-
},
901+
909902
"appStatusDisabled": "Disabled",
910903
"@appStatusDisabled": {
911904
"description": "Text for the 'Disabled' app status"
@@ -929,6 +922,45 @@
929922
"example": "123456"
930923
}
931924
}
925+
},
926+
"appStatusMaintenance": "Maintenance",
927+
"@appStatusMaintenance": {
928+
"description": "Text for the 'Maintenance' app status"
929+
},
930+
"appStatusOperational": "Operational",
931+
"@appStatusOperational": {
932+
"description": "Text for the 'Operational' app status"
933+
},
934+
"isUnderMaintenanceLabel": "Under Maintenance",
935+
"@isUnderMaintenanceLabel": {
936+
"description": "Label for the 'is under maintenance' switch"
937+
},
938+
"isUnderMaintenanceDescription": "Toggle to put the app in maintenance mode, preventing user access.",
939+
"@isUnderMaintenanceDescription": {
940+
"description": "Description for the 'is under maintenance' switch"
941+
},
942+
"isLatestVersionOnlyLabel": "Force Latest Version Only",
943+
"@isLatestVersionOnlyLabel": {
944+
"description": "Label for the 'is latest version only' switch"
945+
},
946+
"isLatestVersionOnlyDescription": "If enabled, users must update to the latest app version to continue using the app.",
947+
"@isLatestVersionOnlyDescription": {
948+
"description": "Description for the 'is latest version only' switch"
949+
},
950+
"iosUpdateUrlLabel": "iOS Update URL",
951+
"@iosUpdateUrlLabel": {
952+
"description": "Label for iOS Update URL"
953+
},
954+
"iosUpdateUrlDescription": "URL for iOS app updates.",
955+
"@iosUpdateUrlDescription": {
956+
"description": "Description for iOS Update URL"
957+
},
958+
"androidUpdateUrlLabel": "Android Update URL",
959+
"@androidUpdateUrlLabel": {
960+
"description": "Label for Android Update URL"
961+
},
962+
"androidUpdateUrlDescription": "URL for Android app updates.",
963+
"@androidUpdateUrlDescription": {
964+
"description": "Description for Android Update URL"
932965
}
933-
934966
}

0 commit comments

Comments
 (0)