From 40c1502a9b8c073d187047f18860cd2ef151a6fb Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Sun, 20 Feb 2022 10:30:34 +0200 Subject: [PATCH] add translation --- lib/config/localized_values.dart | 2 ++ .../prescription/new_prescriptions_page.dart | 18 +++++++++--------- .../preacription_items_widget.dart | 2 +- lib/util/translations_delegate_base.dart | 6 ++++++ pubspec.lock | 9 ++++++++- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cac9883a..719f75f7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1136,4 +1136,6 @@ const Map> localizedValues = { "thousandIsTheMAXForTheStrength": {"en": "1000 Is The MAX For The Strength", "ar": "ألف هو القيمة الأعلى"}, "strengthCanNotBeZero": {"en": "Strength Can't Be Zero", "ar": "القوة لا يمكن أن تكون صفر "}, "old": {"en": "Old", "ar":"القديمه"}, + "orderTypeDescription": {"en": "Order Type Description", "ar":"وصف نوع الطلب"}, + "doseDetails": {"en": "Dose Details", "ar":"تفاصيل الجرعة"}, }; diff --git a/lib/screens/prescription/new_prescriptions_page.dart b/lib/screens/prescription/new_prescriptions_page.dart index e5403139..d6403602 100644 --- a/lib/screens/prescription/new_prescriptions_page.dart +++ b/lib/screens/prescription/new_prescriptions_page.dart @@ -110,42 +110,42 @@ class NewPrescriptionsPage extends StatelessWidget { height: 10, ), CustomRow( - label: "Doctor Name :", + label: TranslationBase.of(context).doctorName + ': ', //"Doctor Name :", value: model .prescriptionListNew[index].doctorName, ), CustomRow( - label: "Order Type Description :", + label: TranslationBase.of(context).orderTypeDescription + ': ',//"Order Type Description :", value: model.prescriptionListNew[index] .orderTypeDescription, ), CustomRow( - label: "status :", + label: TranslationBase.of(context).status + ': ', value: model.prescriptionListNew[index].status, ), CustomRow( - label: "indication :", + label: TranslationBase.of(context).indication + ': ', //"indication :", value: model .prescriptionListNew[index].indication, ), CustomRow( - label: "doseDetail :", + label: TranslationBase.of(context).doseDetails + ': ', //"doseDetail :", value: model .prescriptionListNew[index].doseDetail, ), CustomRow( - label: "quantity :", + label: TranslationBase.of(context).quantity + ': ',//"quantity :", value: model .prescriptionListNew[index].quantity .toString(), ),CustomRow( - label: "start Date :", + label: TranslationBase.of(context).startDate + ': ', //"start Date :", value: model .prescriptionListNew[index].startDate .toString(), ),CustomRow( - label: "stop Date :", + label: TranslationBase.of(context).stopDate + ': ',//"stop Date :", value: model .prescriptionListNew[index].stopDate .toString(), @@ -154,7 +154,7 @@ class NewPrescriptionsPage extends StatelessWidget { .prescriptionListNew[index].remarks != null&& model .prescriptionListNew[index].remarks!= "") CustomRow( - label: "Remark :", + label: TranslationBase.of(context).remarks + ': ',//"Remark :", value: model .prescriptionListNew[index].remarks .toString(), diff --git a/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart b/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart index 7883848c..70fa1765 100644 --- a/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart +++ b/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart @@ -12,7 +12,7 @@ class PrescriptionItemsWidget extends StatelessWidget { final String itemDescription; final String route; final String frequency; - final int dailyDoses; + final dynamic dailyDoses; final String imageSRCUrl; final String remarks; final int days; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 43ae8e56..7d9cdee0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1709,8 +1709,14 @@ class TranslationBase { String get thousandIsTheMAXForTheStrength => localizedValues['thousandIsTheMAXForTheStrength'][locale.languageCode]; String get strengthCanNotBeZero => localizedValues['strengthCanNotBeZero'][locale.languageCode]; + String get old => localizedValues['old'][locale.languageCode]; + String get orderTypeDescription => localizedValues['orderTypeDescription'][locale.languageCode]; + + String get doseDetails => localizedValues['doseDetails'][locale.languageCode]; + + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/pubspec.lock b/pubspec.lock index 424d9a09..59acfac9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -770,6 +770,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" meta: dependency: transitive description: @@ -1173,7 +1180,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.3" + version: "0.4.8" timing: dependency: transitive description: