diff --git a/assets/translations/am.json b/assets/translations/am.json index 3f5a456..854a276 100644 --- a/assets/translations/am.json +++ b/assets/translations/am.json @@ -119,7 +119,53 @@ "telegram_support": "የቴሌግራም ድጋፍ", "chat_via_telegram": "በቴሌግራም በፍጥነት ይወያዩ", "call_our_support": "ከ3 ጠዋት እስከ 12 ማታ ድረስ የድጋፍ ቡድናችንን ይደውሉ", - "tap_to_call": "ለመደወል ይንኩ" + "tap_to_call": "ለመደወል ይንኩ", + "join_telegram": "በቴሌግራም የይማሩ አካዳሚን ይቀላቀሉ", + "connect_with_support_team": "ለፈጣን እርዳታ እና የማህበረሰብ ዝማኔዎች፣ በቴሌግራም ከድጋፍ ቡድናችን ጋር ወዲያውኑ ይገናኙ።", + "open_in_telegram": "በቴሌግራም ይክፈቱ", + "search_for": "ፈልጉት", + "current_level": "የአሁኑ ደረጃ", + "keep_up_the_great_work": "በጣም ጥሩ እየሰራህ ነው! ቀጥልበት፣ አስደናቂ ነህ።", + "no_practice_available": "ምንም ልምምድ አልተገኘም!", + "begin_module_practice": "የሞጁሉን ልምምድ ጀምር", + "lets_practice_lesson": "እንለማመድ", + "lets_quickly_review": "በዚህ ሞጁል ውስጥ የተማርከውን በፍጥነት እንከልስ!", + "lets_practice_module": "አሁን የተማርከውን እንለማመድ!", + "ask_you_few_actions": "ጥቂት ጥያቄዎችን እጠይቅሃለሁ፣ አንተም በተፈጥሮ መልስ ልትሰጥ ትችላለህ።", + "begin_level_practice": "የደረጃ ልምምድን ጀምር", + "lets_practice_course": "የኮርሱን ልምምድ እንለማመድ", + "lets_quick_practice": "በዚህ ደረጃ የተማርከውን በፍጥነት እንከልስ!", + "speaking": "እየተናገረ ነው", + "you_have_finished_practice": "ልምምድህን አጠናቀቅህ", + "view_results": "ውጤቶቼን እይ", + "sample_answer": "ናሙና መልስ", + "your_answer": "መልስህ", + "sound_confident": "በዚህ ጊዜ የበለጠ እምነት ያለህ ይመስላል — በጣም ጥሩ መሻሻል ነው!", + "you_have_completed": "አያይ! አጠናቀቅህ", + "yes": "አዎ", + "no": "አይ", + "want_to_quit": "ለመውጣት እርግጠኛ ነህ?", + "required_field": "ይህ መስክ ያስፈልጋል", + "enter_full_name": "ሙሉ ስምህን አስገባ", + "invalid_email": "የማይሰራ የኢሜይል ቅርጸት", + "phone_must_start_with": "የስልክ ቁጥር በ251 መጀመር አለበት", + "phone_must_be": "የስልክ ቁጥር 12 አሃዞች መሆን አለበት", + "what_should_we_call_you": "ምን ብለን እንጠራህ?", + "use_for_personalization": "በመማር ጉዞህ ውስጥ ለግል ለማድረግ ስምህን እንጠቀማለን።" + + + + + + + + + + + + + + } diff --git a/assets/translations/en.json b/assets/translations/en.json index 29def5e..a95ef6b 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -73,7 +73,7 @@ "reply": "Reply", "cancel": "Cancel", "you_are_speaking": "You're speaking", - "practice_completed": "Practice completed", + "practice_completed": "Practice completed!", "great_improvement": "You sound more confident this time, great improvement", "practice_again": "Practice again", "conversation_review": "Conversation review", @@ -119,6 +119,38 @@ "telegram_support": "Telegram support", "chat_via_telegram" :"Chat instantly via Telegram", "call_our_support": "Call our support team between 9 AM - 6 PM", - "tap_to_call": "Tap to call" + "tap_to_call": "Tap to call", + "join_telegram": "Join Yimaru Academy on Telegram", + "connect_with_support_team": "Connect with our support team instantly on Telegram for quick assistance and community updates", + "open_in_telegram": "Open in Telegram", + "search_for": "Search for", + "current_level": "Current Level", + "keep_up_the_great_work": "Keep up the great work! You\\'re doing amazing.", + "no_practice_available": "No practice available!", + "begin_module_practice": "Begin Module Practice", + "lets_practice_lesson": "Let’s Practice", + "lets_quickly_review": "Let’s quickly review what you’ve learned in this module!", + "lets_practice_module": "Let's practice what you just learnt!", + "ask_you_few_actions": "I’ll ask you a few questions, and you can respond naturally.", + "begin_level_practice": "Begin Level Practice", + "lets_practice_course": "Let’s Practice Course", + "lets_quick_review": "Let’s quickly review what you’ve learned in this level!", + "speaking": "is speaking...", + "you_have_finished_practice": "You have finished your practice", + "view_results": "View My Results", + "sample_answer": "Sample Answer", + "your_answer": "Your Answer", + "sound_confident": "You sound more confident this time - great improvement!", + "you_have_completed": "Yay, you’ve completed", + "yes": "Yes", + "no": "No", + "want_to_quit": "Are you sure you want to quit?", + "required_field": "The field is required", + "enter_full_name": "Enter your full name", + "invalid_email": "Invalid email format", + "phone_must_start_with": "Phone number must start with 251", + "phone_must_be": "Phone number must be 12 digits", + "what_should_we_call_you": "What should we call you?", + "use_for_personalization": "We’ll use your name to personalize your learning journey." } diff --git a/lib/services/in_app_update_service.dart b/lib/services/in_app_update_service.dart index 0b5dd28..286a0dc 100644 --- a/lib/services/in_app_update_service.dart +++ b/lib/services/in_app_update_service.dart @@ -1,9 +1,15 @@ import 'package:battery_plus/battery_plus.dart'; import 'package:flutter/services.dart'; import 'package:in_app_update/in_app_update.dart'; +import 'package:stacked_services/stacked_services.dart'; import 'package:storage_info/storage_info.dart'; +import 'package:yimaru_app/app/app.locator.dart'; + +import '../ui/common/ui_helpers.dart'; class InAppUpdateService { + final _navigationService = locator(); + Future getBatteryLevel() async { final battery = Battery(); final batteryLevel = await battery.batteryLevel; @@ -43,7 +49,11 @@ class InAppUpdateService { try { final info = await InAppUpdate.checkForUpdate(); if (info.updateAvailability == UpdateAvailability.updateAvailable) { - await InAppUpdate.completeFlexibleUpdate(); + AppUpdateResult result = await InAppUpdate.performImmediateUpdate(); + if (result == AppUpdateResult.userDeniedUpdate) { + showErrorToast('An update is required to continue using this app.'); + _navigationService.back(); + } } // ... rest of your update logic ... diff --git a/lib/ui/common/translations/codegen_loader.g.dart b/lib/ui/common/translations/codegen_loader.g.dart index bfefa66..28811ce 100644 --- a/lib/ui/common/translations/codegen_loader.g.dart +++ b/lib/ui/common/translations/codegen_loader.g.dart @@ -135,7 +135,39 @@ class CodegenLoader extends AssetLoader{ "telegram_support": "የቴሌግራም ድጋፍ", "chat_via_telegram": "በቴሌግራም በፍጥነት ይወያዩ", "call_our_support": "ከ3 ጠዋት እስከ 12 ማታ ድረስ የድጋፍ ቡድናችንን ይደውሉ", - "tap_to_call": "ለመደወል ይንኩ" + "tap_to_call": "ለመደወል ይንኩ", + "join_telegram": "በቴሌግራም የይማሩ አካዳሚን ይቀላቀሉ", + "connect_with_support_team": "ለፈጣን እርዳታ እና የማህበረሰብ ዝማኔዎች፣ በቴሌግራም ከድጋፍ ቡድናችን ጋር ወዲያውኑ ይገናኙ።", + "open_in_telegram": "በቴሌግራም ይክፈቱ", + "search_for": "ፈልጉት", + "current_level": "የአሁኑ ደረጃ", + "keep_up_the_great_work": "በጣም ጥሩ እየሰራህ ነው! ቀጥልበት፣ አስደናቂ ነህ።", + "no_practice_available": "ምንም ልምምድ አልተገኘም!", + "begin_module_practice": "የሞጁሉን ልምምድ ጀምር", + "lets_practice_lesson": "እንለማመድ", + "lets_quickly_review": "በዚህ ሞጁል ውስጥ የተማርከውን በፍጥነት እንከልስ!", + "lets_practice_module": "አሁን የተማርከውን እንለማመድ!", + "ask_you_few_actions": "ጥቂት ጥያቄዎችን እጠይቅሃለሁ፣ አንተም በተፈጥሮ መልስ ልትሰጥ ትችላለህ።", + "begin_level_practice": "የደረጃ ልምምድን ጀምር", + "lets_practice_course": "የኮርሱን ልምምድ እንለማመድ", + "lets_quick_practice": "በዚህ ደረጃ የተማርከውን በፍጥነት እንከልስ!", + "speaking": "እየተናገረ ነው", + "you_have_finished_practice": "ልምምድህን አጠናቀቅህ", + "view_results": "ውጤቶቼን እይ", + "sample_answer": "ናሙና መልስ", + "your_answer": "መልስህ", + "sound_confident": "በዚህ ጊዜ የበለጠ እምነት ያለህ ይመስላል — በጣም ጥሩ መሻሻል ነው!", + "you_have_completed": "አያይ! አጠናቀቅህ", + "yes": "አዎ", + "no": "አይ", + "want_to_quit": "ለመውጣት እርግጠኛ ነህ?", + "required_field": "ይህ መስክ ያስፈልጋል", + "enter_full_name": "ሙሉ ስምህን አስገባ", + "invalid_email": "የማይሰራ የኢሜይል ቅርጸት", + "phone_must_start_with": "የስልክ ቁጥር በ251 መጀመር አለበት", + "phone_must_be": "የስልክ ቁጥር 12 አሃዞች መሆን አለበት", + "what_should_we_call_you": "ምን ብለን እንጠራህ?", + "use_for_personalization": "በመማር ጉዞህ ውስጥ ለግል ለማድረግ ስምህን እንጠቀማለን።" }; static const Map _en = { "loading": "Loading", @@ -212,7 +244,7 @@ static const Map _en = { "reply": "Reply", "cancel": "Cancel", "you_are_speaking": "You're speaking", - "practice_completed": "Practice completed", + "practice_completed": "Practice completed!", "great_improvement": "You sound more confident this time, great improvement", "practice_again": "Practice again", "conversation_review": "Conversation review", @@ -258,7 +290,39 @@ static const Map _en = { "telegram_support": "Telegram support", "chat_via_telegram": "Chat instantly via Telegram", "call_our_support": "Call our support team between 9 AM - 6 PM", - "tap_to_call": "Tap to call" + "tap_to_call": "Tap to call", + "join_telegram": "Join Yimaru Academy on Telegram", + "connect_with_support_team": "Connect with our support team instantly on Telegram for quick assistance and community updates", + "open_in_telegram": "Open in Telegram", + "search_for": "Search for", + "current_level": "Current Level", + "keep_up_the_great_work": "Keep up the great work! You\\'re doing amazing.", + "no_practice_available": "No practice available!", + "begin_module_practice": "Begin Module Practice", + "lets_practice_lesson": "Let’s Practice", + "lets_quickly_review": "Let’s quickly review what you’ve learned in this module!", + "lets_practice_module": "Let's practice what you just learnt!", + "ask_you_few_actions": "I’ll ask you a few questions, and you can respond naturally.", + "begin_level_practice": "Begin Level Practice", + "lets_practice_course": "Let’s Practice Course", + "lets_quick_review": "Let’s quickly review what you’ve learned in this level!", + "speaking": "is speaking...", + "you_have_finished_practice": "You have finished your practice", + "view_results": "View My Results", + "sample_answer": "Sample Answer", + "your_answer": "Your Answer", + "sound_confident": "You sound more confident this time - great improvement!", + "you_have_completed": "Yay, you’ve completed", + "yes": "Yes", + "no": "No", + "want_to_quit": "Are you sure you want to quit?", + "required_field": "The field is required", + "enter_full_name": "Enter your full name", + "invalid_email": "Invalid email format", + "phone_must_start_with": "Phone number must start with 251", + "phone_must_be": "Phone number must be 12 digits", + "what_should_we_call_you": "What should we call you?", + "use_for_personalization": "We’ll use your name to personalize your learning journey." }; static const Map> mapLocales = {"am": _am, "en": _en}; } diff --git a/lib/ui/common/translations/locale_keys.g.dart b/lib/ui/common/translations/locale_keys.g.dart index 4c30a2f..6cdf350 100644 --- a/lib/ui/common/translations/locale_keys.g.dart +++ b/lib/ui/common/translations/locale_keys.g.dart @@ -122,5 +122,37 @@ abstract class LocaleKeys { static const chat_via_telegram = 'chat_via_telegram'; static const call_our_support = 'call_our_support'; static const tap_to_call = 'tap_to_call'; + static const join_telegram = 'join_telegram'; + static const connect_with_support_team = 'connect_with_support_team'; + static const open_in_telegram = 'open_in_telegram'; + static const search_for = 'search_for'; + static const current_level = 'current_level'; + static const keep_up_the_great_work = 'keep_up_the_great_work'; + static const no_practice_available = 'no_practice_available'; + static const begin_module_practice = 'begin_module_practice'; + static const lets_practice_lesson = 'lets_practice_lesson'; + static const lets_quickly_review = 'lets_quickly_review'; + static const lets_practice_module = 'lets_practice_module'; + static const ask_you_few_actions = 'ask_you_few_actions'; + static const begin_level_practice = 'begin_level_practice'; + static const lets_practice_course = 'lets_practice_course'; + static const lets_quick_practice = 'lets_quick_practice'; + static const speaking = 'speaking'; + static const you_have_finished_practice = 'you_have_finished_practice'; + static const view_results = 'view_results'; + static const sample_answer = 'sample_answer'; + static const your_answer = 'your_answer'; + static const sound_confident = 'sound_confident'; + static const you_have_completed = 'you_have_completed'; + static const yes = 'yes'; + static const no = 'no'; + static const want_to_quit = 'want_to_quit'; + static const required_field = 'required_field'; + static const enter_full_name = 'enter_full_name'; + static const invalid_email = 'invalid_email'; + static const phone_must_start_with = 'phone_must_start_with'; + static const phone_must_be = 'phone_must_be'; + static const what_should_we_call_you = 'what_should_we_call_you'; + static const use_for_personalization = 'use_for_personalization'; } diff --git a/lib/ui/common/validators/form_validator.dart b/lib/ui/common/validators/form_validator.dart index 58148f1..556383d 100644 --- a/lib/ui/common/validators/form_validator.dart +++ b/lib/ui/common/validators/form_validator.dart @@ -1,4 +1,6 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:email_validator/email_validator.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; class FormValidator { // Form validator @@ -8,7 +10,7 @@ class FormValidator { } if (value.isEmpty) { - return 'The field is required'; + return LocaleKeys.required_field.tr(); } return null; @@ -21,12 +23,12 @@ class FormValidator { } if (value.isEmpty) { - return 'The field is required'; + return LocaleKeys.required_field.tr(); } final regex = RegExp(r'^\S+\s+\S+.*$'); if (!regex.hasMatch(value.trim())) { - return "Enter your full name"; + return LocaleKeys.enter_full_name.tr(); } return null; } @@ -38,11 +40,11 @@ class FormValidator { } if (value.isEmpty) { - return 'The field is required'; + return LocaleKeys.required_field.tr(); } if (!EmailValidator.validate(value)) { - return 'Invalid email format'; + return LocaleKeys.invalid_email.tr(); } return null; @@ -55,7 +57,7 @@ class FormValidator { } if (value.isEmpty) { - return 'The field is required'; + return LocaleKeys.required_field.tr(); } return null; } @@ -67,19 +69,19 @@ class FormValidator { } if (value.isEmpty) { - return 'The field is required'; + return LocaleKeys.required_field.tr(); } // Regex validation final regex = RegExp(r'^251'); if (!regex.hasMatch(value)) { - return 'Phone number must start with 251'; + return LocaleKeys.phone_must_start_with.tr(); } // Length check first (optional but recommended) if (value.length != 12) { - return 'Phone number must be 12 digits'; + return LocaleKeys.phone_must_be.tr(); } return null; } diff --git a/lib/ui/views/home/home_view.dart b/lib/ui/views/home/home_view.dart index 4cda9d8..b9c5d90 100644 --- a/lib/ui/views/home/home_view.dart +++ b/lib/ui/views/home/home_view.dart @@ -6,6 +6,7 @@ import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/views/learn_program/learn_program_view.dart'; import 'package:yimaru_app/ui/views/profile/profile_view.dart'; +import '../../widgets/coming_soon.dart'; import '../course/course_view.dart'; import 'home_viewmodel.dart'; @@ -71,7 +72,7 @@ class HomeView extends StackedView { case 0: return const LearnProgramView(); case 1: - return const CourseView(); + return const ComingSoon(); default: return const ProfileView(); diff --git a/lib/ui/views/learn_course/learn_course_viewmodel.dart b/lib/ui/views/learn_course/learn_course_viewmodel.dart index 0f7b978..daa9bb5 100644 --- a/lib/ui/views/learn_course/learn_course_viewmodel.dart +++ b/lib/ui/views/learn_course/learn_course_viewmodel.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; import 'package:yimaru_app/app/app.router.dart'; @@ -7,6 +8,7 @@ import '../../../models/learn_course.dart'; import '../../../services/learn_service.dart'; import '../../../services/status_checker_service.dart'; import '../../common/enmus.dart'; +import '../../common/translations/locale_keys.g.dart'; class LearnCourseViewModel extends ReactiveViewModel { // Dependency injection @@ -35,10 +37,10 @@ class LearnCourseViewModel extends ReactiveViewModel { await _navigationService.navigateToLearnPracticeView( id: id, level: level, - label: 'Begin Level Practice', practice: LearnPractices.course, - title: 'Let’s Practice Course $level', - subtitle: 'Let’s quickly review what you’ve learned in this level!', + label: LocaleKeys.begin_level_practice.tr(), + subtitle: LocaleKeys.lets_quick_practice.tr(), + title: '${LocaleKeys.lets_practice_course.tr()} $level', ); // Remote api call diff --git a/lib/ui/views/learn_lesson/learn_lesson_view.dart b/lib/ui/views/learn_lesson/learn_lesson_view.dart index fb68d7c..3f4b80c 100644 --- a/lib/ui/views/learn_lesson/learn_lesson_view.dart +++ b/lib/ui/views/learn_lesson/learn_lesson_view.dart @@ -1,8 +1,10 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/models/learn_lesson.dart'; import 'package:yimaru_app/models/learn_module.dart'; import 'package:yimaru_app/ui/common/enmus.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/widgets/learn_lesson_tile.dart'; import 'package:yimaru_app/ui/widgets/module_progress.dart'; import 'package:yimaru_app/ui/widgets/motivation_card.dart'; @@ -150,7 +152,7 @@ class LearnLessonView extends StackedView { Widget _buildMotivationCard() => const MotivationCard(); Widget _buildHeader() => Text( - 'Lessons in this module', + LocaleKeys.lessons_in_module.tr(), style: style18DG700, ); diff --git a/lib/ui/views/learn_lesson/learn_lesson_viewmodel.dart b/lib/ui/views/learn_lesson/learn_lesson_viewmodel.dart index 3bc8745..38019ad 100644 --- a/lib/ui/views/learn_lesson/learn_lesson_viewmodel.dart +++ b/lib/ui/views/learn_lesson/learn_lesson_viewmodel.dart @@ -1,8 +1,10 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; import 'package:yimaru_app/app/app.router.dart'; import 'package:yimaru_app/models/learn_lesson.dart'; import 'package:yimaru_app/ui/common/enmus.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import '../../../app/app.locator.dart'; import '../../../models/learn_module.dart'; @@ -31,11 +33,10 @@ class LearnLessonViewModel extends ReactiveViewModel { Future navigateToLearnPractice(int id) async => await _navigationService.navigateToLearnPracticeView( id: id, - label: 'Start Practice', practice: LearnPractices.lesson, - title: 'Let\'s practice what you just learnt!', - subtitle: - 'I’ll ask you a few questions, and you can respond naturally.', + label:LocaleKeys.start_practice.tr(), + title: LocaleKeys.lets_practice_module.tr(), + subtitle:LocaleKeys.ask_you_few_actions.tr(), ); Future navigateToLearnLessonDetail( diff --git a/lib/ui/views/learn_lesson_detail/learn_lesson_detail_view.dart b/lib/ui/views/learn_lesson_detail/learn_lesson_detail_view.dart index 182afc8..6d14d17 100644 --- a/lib/ui/views/learn_lesson_detail/learn_lesson_detail_view.dart +++ b/lib/ui/views/learn_lesson_detail/learn_lesson_detail_view.dart @@ -1,8 +1,10 @@ import 'package:chewie/chewie.dart'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/models/learn_lesson.dart'; import 'package:yimaru_app/models/learn_module.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import '../../common/app_colors.dart'; import '../../common/enmus.dart'; @@ -188,9 +190,9 @@ class LearnLessonDetailView extends StackedView { CustomElevatedButton( height: 55, borderRadius: 12, - text: 'Take Practice', foregroundColor: kcWhite, backgroundColor: kcPrimaryColor, + text:LocaleKeys.take_practice.tr() , onTap: () async => await _navigate(viewModel), ); } diff --git a/lib/ui/views/learn_module/learn_module_view.dart b/lib/ui/views/learn_module/learn_module_view.dart index d78175f..d05b8b1 100644 --- a/lib/ui/views/learn_module/learn_module_view.dart +++ b/lib/ui/views/learn_module/learn_module_view.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/models/learn_module.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/widgets/learn_module_tile.dart'; import 'package:yimaru_app/ui/widgets/overall_progress.dart'; @@ -97,7 +99,7 @@ class LearnModuleView extends StackedView { ); Widget _buildSubtitle() => Text( - 'Your Current Level', + LocaleKeys.your_current_level.tr(), style: style14P400, ); diff --git a/lib/ui/views/learn_module/learn_module_viewmodel.dart b/lib/ui/views/learn_module/learn_module_viewmodel.dart index 45a782a..4cf84b7 100644 --- a/lib/ui/views/learn_module/learn_module_viewmodel.dart +++ b/lib/ui/views/learn_module/learn_module_viewmodel.dart @@ -1,7 +1,9 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; import 'package:yimaru_app/app/app.router.dart'; import 'package:yimaru_app/models/learn_module.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import '../../../app/app.locator.dart'; import '../../../services/learn_service.dart'; @@ -36,10 +38,10 @@ class LearnModuleViewModel extends ReactiveViewModel { {required int id, required String module}) async => await _navigationService.navigateToLearnPracticeView( id: id, - label: 'Begin Module Practice', practice: LearnPractices.module, - title: 'Let’s Practice $module', - subtitle: 'Let’s quickly review what you’ve learned in this module! ', + label: LocaleKeys.begin_module_practice.tr(), + subtitle: LocaleKeys.lets_quickly_review.tr(), + title: '${LocaleKeys.lets_practice_module.tr()} $module', ); // Remote api call diff --git a/lib/ui/views/learn_practice/screens/interact_learn_practice_screen.dart b/lib/ui/views/learn_practice/screens/interact_learn_practice_screen.dart index 09d69cb..6ff6351 100644 --- a/lib/ui/views/learn_practice/screens/interact_learn_practice_screen.dart +++ b/lib/ui/views/learn_practice/screens/interact_learn_practice_screen.dart @@ -1,4 +1,5 @@ import 'package:audioplayers/audioplayers.dart'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:stacked/stacked.dart'; @@ -12,6 +13,7 @@ import 'package:yimaru_app/ui/widgets/wave_wrapper.dart'; import '../../../../models/learn_question.dart'; import '../../../common/app_colors.dart'; import '../../../common/enmus.dart'; +import '../../../common/translations/locale_keys.g.dart'; import '../../../common/ui_helpers.dart'; import '../../../widgets/custom_column_button.dart'; import '../../../widgets/small_app_bar.dart'; @@ -125,7 +127,7 @@ class InteractLearnPracticeScreen showBackButton: true, onPop: () async => await _showSheet(context: context, viewModel: viewModel), - title: 'Practice Speaking ($index/${viewModel.questions.length})'); + title: '${LocaleKeys.practice_speaking.tr()} ($index/${viewModel.questions.length})'); Widget _buildSpeakingIndicatorWrapper(LearnPracticeViewModel viewModel) => Column( @@ -152,13 +154,13 @@ class InteractLearnPracticeScreen : const SizedBox(height: 20); Widget _buildListeningLabel() => Text( - 'Daniel is speaking...', + 'Daniel ${LocaleKeys.speaking.tr()}', style: style14P400, textAlign: TextAlign.center, ); Widget _buildSpeakingLabel() => Text( - 'You\'re speaking...', + '${ LocaleKeys.you_are_speaking.tr()}...', style: style14P400, textAlign: TextAlign.center, ); @@ -237,7 +239,7 @@ class InteractLearnPracticeScreen ]; Widget _buildActionLabel() => Text( - 'Tap the microphone to speak', + LocaleKeys.tap_microphone.tr(), style: style14DG400, textAlign: TextAlign.center, ); @@ -288,7 +290,7 @@ class InteractLearnPracticeScreen Widget _buildReplyButton(LearnPracticeViewModel viewModel) => CustomColumnButton( icon: Icons.replay, - label: 'Reply', + label: LocaleKeys.reply.tr(), color: viewModel.recordingState == VoiceRecordingState.pending && viewModel.player.state != PlayerState.playing ? kcPrimaryColor @@ -356,8 +358,8 @@ class InteractLearnPracticeScreen required LearnPracticeViewModel viewModel}) => CustomColumnButton( color: kcRed, - label: 'Cancel', icon: Icons.close, + label:LocaleKeys.cancel.tr() , onTap: () async => await _showSheet(context: context, viewModel: viewModel), ); diff --git a/lib/ui/views/learn_practice/screens/learn_loading_screen.dart b/lib/ui/views/learn_practice/screens/learn_loading_screen.dart index c603e2b..47ad432 100644 --- a/lib/ui/views/learn_practice/screens/learn_loading_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_loading_screen.dart @@ -1,9 +1,11 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:yimaru_app/ui/widgets/no_data_indicator.dart'; import 'package:yimaru_app/ui/widgets/page_loading_indicator.dart'; import 'package:yimaru_app/ui/widgets/small_app_bar.dart'; import '../../../common/app_colors.dart'; +import '../../../common/translations/locale_keys.g.dart'; import '../../../common/ui_helpers.dart'; class LearnLoadingScreen extends StatelessWidget { @@ -65,7 +67,7 @@ class LearnLoadingScreen extends StatelessWidget { Align(alignment: Alignment.center, child: _buildRefreshButton()); Widget _buildRefreshButton() => NoDataIndicator( - title: 'No practice available!', - onTap: onTap, + onTap: onTap, + title: LocaleKeys.no_practice_available.tr(), ); } diff --git a/lib/ui/views/learn_practice/screens/learn_practice_appreciation_screen.dart b/lib/ui/views/learn_practice/screens/learn_practice_appreciation_screen.dart index 5e6d79c..6d3487c 100644 --- a/lib/ui/views/learn_practice/screens/learn_practice_appreciation_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_practice_appreciation_screen.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stacked/stacked.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; import '../../../common/app_colors.dart'; @@ -131,13 +133,13 @@ class LearnPracticeAppreciationScreen Widget _buildIcon() => SvgPicture.asset('assets/icons/success.svg'); Widget _buildTitle(LearnPracticeViewModel viewModel) => Text( - 'Great work, ${viewModel.user?.firstName}', + '${LocaleKeys.great_work.tr()}, ${viewModel.user?.firstName}', style: style25DG600, textAlign: TextAlign.center, ); Widget _buildSubtitle() => Text( - 'You have finished your practice', + LocaleKeys.you_have_finished_practice.tr(), style: style14DG400, textAlign: TextAlign.center, ); @@ -152,9 +154,10 @@ class LearnPracticeAppreciationScreen CustomElevatedButton( height: 55, borderRadius: 12, - text: 'View My Results', foregroundColor: kcWhite, onTap: () => viewModel.goTo(4), backgroundColor: kcPrimaryColor, + text: LocaleKeys.view_results.tr(), + ); } diff --git a/lib/ui/views/learn_practice/screens/learn_practice_completion_screen.dart b/lib/ui/views/learn_practice/screens/learn_practice_completion_screen.dart index 5776f8f..280335f 100644 --- a/lib/ui/views/learn_practice/screens/learn_practice_completion_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_practice_completion_screen.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stacked/stacked.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; import '../../../common/app_colors.dart'; @@ -61,7 +63,7 @@ class LearnPracticeCompletionScreen ); Widget _buildTitle() => Text( - 'Yay, you’ve completed $level ', + '${LocaleKeys.you_have_completed.tr()} $level ', style: style25DG600, textAlign: TextAlign.center, ); @@ -81,9 +83,9 @@ class LearnPracticeCompletionScreen CustomElevatedButton( height: 55, borderRadius: 12, - text: 'Continue', onTap: viewModel.pop, foregroundColor: kcWhite, + text: LocaleKeys.cont.tr(), backgroundColor: kcPrimaryColor, ); } diff --git a/lib/ui/views/learn_practice/screens/learn_practice_description_screen.dart b/lib/ui/views/learn_practice/screens/learn_practice_description_screen.dart index 5940e20..1572306 100644 --- a/lib/ui/views/learn_practice/screens/learn_practice_description_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_practice_description_screen.dart @@ -1,10 +1,12 @@ import 'package:cached_network_image/cached_network_image.dart'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/ui/common/helper_functions.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; import '../../../common/app_colors.dart'; +import '../../../common/translations/locale_keys.g.dart'; import '../../../common/ui_helpers.dart'; import '../../../widgets/cancel_learn_practice_sheet.dart'; import '../../../widgets/custom_elevated_button.dart'; @@ -175,9 +177,9 @@ class LearnPracticeDescriptionScreen CustomElevatedButton( height: 55, borderRadius: 12, - text: 'Start Practice', foregroundColor: kcWhite, onTap: () => viewModel.goTo(2), backgroundColor: kcPrimaryColor, + text: LocaleKeys.start_practice.tr() , ); } diff --git a/lib/ui/views/learn_practice/screens/learn_practice_finish_screen.dart b/lib/ui/views/learn_practice/screens/learn_practice_finish_screen.dart index 0991d0d..bee1bdc 100644 --- a/lib/ui/views/learn_practice/screens/learn_practice_finish_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_practice_finish_screen.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stacked/stacked.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; import '../../../common/app_colors.dart'; @@ -59,7 +61,7 @@ class LearnPracticeFinishScreen Widget _buildAppBar(LearnPracticeViewModel viewModel) => SmallAppBar( showBackButton: true, onPop: viewModel.goBack, - title: 'Practice Speaking', + title:LocaleKeys.practice_speaking.tr(), ); Widget _buildSpeakingIndicatorWrapper(LearnPracticeViewModel viewModel) => @@ -79,13 +81,13 @@ class LearnPracticeFinishScreen Widget _buildIcon() => SvgPicture.asset('assets/icons/success.svg'); Widget _buildTitle() => Text( - 'Practice Completed!', + LocaleKeys.practice_completed.tr(), style: style25DG600, textAlign: TextAlign.center, ); Widget _buildSubtitle() => Text( - 'You sound more confident this time - great improvement!', + LocaleKeys.sound_confident.tr() , style: style14DG400, textAlign: TextAlign.center, ); @@ -117,18 +119,18 @@ class LearnPracticeFinishScreen borderRadius: 12, onTap: viewModel.pop, foregroundColor: kcWhite, - text: 'Continue Practice', backgroundColor: kcPrimaryColor, + text: LocaleKeys.continue_practice.tr() , ); Widget _buildPracticeAgainButton(LearnPracticeViewModel viewModel) => CustomElevatedButton( height: 55, borderRadius: 12, - text: 'Practice Again', backgroundColor: kcWhite, borderColor: kcPrimaryColor, foregroundColor: kcPrimaryColor, + text: LocaleKeys.practice_again.tr(), onTap: () async => await _reset(viewModel), ); } diff --git a/lib/ui/views/learn_practice/screens/learn_practice_intro_screen.dart b/lib/ui/views/learn_practice/screens/learn_practice_intro_screen.dart index f972446..0555037 100644 --- a/lib/ui/views/learn_practice/screens/learn_practice_intro_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_practice_intro_screen.dart @@ -1,5 +1,7 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; import '../../../common/app_colors.dart'; @@ -174,7 +176,7 @@ class LearnPracticeIntroScreen extends ViewModelWidget { Widget _buildPartnerName() => Text.rich( TextSpan(text: 'Daniel', style: style14DG600, children: [ TextSpan( - text: ' - Your Speaking Partner', + text: ' - ${LocaleKeys.speaking_partner.tr()}', style: style14MG400, ) ]), diff --git a/lib/ui/views/learn_practice/screens/learn_practice_result_screen.dart b/lib/ui/views/learn_practice/screens/learn_practice_result_screen.dart index 514cc5c..0e7cd9c 100644 --- a/lib/ui/views/learn_practice/screens/learn_practice_result_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_practice_result_screen.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/ui/common/enmus.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; import 'package:yimaru_app/ui/widgets/learn_practice_tip_section.dart'; import 'package:yimaru_app/ui/widgets/learn_practice_results_wrapper.dart'; @@ -112,8 +114,8 @@ class LearnPracticeResultScreen {required BuildContext context, required LearnPracticeViewModel viewModel}) => SmallAppBar( - title: 'Result', showBackButton: true, + title:LocaleKeys.result.tr(), onPop: () async => await _showSheet(context: context, viewModel: viewModel), ); @@ -172,9 +174,9 @@ class LearnPracticeResultScreen Widget _buildContinueButton(LearnPracticeViewModel viewModel) => CustomElevatedButton( height: 55, - text: 'Continue', borderRadius: 12, foregroundColor: kcWhite, + text:LocaleKeys.cont.tr(), backgroundColor: kcPrimaryColor, onTap: () async => await _navigate(viewModel), ); @@ -182,10 +184,10 @@ class LearnPracticeResultScreen Widget _buildPracticeAgainButton(LearnPracticeViewModel viewModel) => CustomElevatedButton( height: 55, - text: 'Retry', borderRadius: 12, backgroundColor: kcWhite, borderColor: kcPrimaryColor, + text: LocaleKeys.retry.tr(), foregroundColor: kcPrimaryColor, onTap: () async => await _retry(viewModel), ); diff --git a/lib/ui/views/learn_practice/screens/start_learn_practice_screen.dart b/lib/ui/views/learn_practice/screens/start_learn_practice_screen.dart index e2e6f11..87a8781 100644 --- a/lib/ui/views/learn_practice/screens/start_learn_practice_screen.dart +++ b/lib/ui/views/learn_practice/screens/start_learn_practice_screen.dart @@ -1,5 +1,7 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; import 'package:yimaru_app/ui/widgets/custom_column_button.dart'; @@ -106,7 +108,8 @@ class StartLearnPracticeScreen extends ViewModelWidget { showBackButton: true, onPop: () async => await _showSheet(context: context, viewModel: viewModel), - title: 'Practice Speaking ($index/${viewModel.questions.length})'); + title: + '${LocaleKeys.practice_speaking.tr()} ($index/${viewModel.questions.length})'); Widget _buildSheet(LearnPracticeViewModel viewModel) => CancelLearnPracticeSheet( @@ -167,7 +170,7 @@ class StartLearnPracticeScreen extends ViewModelWidget { ); Widget _buildStartText() => Text( - 'Start', + LocaleKeys.start.tr(), style: style25W600, ); @@ -193,7 +196,7 @@ class StartLearnPracticeScreen extends ViewModelWidget { ]; Widget _buildActionLabel() => Text( - 'Tap the start button to listen', + LocaleKeys.tap_start_to_listen.tr() , style: style14DG400, textAlign: TextAlign.center, ); @@ -212,8 +215,8 @@ class StartLearnPracticeScreen extends ViewModelWidget { Widget _buildReplyButtonWrapper() => Expanded(child: _buildReplyButton()); - Widget _buildReplyButton() => const CustomColumnButton( - icon: Icons.replay, label: 'Reply', color: kcLightGrey); + Widget _buildReplyButton() => CustomColumnButton( + icon: Icons.replay, label:LocaleKeys.reply.tr() , color: kcLightGrey); Widget _buildMicButtonWrapper(LearnPracticeViewModel viewModel) => Expanded(child: _buildMicButton(viewModel)); diff --git a/lib/ui/views/onboarding/screens/full_name_form_screen.dart b/lib/ui/views/onboarding/screens/full_name_form_screen.dart index fe55cb1..fda7528 100644 --- a/lib/ui/views/onboarding/screens/full_name_form_screen.dart +++ b/lib/ui/views/onboarding/screens/full_name_form_screen.dart @@ -1,7 +1,9 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/ui/common/app_colors.dart'; import 'package:yimaru_app/ui/common/helper_functions.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/common/ui_helpers.dart'; import 'package:yimaru_app/ui/widgets/custom_elevated_button.dart'; import 'package:yimaru_app/ui/views/onboarding/onboarding_viewmodel.dart'; @@ -92,18 +94,14 @@ class FullNameFormScreen extends ViewModelWidget { onLanguage: () async => await viewModel.navigateToLanguage(), ); - Widget _buildTitle() => const Text( - 'What should we call you? 😊', - style: TextStyle( - fontSize: 25, - color: kcDarkGrey, - fontWeight: FontWeight.w600, - ), + Widget _buildTitle() => Text( + '${LocaleKeys.what_should_we_call_you.tr()} 😊', + style:style25DG600, ); - Widget _buildSubtitle() => const Text( - 'We’ll use your name to personalize your learning journey.', - style: TextStyle(color: kcMediumGrey), + Widget _buildSubtitle() => Text( + LocaleKeys.use_for_personalization.tr(), + style:style14MG400, ); Widget _buildFullNameFormField(OnboardingViewModel viewModel) => @@ -111,8 +109,8 @@ class FullNameFormScreen extends ViewModelWidget { controller: fullNameController, onTap: viewModel.setFullNameFocus, decoration: inputDecoration( - hint: 'Enter Your Name', focus: viewModel.focusFullName, + hint: LocaleKeys.enter_full_name.tr(), filled: fullNameController.text.isNotEmpty), ); @@ -134,9 +132,9 @@ class FullNameFormScreen extends ViewModelWidget { Widget _buildContinueButton(OnboardingViewModel viewModel) => CustomElevatedButton( height: 55, - text: 'Continue', borderRadius: 12, foregroundColor: kcWhite, + text: LocaleKeys.cont.tr(), backgroundColor: fullNameController.text.isNotEmpty && !viewModel.hasFullNameValidationMessage ? kcPrimaryColor diff --git a/lib/ui/views/profile/profile_view.dart b/lib/ui/views/profile/profile_view.dart index 0d3e35f..e854f6c 100644 --- a/lib/ui/views/profile/profile_view.dart +++ b/lib/ui/views/profile/profile_view.dart @@ -158,7 +158,7 @@ class ProfileView extends StackedView { List _buildSettingsChildren(ProfileViewModel viewModel) => [ // _buildDownloadsCard(viewModel), - _buildProgressCard(viewModel), + // _buildProgressCard(viewModel), _buildAccountCard(viewModel), _buildSupportCard(viewModel) ]; @@ -174,7 +174,7 @@ class ProfileView extends StackedView { icon: Icons.stacked_bar_chart, title: LocaleKeys.my_progress.tr(), subtitle: LocaleKeys.track_your_achievement.tr(), - // onTap: () async => await viewModel.navigateToProgress(), + onTap: () async => await viewModel.navigateToProgress(), ); Widget _buildAccountCard(ProfileViewModel viewModel) => ProfileCard( diff --git a/lib/ui/views/profile/profile_viewmodel.dart b/lib/ui/views/profile/profile_viewmodel.dart index 083e9e4..6b68fc4 100644 --- a/lib/ui/views/profile/profile_viewmodel.dart +++ b/lib/ui/views/profile/profile_viewmodel.dart @@ -1,8 +1,10 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; import 'package:yimaru_app/app/app.router.dart'; import 'package:yimaru_app/services/image_picker_service.dart'; import 'package:yimaru_app/ui/common/enmus.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import '../../../app/app.locator.dart'; import '../../../models/user.dart'; @@ -64,13 +66,13 @@ class ProfileViewModel extends ReactiveViewModel { // Dialog Future showAbortDialog() async { DialogResponse? response = await _dialogService.showDialog( - title: 'Logout', - cancelTitle: 'No', - buttonTitle: 'Yes', barrierDismissible: true, cancelTitleColor: kcDarkGrey, buttonTitleColor: kcPrimaryColor, - description: 'Are you sure you want to quit?', + title: LocaleKeys.logout.tr(), + cancelTitle: LocaleKeys.no.tr(), + buttonTitle: LocaleKeys.yes.tr(), + description: LocaleKeys.want_to_quit.tr(), ); return response?.confirmed; } diff --git a/lib/ui/views/profile_detail/profile_detail_view.dart b/lib/ui/views/profile_detail/profile_detail_view.dart index ab88376..dec02e0 100644 --- a/lib/ui/views/profile_detail/profile_detail_view.dart +++ b/lib/ui/views/profile_detail/profile_detail_view.dart @@ -1,7 +1,6 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:intl/intl.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked/stacked_annotations.dart'; import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; diff --git a/lib/ui/views/telegram_support/telegram_support_view.dart b/lib/ui/views/telegram_support/telegram_support_view.dart index 1b3e518..6f02d47 100644 --- a/lib/ui/views/telegram_support/telegram_support_view.dart +++ b/lib/ui/views/telegram_support/telegram_support_view.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/ui/common/app_constants.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/widgets/circular_icon.dart'; import '../../common/app_colors.dart'; @@ -52,7 +54,7 @@ class TelegramSupportView extends StackedView { Widget _buildAppbar(TelegramSupportViewModel viewModel) => SmallAppBar( onPop: viewModel.pop, showBackButton: true, - title: 'Telegram Support', + title: LocaleKeys.telegram_support.tr(), ); Widget _buildExpandedColumn(TelegramSupportViewModel viewModel) => @@ -93,13 +95,13 @@ class TelegramSupportView extends StackedView { const CircularIcon(icon: Icons.telegram, size: 50, color: kcSkyBlue); Widget _buildTitle() => Text( - 'Join Yimaru Academy on Telegram', + LocaleKeys.join_telegram.tr(), style: style25DG600, textAlign: TextAlign.center, ); Widget _buildSubtitle() => Text( - 'Connect with our support team instantly on Telegram for quick assistance and community updates', + LocaleKeys.connect_with_support_team.tr(), style: style14MG400, textAlign: TextAlign.center, ); @@ -123,17 +125,17 @@ class TelegramSupportView extends StackedView { CustomElevatedButton( height: 55, borderRadius: 12, - text: 'Open in Telegram', foregroundColor: kcWhite, leadingIcon: Icons.telegram, backgroundColor: kcPrimaryColor, + text: LocaleKeys.open_in_telegram.tr(), onTap: () async => await viewModel.launchTelegram(), ); Widget _buildOptionTextDivider() => const OptionTextDivider(); Widget _buildSearchText() => Text.rich( - TextSpan(text: 'Search for', style: style14DG500, children: [ + TextSpan(text: LocaleKeys.search_for.tr(), style: style14DG500, children: [ TextSpan( style: style14P600, text: ' $kTelegramSupport', diff --git a/lib/ui/widgets/cancel_learn_practice_sheet.dart b/lib/ui/widgets/cancel_learn_practice_sheet.dart index f06e899..db96c39 100644 --- a/lib/ui/widgets/cancel_learn_practice_sheet.dart +++ b/lib/ui/widgets/cancel_learn_practice_sheet.dart @@ -1,4 +1,6 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/widgets/speaking_partner_image.dart'; import '../common/app_colors.dart'; @@ -51,8 +53,11 @@ class CancelLearnPracticeSheet extends StatelessWidget { ); Widget _buildMessage() => Text.rich( - TextSpan(text: 'You’re almost there,', style: style18DG700, children: [ - TextSpan( + TextSpan( + text: '${LocaleKeys.almost_there.tr()},', + style: style18DG700, + children: [ + TextSpan( text: ' $user', style: style18P600, ) @@ -60,7 +65,7 @@ class CancelLearnPracticeSheet extends StatelessWidget { ); Widget _buildSubtitle() => Text( - 'Finish this session to see your progress.', + LocaleKeys.finish_session.tr(), style: style14DG400, textAlign: TextAlign.center, ); @@ -70,17 +75,17 @@ class CancelLearnPracticeSheet extends StatelessWidget { onTap: onContinue, borderRadius: 12, foregroundColor: kcWhite, - text: 'Continue Practice', backgroundColor: kcPrimaryColor, + text: LocaleKeys.continue_practice.tr(), ); Widget _buildEndButton() => CustomElevatedButton( height: 55, onTap: onCancel, borderRadius: 12, - text: 'End Session', backgroundColor: kcWhite, borderColor: kcPrimaryColor, foregroundColor: kcPrimaryColor, + text: LocaleKeys.end_session.tr(), ); } diff --git a/lib/ui/widgets/learn_course_tile.dart b/lib/ui/widgets/learn_course_tile.dart index 493465f..a1c643d 100644 --- a/lib/ui/widgets/learn_course_tile.dart +++ b/lib/ui/widgets/learn_course_tile.dart @@ -1,5 +1,7 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/widgets/progress_status.dart'; import '../../models/learn_course.dart'; @@ -107,9 +109,9 @@ class LearnCourseTile extends ViewModelWidget { ? _buildProgressStatus() : Container(); - Widget _buildProgressStatus() => const ProgressStatus( + Widget _buildProgressStatus() => ProgressStatus( color: kcPrimaryColor, - status: 'Current Level', + status: LocaleKeys.current_level.tr(), ); Widget _buildContent() => Text( @@ -143,9 +145,9 @@ class LearnCourseTile extends ViewModelWidget { height: 15, borderRadius: 12, onTap: onViewTap, - text: 'View Course', foregroundColor: kcWhite, backgroundColor: kcPrimaryColor, + text:LocaleKeys.view_course.tr(), ); Widget _buildPracticeButtonWrapper(LearnCourseViewModel viewModel) => @@ -158,9 +160,9 @@ class LearnCourseTile extends ViewModelWidget { height: 15, borderRadius: 12, onTap: onPracticeTap, - text: 'Take Practice', backgroundColor: kcWhite, borderColor: kcPrimaryColor, foregroundColor: kcPrimaryColor, + text:LocaleKeys.take_practice.tr() , ); } diff --git a/lib/ui/widgets/learn_lesson_tile.dart b/lib/ui/widgets/learn_lesson_tile.dart index 856c6f9..1467f64 100644 --- a/lib/ui/widgets/learn_lesson_tile.dart +++ b/lib/ui/widgets/learn_lesson_tile.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/models/learn_lesson.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/views/learn_lesson/learn_lesson_viewmodel.dart'; import 'package:yimaru_app/ui/widgets/mini_thumbnail.dart'; @@ -128,7 +130,7 @@ class LearnLessonTile extends ViewModelWidget { ); Widget _buildProgressText() => Text( - (lesson.access?.isCompleted ?? false) ? 'Completed' : 'In Progress', + (lesson.access?.isCompleted ?? false) ?LocaleKeys.completed.tr() : LocaleKeys.in_progress.tr() , style: style14P600, ); @@ -158,13 +160,13 @@ class LearnLessonTile extends ViewModelWidget { Widget _buildPracticeButton(LearnLessonViewModel viewModel) => CustomElevatedButton( height: 15, - text: 'Practice', borderRadius: 12, onTap: onPracticeTap, trailingIcon: Icons.mic, width: double.maxFinite, backgroundColor: kcWhite, borderColor: kcPrimaryColor, + text:LocaleKeys.practice.tr() , foregroundColor: kcPrimaryColor, ); @@ -176,11 +178,11 @@ class LearnLessonTile extends ViewModelWidget { Widget _buildLessonButton(LearnLessonViewModel viewModel) => CustomElevatedButton( height: 15, - text: 'Start', borderRadius: 12, onTap: onLessonTap, width: double.maxFinite, foregroundColor: kcWhite, + text:LocaleKeys.start.tr() , trailingIcon: Icons.play_arrow, backgroundColor: kcPrimaryColor, ); diff --git a/lib/ui/widgets/learn_module_tile.dart b/lib/ui/widgets/learn_module_tile.dart index e0189da..0be786d 100644 --- a/lib/ui/widgets/learn_module_tile.dart +++ b/lib/ui/widgets/learn_module_tile.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/models/learn_module.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/views/learn_module/learn_module_viewmodel.dart'; import 'package:yimaru_app/ui/widgets/custom_container_shader.dart'; import 'package:yimaru_app/ui/widgets/custom_linear_progress_indicator.dart'; @@ -191,9 +193,9 @@ class LearnModuleTile extends ViewModelWidget { height: 15, borderRadius: 12, onTap: onModuleTap, - text: 'View Module', foregroundColor: kcWhite, backgroundColor: kcPrimaryColor, + text: LocaleKeys.view_module.tr(), ); Widget _buildPracticeButtonWrapper(LearnModuleViewModel viewModel) => @@ -206,10 +208,10 @@ class LearnModuleTile extends ViewModelWidget { height: 15, borderRadius: 12, onTap: onPracticeTap, - text: 'Take Practices', backgroundColor: kcWhite, borderColor: kcPrimaryColor, foregroundColor: kcPrimaryColor, + text:LocaleKeys.take_practice.tr(), // onTap: () async => await viewModel.navigateToLearnPractice(practices), ); diff --git a/lib/ui/widgets/learn_practice_result_card.dart b/lib/ui/widgets/learn_practice_result_card.dart index 7a0a6a7..6849cb0 100644 --- a/lib/ui/widgets/learn_practice_result_card.dart +++ b/lib/ui/widgets/learn_practice_result_card.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/ui/common/enmus.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/common/ui_helpers.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; import 'package:yimaru_app/ui/widgets/learn_practice_answer_card.dart'; @@ -51,7 +53,7 @@ class LearnPracticeResultCard extends ViewModelWidget { Widget _buildSampleResponse() => LearnPracticeAnswerCard( answer: answer, voice: Voice.sample, - title: 'Sample Answer', + title:LocaleKeys.sample_answer.tr() , ); Widget _buildActualResponseWrapper() => @@ -59,7 +61,8 @@ class LearnPracticeResultCard extends ViewModelWidget { Widget _buildActualResponse() => LearnPracticeAnswerCard( answer: answer, - title: 'Your Answer', voice: Voice.recorded, - ); + title: LocaleKeys.your_answer.tr(), + + ); } diff --git a/lib/ui/widgets/learn_practice_results_wrapper.dart b/lib/ui/widgets/learn_practice_results_wrapper.dart index 804f06e..c9c639c 100644 --- a/lib/ui/widgets/learn_practice_results_wrapper.dart +++ b/lib/ui/widgets/learn_practice_results_wrapper.dart @@ -1,5 +1,7 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/common/ui_helpers.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; import 'package:yimaru_app/ui/widgets/learn_practice_result_card.dart'; @@ -33,7 +35,7 @@ class LearnPracticeResultsWrapper [_buildTitle(), verticalSpaceSmall, _buildResults(viewModel)]; Widget _buildTitle() => Text( - 'Conversation Review', + LocaleKeys.conversation_review.tr(), style: style16DG600, textAlign: TextAlign.center, ); diff --git a/lib/ui/widgets/learn_practice_tip_section.dart b/lib/ui/widgets/learn_practice_tip_section.dart index 7e8a5e6..bb866ea 100644 --- a/lib/ui/widgets/learn_practice_tip_section.dart +++ b/lib/ui/widgets/learn_practice_tip_section.dart @@ -1,6 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:yimaru_app/ui/common/app_colors.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/common/ui_helpers.dart'; import 'package:yimaru_app/ui/views/learn_practice/learn_practice_viewmodel.dart'; @@ -39,7 +41,7 @@ class LearnPracticeTipSection extends ViewModelWidget { ); Widget _buildTitle() => Text( - 'Quick Tip', + LocaleKeys.quick_tip.tr(), style: style16B600, ); diff --git a/lib/ui/widgets/learn_program_tile.dart b/lib/ui/widgets/learn_program_tile.dart index 923386d..712b9a9 100644 --- a/lib/ui/widgets/learn_program_tile.dart +++ b/lib/ui/widgets/learn_program_tile.dart @@ -24,7 +24,7 @@ class LearnProgramTile extends ViewModelWidget { Widget _buildExpansionTileCardWrapper(LearnProgramViewModel viewModel) => GestureDetector( - onTap: !(program.access?.isAccessible ?? false) ? onLockTap : null, + // onTap: !(program.access?.isAccessible ?? false) ? onLockTap : null, child: _buildExpansionTileCard(viewModel), ); diff --git a/lib/ui/widgets/module_progress.dart b/lib/ui/widgets/module_progress.dart index 9f6c5e8..7e420a0 100644 --- a/lib/ui/widgets/module_progress.dart +++ b/lib/ui/widgets/module_progress.dart @@ -1,4 +1,6 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import '../common/app_colors.dart'; import '../common/ui_helpers.dart'; @@ -44,7 +46,7 @@ class ModuleProgress extends StatelessWidget { [_buildProgressInfo(), _buildProgress()]; Widget _buildProgressInfo() => Text( - '$progress% Progress', + '$progress% ${LocaleKeys.progress.tr()}', style: style16DG400, ); diff --git a/lib/ui/widgets/motivation_card.dart b/lib/ui/widgets/motivation_card.dart index de0e01e..7a0d596 100644 --- a/lib/ui/widgets/motivation_card.dart +++ b/lib/ui/widgets/motivation_card.dart @@ -1,4 +1,6 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/common/ui_helpers.dart'; import '../common/app_colors.dart'; @@ -31,7 +33,7 @@ class MotivationCard extends StatelessWidget { Widget _buildText() => Expanded( child: Text( - 'Let’s keep going — you’re more than halfway there!', + LocaleKeys.keep_going.tr(), maxLines: 2, style: style14DG400, ), diff --git a/lib/ui/widgets/overall_progress.dart b/lib/ui/widgets/overall_progress.dart index 3de6a24..f37c92a 100644 --- a/lib/ui/widgets/overall_progress.dart +++ b/lib/ui/widgets/overall_progress.dart @@ -1,5 +1,7 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:yimaru_app/ui/common/app_colors.dart'; +import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart'; import 'package:yimaru_app/ui/common/ui_helpers.dart'; import 'package:yimaru_app/ui/widgets/custom_linear_progress_indicator.dart'; @@ -48,7 +50,7 @@ class OverallProgress extends StatelessWidget { [_buildProgressInfo(), _buildProgress()]; Widget _buildProgressInfo() => Text( - 'Overall Progress', + LocaleKeys.overall_progress.tr(), style: style16DG600, ); @@ -64,7 +66,7 @@ class OverallProgress extends StatelessWidget { ); Widget _buildSubtitle() => Text( - 'Keep up the great work! You\'re doing amazing.', + LocaleKeys.keep_up_the_great_work.tr(), style: style14DG500, ); } diff --git a/pubspec.yaml b/pubspec.yaml index 6b23de3..bd2a739 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: yimaru_app -version: 0.1.18+20 +version: 0.1.19+21 publish_to: 'none' description: A new Flutter project.