From 1305e895a1feb81fcb16b9b8d69c65ca2abdaa5c Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Sun, 29 May 2022 15:50:22 +0300 Subject: [PATCH] fix arabic translation --- assets/langs/ar-SA.json | 10 ++++++ assets/langs/en-US.json | 13 +++++++- lib/generated/codegen_loader.g.dart | 24 ++++++++++++-- lib/generated/locale_keys.g.dart | 10 ++++++ lib/ui/profile/basic_details.dart | 13 ++++---- lib/ui/profile/contact_details.dart | 22 ++++--------- lib/ui/profile/family_members.dart | 28 +++++----------- lib/ui/profile/personal_info.dart | 32 +++++++------------ .../screens/profile/widgets/profile_info.dart | 1 + 9 files changed, 87 insertions(+), 66 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 98599fd..9efc35d 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -235,6 +235,15 @@ "year": "سنة", "month": "شهر", "day": "يوم", + "address" : "العنوان", + "phoneNumber": "رقم الجوال", + "businessGroup": "مجموعة العمل", + "Payroll": "الراتب", + "civilIdentityNumber": "رقم الهويه", + "dateOfBirth" : "تاريخ الميلاد", + "maritalStatus ": "الحالة الاجتماعية", + "fullName": "الأسم الكامل", + "remove": "حذف", "profile": { "reset_password": { "label": "Reset Password", @@ -245,6 +254,7 @@ "completeProfile": "الملف الشخصي الكامل", "personalInformation": "معلومات شخصية", "basicDetails": "تفاصيل أساسية", + "contactDetails": "بيانات التواصل", "familyDetails": "تفاصيل عائلية" }, "clicked": { diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 7601eee..dd2d2a4 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -236,6 +236,16 @@ "month": "Month", "day": "Day", "completingYear": "We appreciate you for completing the service of", + "address" : "Address", + "phoneNumber": "Phone Number", + "businessGroup": "Business", + "Payroll": "Payroll", + "civilIdentityNumber": "Civil Identity Number", + "dateOfBirth" : "Date of Birth", + "maritalStatus ": "Marital Status ", + "fullName": "Full Name", + "remove": "remove", + "update": "update", "profile": { "reset_password": { "label": "Reset Password", @@ -246,7 +256,8 @@ "completeProfile": "Complete Profile", "personalInformation": "Personal Information", "basicDetails": "Basic Details", - "familyDetails": "Family Details" + "contactDetails": "Contact Details", + "familyDetails": "Family Members" }, "clicked": { "zero": "You clicked {} times!", diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index d7f4465..5e6c80e 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -251,6 +251,15 @@ class CodegenLoader extends AssetLoader{ "year": "سنة", "month": "شهر", "day": "يوم", + "address": "العنوان", + "phoneNumber": "رقم الجوال", + "businessGroup": "مجموعة العمل", + "Payroll": "الراتب", + "civilIdentityNumber": "رقم الهويه", + "dateOfBirth": "تاريخ الميلاد", + "maritalStatus ": "الحالة الاجتماعية", + "fullName": "الأسم الكامل", + "remove": "حذف", "profile": { "reset_password": { "label": "Reset Password", @@ -261,6 +270,7 @@ class CodegenLoader extends AssetLoader{ "completeProfile": "الملف الشخصي الكامل", "personalInformation": "معلومات شخصية", "basicDetails": "تفاصيل أساسية", + "contactDetails": "بيانات التواصل", "familyDetails": "تفاصيل عائلية" }, "clicked": { @@ -330,7 +340,7 @@ static const Map en_US = { "setTheNewPassword": "Set the new password", "typeYourNewPasswordBelow": "Type your new password below", "confirmPassword": "Confirm Password", - "update": "Update", + "update": "update", "title": "Title", "home": "Home", "mySalary": "My Salary", @@ -526,6 +536,15 @@ static const Map en_US = { "month": "Month", "day": "Day", "completingYear": "We appreciate you for completing the service of", + "address": "Address", + "phoneNumber": "Phone Number", + "businessGroup": "Business", + "Payroll": "Payroll", + "civilIdentityNumber": "Civil Identity Number", + "dateOfBirth": "Date of Birth", + "maritalStatus ": "Marital Status ", + "fullName": "Full Name", + "remove": "remove", "profile": { "reset_password": { "label": "Reset Password", @@ -536,7 +555,8 @@ static const Map en_US = { "completeProfile": "Complete Profile", "personalInformation": "Personal Information", "basicDetails": "Basic Details", - "familyDetails": "Family Details" + "contactDetails": "Contact Details", + "familyDetails": "Family Members" }, "clicked": { "zero": "You clicked {} times!", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index b2b255d..230e45b 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -236,6 +236,15 @@ abstract class LocaleKeys { static const year = 'year'; static const month = 'month'; static const day = 'day'; + static const address = 'address'; + static const phoneNumber = 'phoneNumber'; + static const businessGroup = 'businessGroup'; + static const Payroll = 'Payroll'; + static const civilIdentityNumber = 'civilIdentityNumber'; + static const dateOfBirth = 'dateOfBirth'; + static const maritalStatus = 'maritalStatus '; + static const fullName = 'fullName'; + static const remove = 'remove'; 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'; @@ -244,6 +253,7 @@ abstract class LocaleKeys { static const profile_completeProfile = 'profile.completeProfile'; static const profile_personalInformation = 'profile.personalInformation'; static const profile_basicDetails = 'profile.basicDetails'; + static const profile_contactDetails = 'profile.contactDetails'; static const profile_familyDetails = 'profile.familyDetails'; static const profile = 'profile'; static const clicked = 'clicked'; diff --git a/lib/ui/profile/basic_details.dart b/lib/ui/profile/basic_details.dart index 0beec77..e229918 100644 --- a/lib/ui/profile/basic_details.dart +++ b/lib/ui/profile/basic_details.dart @@ -6,6 +6,7 @@ import 'package:mohem_flutter_app/classes/utils.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'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/ui/profile/profile.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; @@ -72,7 +73,7 @@ class _BasicDetailsState extends State { return Scaffold( appBar: AppBarWidget( context, - title: "Basic Details", + title: LocaleKeys.profile_basicDetails.tr(), ), // appBar: AppBar( // backgroundColor: MyColors.white, @@ -116,22 +117,22 @@ class _BasicDetailsState extends State { borderRadius: BorderRadius.circular(10.0), ), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Full Name".toText13(color: MyColors.lightGrayColor), + LocaleKeys.fullName.tr().toText13(color: MyColors.lightGrayColor), "${fullName}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20, ), - "Marital Status".toText13(color: MyColors.lightGrayColor), + LocaleKeys.maritalStatus.tr().toText13(color: MyColors.lightGrayColor), "${maritalStatus}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20, ), - "Date of Birth".toText13(color: MyColors.lightGrayColor), + LocaleKeys.dateOfBirth.tr().toText13(color: MyColors.lightGrayColor), "${birthDate}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20, ), - "Civil Identity Number".toText13(color: MyColors.lightGrayColor), + LocaleKeys.civilIdentityNumber.tr().toText13(color: MyColors.lightGrayColor), "${civilIdentityNumber}".toText16(isBold: true, color: MyColors.blackColor), ]), ), @@ -148,7 +149,7 @@ class _BasicDetailsState extends State { BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), ], ), - child: DefaultButton("Update", () async { + child: DefaultButton(LocaleKeys.update.tr(), () async { // context.setLocale(const Locale("en", "US")); // to change Loacle Profile(); }).insideContainer, diff --git a/lib/ui/profile/contact_details.dart b/lib/ui/profile/contact_details.dart index 3894c65..32f0ce8 100644 --- a/lib/ui/profile/contact_details.dart +++ b/lib/ui/profile/contact_details.dart @@ -10,10 +10,12 @@ import 'package:mohem_flutter_app/classes/utils.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'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/get_employee_address_model.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; import 'package:mohem_flutter_app/ui/profile/profile.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; class ContactDetails extends StatefulWidget { @@ -70,21 +72,9 @@ class _ContactDetailsState extends State { Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - backgroundColor: MyColors.white, - leading: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - IconButton( - icon: const Icon( - Icons.arrow_back_ios, - color: MyColors.backgroundBlackColor, - ), - onPressed: () => Navigator.pop(context), - ), - "Contact Details".toText24(isBold: true, color: MyColors.blackColor), - ], - ), + appBar: AppBarWidget( + context, + title: LocaleKeys.profile_contactDetails.tr(), ), backgroundColor: MyColors.backgroundColor, bottomSheet:footer(), @@ -179,7 +169,7 @@ class _ContactDetailsState extends State { BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), ], ), - child: DefaultButton("Update", () async { + child: DefaultButton(LocaleKeys.update.tr(), () async { // context.setLocale(const Locale("en", "US")); // to change Loacle Profile(); }).insideContainer, diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index d420abc..d62f101 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -12,9 +12,11 @@ import 'package:mohem_flutter_app/dialogs/otp_dialog.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'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; import 'package:mohem_flutter_app/ui/profile/profile.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; class FamilyMembers extends StatefulWidget { @@ -51,23 +53,9 @@ class _FamilyMembersState extends State { Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - backgroundColor: MyColors.white, - leading: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - IconButton( - icon: const Icon( - Icons.arrow_back_ios, - color: MyColors.backgroundBlackColor, - ), - onPressed: () => Navigator.pop(context), - ), - Center( - child: "Family Members".toText24(isBold: true, color: MyColors.blackColor), - ) - ], - ), + appBar: AppBarWidget( + context, + title: LocaleKeys.profile_familyDetails.tr(), ), backgroundColor: MyColors.backgroundColor, bottomSheet:footer(), @@ -136,7 +124,7 @@ class _FamilyMembersState extends State { ), ), TextSpan( - text: "Update", + text: LocaleKeys.update.tr(), style: TextStyle( color: MyColors.grey67Color, fontSize: 12, @@ -173,7 +161,7 @@ class _FamilyMembersState extends State { ), ), TextSpan( - text: "Remove", + text:LocaleKeys.remove.tr(), style: TextStyle( color: MyColors.DarkRedColor, fontSize: 12, @@ -226,7 +214,7 @@ class _FamilyMembersState extends State { BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), ], ), - child: DefaultButton("Update", () async { + child: DefaultButton(LocaleKeys.update.tr(), () async { // context.setLocale(const Locale("en", "US")); // to change Loacle Profile(); }).insideContainer, diff --git a/lib/ui/profile/personal_info.dart b/lib/ui/profile/personal_info.dart index e2abba0..b136141 100644 --- a/lib/ui/profile/personal_info.dart +++ b/lib/ui/profile/personal_info.dart @@ -8,9 +8,11 @@ import 'package:mohem_flutter_app/classes/utils.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'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/ui/profile/profile.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; class PesonalInfo extends StatefulWidget { @@ -46,22 +48,10 @@ class _PesonalInfoState extends State { Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - backgroundColor: MyColors.white, - leading: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - IconButton( - icon: const Icon( - Icons.arrow_back_ios, - color: MyColors.backgroundBlackColor, - ), - onPressed: () => Navigator.pop(context), - ), - "Personal Information".toText24(isBold: true, color: MyColors.blackColor), - ], + appBar: AppBarWidget( + context, + title: LocaleKeys.profile_personalInformation.tr(), ), - ), backgroundColor: MyColors.backgroundColor, bottomSheet:footer(), body: Column( @@ -86,23 +76,23 @@ class _PesonalInfoState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Category".toText13(color: MyColors.lightGrayColor), + LocaleKeys.category.tr().toText13(color: MyColors.lightGrayColor), "${memberInformationList!.eMPLOYMENTCATEGORYMEANING}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20,), - "Address".toText13(color: MyColors.lightGrayColor), + LocaleKeys.address.tr().toText13(color: MyColors.lightGrayColor), "${memberInformationList!.lOCATIONNAME}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20,), - "Phone Number".toText13(color: MyColors.lightGrayColor), + LocaleKeys.phoneNumber.tr().toText13(color: MyColors.lightGrayColor), "${memberInformationList!.eMPLOYEEMOBILENUMBER}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20,), - "Business Group".toText13(color: MyColors.lightGrayColor), + LocaleKeys.businessGroup.tr().toText13(color: MyColors.lightGrayColor), "${memberInformationList!.bUSINESSGROUPNAME}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20,), - "Payroll".toText13(color: MyColors.lightGrayColor), + LocaleKeys.Payroll.tr().toText13(color: MyColors.lightGrayColor), "${memberInformationList!.pAYROLLNAME}".toText16(isBold: true, color: MyColors.blackColor), ] ), @@ -122,7 +112,7 @@ class _PesonalInfoState extends State { BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3), ], ), - child: DefaultButton("Update", () async { + child: DefaultButton(LocaleKeys.update.tr(), () async { // context.setLocale(const Locale("en", "US")); // to change Loacle Profile(); }).insideContainer, diff --git a/lib/ui/screens/profile/widgets/profile_info.dart b/lib/ui/screens/profile/widgets/profile_info.dart index ecd5ef3..1141fcf 100644 --- a/lib/ui/screens/profile/widgets/profile_info.dart +++ b/lib/ui/screens/profile/widgets/profile_info.dart @@ -14,6 +14,7 @@ class ProfileInFo extends StatelessWidget { List menu = [ ProfileMenu(name: LocaleKeys.profile_personalInformation.tr(), icon: Icons.info, route: AppRoutes.personalInfo), ProfileMenu(name: LocaleKeys.profile_basicDetails.tr(), icon: Icons.contacts, route: AppRoutes.basicDetails), + ProfileMenu(name: LocaleKeys.profile_contactDetails.tr(), icon: Icons.location_on, route: AppRoutes.contactDetails), ProfileMenu(name: LocaleKeys.profile_familyDetails.tr(), icon: Icons.reduce_capacity_sharp, route: AppRoutes.familyMembers), ]; @override