From 14047154255ed3d128c05134f179099f2a967d00 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 23 Aug 2022 16:11:52 +0300 Subject: [PATCH] Vacation rule translation added. --- assets/langs/ar-SA.json | 31 +++++++++-- assets/langs/en-US.json | 31 +++++++++-- lib/generated/codegen_loader.g.dart | 54 +++++++++++++++++++ lib/generated/locale_keys.g.dart | 23 ++++++++ .../attendance/add_vacation_rule_screen.dart | 53 +++++++++--------- 5 files changed, 157 insertions(+), 35 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 6821686..0c6ce54 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -311,11 +311,34 @@ "requestType": "نوع الطلب", "employeeDigitalID": "هويةالموظف الرقمية", "businessCard": "بطاقة العمل", - "checkOut":"وقت الخروج", - "regular":"منتظم", - "mark" : "علامة", - "selectMethodOfAttendance":"اختر طريقة تسجيل الحضور", + "checkOut": "وقت الخروج", + "regular": "منتظم", + "mark": "علامة", + "selectMethodOfAttendance": "اختر طريقة تسجيل الحضور", "comeNearHMGWifi": "HMG wifi من فضلك اقترب من", + "deliverNotificationToMeRegardless": "تسليم الإخطارات إلي بغض النظر عن أي قواعد عامة", + "close": "أغلق", + "respond": "يرد", + "vacationRuleAdded": "تمت إضافة قاعدة الإجازة", + "selectTypeT": "اختر صنف", + "notification": "تنبيه", + "selectNotification": "حدد إعلام", + "ifAllSelectedYouWillSkip": "* إذا تم تحديد الكل ، فستنتقل إلى الخطوة 3", + "applyForVacationRule": "التقدم بطلب للحصول على قانون الإجازة", + "step1": "الخطوة 1", + "step2": "الخطوة 2", + "step3": "الخطوه 3", + "message": "رسالة", + "writeAMessage": "اكتب رسالة", + "notificationReassign": "إعادة تعيين الإخطار", + "selectEmployee": "حدد الموظف", + "searchEmployeeForReplacement": "ابحث عن موظف بديل", + "searchForEmployee": "ابحث عن موظف", + "pleaseSpecifyEndTime": "الرجاء تحديد وقت الانتهاء", + "pleaseSelectNotificationReassign": "يرجى تحديد إعادة تعيين الإخطار", + "pleaseSelectEmployeeForReplacement": "الرجاء تحديد موظف للاستبدال", + "pleaseSelectAction": "الرجاء تحديد الإجراء", + "pleaseSelectDate": "الرجاء تحديد التاريخ", "profile": { "reset_password": { "label": "Reset Password", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 03ac050..812fa49 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -311,11 +311,34 @@ "wantToReject": "Are you sure want to reject?", "employeeDigitalID": "Employee Digital ID", "businessCard": "Business Card", - "checkOut":"Check Out", - "regular":"Regular", - "mark" : "Mark", - "selectMethodOfAttendance":"Select the method to mark the attendance", + "checkOut": "Check Out", + "regular": "Regular", + "mark": "Mark", + "selectMethodOfAttendance": "Select the method to mark the attendance", "comeNearHMGWifi": "Please come near to HMG wifi", + "deliverNotificationToMeRegardless": "Deliver notifications to me regardless of any general rules", + "close": "Close", + "respond": "Respond", + "vacationRuleAdded": "Vacation rule added", + "selectTypeT": "Select Type", + "notification": "Notification", + "selectNotification": "Select Notification", + "ifAllSelectedYouWillSkip": "*If All is selected, you will skip to step 3", + "applyForVacationRule": "Apply for Vacation Rule", + "step1": "Step 1", + "step2": "Step 2", + "step3": "Step 3", + "message": "Message", + "writeAMessage": "Write a message", + "notificationReassign": "Notification Reassign", + "selectEmployee": "Select Employee", + "searchEmployeeForReplacement": "Search employee for replacement", + "searchForEmployee": "Search for Employee", + "pleaseSpecifyEndTime": "Please specify End Time", + "pleaseSelectNotificationReassign": "Please select notification reassign", + "pleaseSelectEmployeeForReplacement": "Please select employee for replacement", + "pleaseSelectAction": "Please select action", + "pleaseSelectDate": "Please select date", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 2fa8d35..57323da 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -47,6 +47,9 @@ class CodegenLoader extends AssetLoader{ "viewAllServices": "عرض جميع الخدمات", "monthlyAttendance": "الحضور الشهري", "vacationRule": "حكم اجازة", + "vacationType": "نوع الاجازة", + "startDateT": "تاريخ البدء", + "endDateT": "تاريخ الانتهاء", "workFromHome": "العمل من المنزل", "ticketRequest": "طلب تذكرة", "viewAllOffers": "مشاهدة جميع العروض", @@ -248,6 +251,7 @@ class CodegenLoader extends AssetLoader{ "myAttendance": "حضوري", "workOnBreak": "التعويض عن العمل اثناءالاستراحه", "next": "التالي", + "apply": "يتقدم", "mobile": "التليفون المحمول", "completingYear": "نحن نقدر لك لاستكمال خدمة", "year": "سنة", @@ -328,6 +332,29 @@ class CodegenLoader extends AssetLoader{ "mark": "علامة", "selectMethodOfAttendance": "اختر طريقة تسجيل الحضور", "comeNearHMGWifi": "HMG wifi من فضلك اقترب من", + "deliverNotificationToMeRegardless": "تسليم الإخطارات إلي بغض النظر عن أي قواعد عامة", + "close": "أغلق", + "respond": "يرد", + "vacationRuleAdded": "تمت إضافة قاعدة الإجازة", + "selectTypeT": "اختر صنف", + "notification": "تنبيه", + "selectNotification": "حدد إعلام", + "ifAllSelectedYouWillSkip": "* إذا تم تحديد الكل ، فستنتقل إلى الخطوة 3", + "applyForVacationRule": "التقدم بطلب للحصول على قانون الإجازة", + "step1": "الخطوة 1", + "step2": "الخطوة 2", + "step3": "الخطوه 3", + "message": "رسالة", + "writeAMessage": "اكتب رسالة", + "notificationReassign": "إعادة تعيين الإخطار", + "selectEmployee": "حدد الموظف", + "searchEmployeeForReplacement": "ابحث عن موظف بديل", + "searchForEmployee": "ابحث عن موظف", + "pleaseSpecifyEndTime": "الرجاء تحديد وقت الانتهاء", + "pleaseSelectNotificationReassign": "يرجى تحديد إعادة تعيين الإخطار", + "pleaseSelectEmployeeForReplacement": "الرجاء تحديد موظف للاستبدال", + "pleaseSelectAction": "الرجاء تحديد الإجراء", + "pleaseSelectDate": "الرجاء تحديد التاريخ", "profile": { "reset_password": { "label": "Reset Password", @@ -395,6 +422,9 @@ static const Map en_US = { "viewAllServices": "View All Services", "monthlyAttendance": "Monthly Attendance", "vacationRule": "Vacation Rule", + "vacationType": "Vacation Type", + "startDateT": "Start Date", + "endDateT": "End Date", "workFromHome": "Work From Home", "ticketRequest": "Ticket Request", "viewAllOffers": "View All Offers", @@ -596,6 +626,7 @@ static const Map en_US = { "myAttendance": "My Attendance", "workOnBreak": "Work On Break", "next": "Next", + "apply": "Apply", "mobile": "Mobile", "year": "Year", "month": "Month", @@ -676,6 +707,29 @@ static const Map en_US = { "mark": "Mark", "selectMethodOfAttendance": "Select the method to mark the attendance", "comeNearHMGWifi": "Please come near to HMG wifi", + "deliverNotificationToMeRegardless": "Deliver notifications to me regardless of any general rules", + "close": "Close", + "respond": "Respond", + "vacationRuleAdded": "Vacation rule added", + "selectTypeT": "Select Type", + "notification": "Notification", + "selectNotification": "Select Notification", + "ifAllSelectedYouWillSkip": "*If All is selected, you will skip to step 3", + "applyForVacationRule": "Apply for Vacation Rule", + "step1": "Step 1", + "step2": "Step 2", + "step3": "Step 3", + "message": "Message", + "writeAMessage": "Write a message", + "notificationReassign": "Notification Reassign", + "selectEmployee": "Select Employee", + "searchEmployeeForReplacement": "Search employee for replacement", + "searchForEmployee": "Search for Employee", + "pleaseSpecifyEndTime": "Please specify End Time", + "pleaseSelectNotificationReassign": "Please select notification reassign", + "pleaseSelectEmployeeForReplacement": "Please select employee for replacement", + "pleaseSelectAction": "Please select action", + "pleaseSelectDate": "Please select date", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index c37b5c8..d736c34 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -317,6 +317,29 @@ abstract class LocaleKeys { static const mark = 'mark'; static const selectMethodOfAttendance = 'selectMethodOfAttendance'; static const comeNearHMGWifi = 'comeNearHMGWifi'; + static const deliverNotificationToMeRegardless = 'deliverNotificationToMeRegardless'; + static const close = 'close'; + static const respond = 'respond'; + static const vacationRuleAdded = 'vacationRuleAdded'; + static const selectTypeT = 'selectTypeT'; + static const notification = 'notification'; + static const selectNotification = 'selectNotification'; + static const ifAllSelectedYouWillSkip = 'ifAllSelectedYouWillSkip'; + static const applyForVacationRule = 'applyForVacationRule'; + static const step1 = 'step1'; + static const step2 = 'step2'; + static const step3 = 'step3'; + static const message = 'message'; + static const writeAMessage = 'writeAMessage'; + static const notificationReassign = 'notificationReassign'; + static const selectEmployee = 'selectEmployee'; + static const searchEmployeeForReplacement = 'searchEmployeeForReplacement'; + static const searchForEmployee = 'searchForEmployee'; + static const pleaseSpecifyEndTime = 'pleaseSpecifyEndTime'; + static const pleaseSelectNotificationReassign = 'pleaseSelectNotificationReassign'; + static const pleaseSelectEmployeeForReplacement = 'pleaseSelectEmployeeForReplacement'; + static const pleaseSelectAction = 'pleaseSelectAction'; + static const pleaseSelectDate = 'pleaseSelectDate'; static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_password = 'profile.reset_password.password'; diff --git a/lib/ui/attendance/add_vacation_rule_screen.dart b/lib/ui/attendance/add_vacation_rule_screen.dart index 51bf0d7..b7f7f5d 100644 --- a/lib/ui/attendance/add_vacation_rule_screen.dart +++ b/lib/ui/attendance/add_vacation_rule_screen.dart @@ -7,6 +7,7 @@ import 'package:mohem_flutter_app/api/vacation_rule_api_client.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/date_uitl.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; @@ -117,7 +118,7 @@ class _AddVacationRuleScreenState extends State { if (selectedItemType!.iTEMTYPE != "*") { notificationReassignModeList!.add( GetNotificationReassignModeList( - rADIOBUTTONLABEL: "Deliver notifications to me regardless of any general rules", + rADIOBUTTONLABEL: LocaleKeys.deliverNotificationToMeRegardless.tr(), rADIOBUTTONACTION: "DELIVER", // ionic: DELIVER rADIOBUTTONSEQ: 1, ), @@ -126,7 +127,7 @@ class _AddVacationRuleScreenState extends State { if (selectedItemTypeNotification!.fYIFLAG == "Y") { notificationReassignModeList!.add( GetNotificationReassignModeList( - rADIOBUTTONLABEL: "Close", + rADIOBUTTONLABEL: LocaleKeys.close.tr(), rADIOBUTTONACTION: "CLOSE", // ionic: CLOSE rADIOBUTTONSEQ: 1, ), @@ -135,7 +136,7 @@ class _AddVacationRuleScreenState extends State { if (respondAttributesList!.isNotEmpty && !(selectedItemTypeNotification!.fYIFLAG == "Y")) { notificationReassignModeList!.add( GetNotificationReassignModeList( - rADIOBUTTONLABEL: "Respond", + rADIOBUTTONLABEL: LocaleKeys.respond.tr(), rADIOBUTTONACTION: "RESPOND", // ionic: RESPOND rADIOBUTTONSEQ: 1, ), @@ -215,8 +216,8 @@ class _AddVacationRuleScreenState extends State { CreateVacationRuleList? createVacationRuleList = await VacationRuleApiClient().createVacationRule(DateUtil.convertDateToStringLocation(startTime), DateUtil.convertDateToStringLocation(endTime!), selectedItemType!.iTEMTYPE!, selectedItemTypeNotification!.nOTIFICATIONNAME!, message, getPAction(), selectedReplacementEmployee!.userName!, respondAttributeList); Utils.hideLoading(context); - Utils.showToast("Vacation rule added."); - Navigator.popUntil(context, ModalRoute.withName('AppRoutes.dashboard')); + Utils.showToast("Vacation rule added"); + Navigator.popUntil(context, ModalRoute.withName(AppRoutes.dashboard)); } catch (ex) { Utils.hideLoading(context); Utils.handleException(ex, context, null); @@ -287,7 +288,7 @@ class _AddVacationRuleScreenState extends State { PopupMenuButton( child: DynamicTextFieldWidget( LocaleKeys.itemType.tr(), - selectedItemType == null ? "Select Type" : selectedItemType!.iTEMTYPEDISPLAYNAME!, + selectedItemType == null ? LocaleKeys.selectType.tr() : selectedItemType!.iTEMTYPEDISPLAYNAME!, isEnable: false, isPopup: true, ).paddingOnly(bottom: 12), @@ -310,13 +311,13 @@ class _AddVacationRuleScreenState extends State { notificationReassignMode = null; getItemTypeNotificationsList(); } - }).objectContainerView(title: "Apply for Vacation Rule\nStep 1", note: "*If All is selected, you will skip to step 3"), + }).objectContainerView(title: "${LocaleKeys.applyForVacationRule.tr()}\n${LocaleKeys.step1.tr()}", note: LocaleKeys.ifAllSelectedYouWillSkip.tr()), if ((itemTypeNotificationsList ?? []).isNotEmpty) ...[ 12.height, PopupMenuButton( child: DynamicTextFieldWidget( "Notification", - selectedItemTypeNotification == null ? "Select Notification" : selectedItemTypeNotification!.nOTIFICATIONDISPLAYNAME!, + selectedItemTypeNotification == null ? LocaleKeys.selectNotification.tr() : selectedItemTypeNotification!.nOTIFICATIONDISPLAYNAME!, isEnable: false, isPopup: true, ).paddingOnly(bottom: 12), @@ -331,17 +332,17 @@ class _AddVacationRuleScreenState extends State { notificationReassignMode = null; setState(() {}); callCombineApis(); - }).objectContainerView(title: "Step 2") + }).objectContainerView(title: LocaleKeys.step2.tr()) ], if (selectedItemType != null && selectedItemTypeNotification != null && currentStage == 3) ...[ 12.height, Column( children: [ ItemDetailView(LocaleKeys.itemType.tr(), selectedItemType!.iTEMTYPEDISPLAYNAME!), - ItemDetailView("Notification", selectedItemTypeNotification!.nOTIFICATIONDISPLAYNAME!), + ItemDetailView(LocaleKeys.notification.tr(), selectedItemTypeNotification!.nOTIFICATIONDISPLAYNAME!), 12.height, DynamicTextFieldWidget( - "Start Date", + LocaleKeys.startDateT.tr(), formattedDate(startTime), suffixIconData: Icons.calendar_today, isEnable: false, @@ -355,7 +356,7 @@ class _AddVacationRuleScreenState extends State { ), 12.height, DynamicTextFieldWidget( - "End Date", + LocaleKeys.endDateT.tr(), formattedDate(endTime), suffixIconData: Icons.calendar_today, isEnable: false, @@ -369,8 +370,8 @@ class _AddVacationRuleScreenState extends State { ), 12.height, DynamicTextFieldWidget( - "Message", - "Write a message", + LocaleKeys.message.tr(), + LocaleKeys.writeAMessage.tr(), lines: 2, onChange: (message) { this.message = message; @@ -415,7 +416,7 @@ class _AddVacationRuleScreenState extends State { }, separatorBuilder: (cxt, index) => 12.height, itemCount: notificationReassignModeList!.length) - .objectContainerBorderView(title: "Notification Reassign"), + .objectContainerBorderView(title: LocaleKeys.notificationReassign.tr()), 12.height, if (respondAttributesList?.isNotEmpty ?? false) ...getDynamicWidgetList(), if (roleList!.isNotEmpty && notificationReassignMode?.rADIOBUTTONACTION == 'RESPOND' || @@ -423,15 +424,15 @@ class _AddVacationRuleScreenState extends State { (notificationReassignMode?.rADIOBUTTONACTION == 'DELEGATE') || (notificationReassignMode?.rADIOBUTTONACTION == 'TRANSFER')) DynamicTextFieldWidget( - "Select Employee", - selectedReplacementEmployee == null ? "Search employee for replacement" : selectedReplacementEmployee!.employeeDisplayName ?? "", + LocaleKeys.selectEmployee.tr(), + selectedReplacementEmployee == null ? LocaleKeys.searchEmployeeForReplacement.tr() : selectedReplacementEmployee!.employeeDisplayName ?? "", isEnable: false, onTap: () { showMyBottomSheet( context, child: SearchEmployeeBottomSheet( - title: "Search for Employee", - apiMode: "DELEGATE", + title: LocaleKeys.searchForEmployee.tr(), + apiMode: LocaleKeys.delegate.tr(), onSelectEmployee: (_selectedEmployee) { // Navigator.pop(context); selectedReplacementEmployee = _selectedEmployee; @@ -442,7 +443,7 @@ class _AddVacationRuleScreenState extends State { }, ).paddingOnly(bottom: 12), ], - ).objectContainerView(title: "Step 3") + ).objectContainerView(title: LocaleKeys.step3.tr()) ] ], ).expanded, @@ -452,18 +453,16 @@ class _AddVacationRuleScreenState extends State { ? null : () { if (endTime == null) { - Utils.showToast("Please specify End Time"); + Utils.showToast(LocaleKeys.pleaseSpecifyEndTime.tr()); return; } else if (notificationReassignMode == null) { - Utils.showToast("Please select notification reassign"); + Utils.showToast(LocaleKeys.pleaseSelectNotificationReassign.tr()); return; } else if (selectedReplacementEmployee == null) { - Utils.showToast("Please select employee for replacement"); + Utils.showToast(LocaleKeys.pleaseSelectEmployeeForReplacement.tr()); return; } - List> list = []; - if (respondAttributesList?.isNotEmpty ?? false) { for (int i = 0; i < respondAttributesList!.length; i++) { if (respondAttributesList![i].aTTRIBUTETYPE == "VARCHAR2") { @@ -471,14 +470,14 @@ class _AddVacationRuleScreenState extends State { } if (respondAttributesList![i].aTTRIBUTETYPE == "LOOKUP") { if (wfLook == null) { - Utils.showToast('Please select action'); + Utils.showToast(LocaleKeys.pleaseSelectAction.tr()); break; } list.add({"ATTRIBUTE_NAME": respondAttributesList![i].aTTRIBUTENAME, "ATTRIBUTE_TEXT_VALUE": wfLook!.lOOKUPCODE}); } if (respondAttributesList![i].aTTRIBUTETYPE == "DATE") { if (dateInput == null) { - Utils.showToast('Please select date'); + Utils.showToast(LocaleKeys.pleaseSelectDate.tr()); break; } list.add({"ATTRIBUTE_NAME": respondAttributesList![i].aTTRIBUTENAME, "ATTRIBUTE_TEXT_VALUE": DateUtil.convertDateToStringLocation(dateInput!)});