From 41ce21355360d3bb68b971e6b1ebaebb8d1db034 Mon Sep 17 00:00:00 2001 From: William Jordan-Cooley Date: Thu, 15 Aug 2024 11:43:56 -0400 Subject: [PATCH] show feedback in user l1 --- lib/pangea/choreographer/widgets/it_bar.dart | 6 +++++- lib/pangea/choreographer/widgets/it_feedback_card.dart | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/pangea/choreographer/widgets/it_bar.dart b/lib/pangea/choreographer/widgets/it_bar.dart index 28b0f8bd8..fc398cf03 100644 --- a/lib/pangea/choreographer/widgets/it_bar.dart +++ b/lib/pangea/choreographer/widgets/it_bar.dart @@ -305,7 +305,11 @@ class ITChoices extends StatelessWidget { chosenContinuance: controller.currentITStep!.continuances[index].text, bestContinuance: controller.currentITStep!.best.text, - feedbackLang: controller.targetLangCode, + // TODO: we want this to eventually switch between target and source lang, + // based on the learner's proficiency - maybe with the words involved in the translation + // maybe overall. For now, we'll just use the source lang. + feedbackLang: controller.choreographer.l1Lang?.langCode ?? + controller.sourceLangCode, sourceTextLang: controller.sourceLangCode, targetLang: controller.targetLangCode, ), diff --git a/lib/pangea/choreographer/widgets/it_feedback_card.dart b/lib/pangea/choreographer/widgets/it_feedback_card.dart index f959715ce..06f2493d1 100644 --- a/lib/pangea/choreographer/widgets/it_feedback_card.dart +++ b/lib/pangea/choreographer/widgets/it_feedback_card.dart @@ -146,8 +146,11 @@ class ITFeedbackCardView extends StatelessWidget { controller.res!.text, style: BotStyle.text(context), ), - // if res is not null, show a button to translate the text - if (controller.res != null && controller.translatedFeedback == null) + // if res is not null and feedback not in the userL1, show a button to translate the text + if (controller.res != null && + controller.translatedFeedback == null && + controller.widget.req.feedbackLang != + controller.controller.languageController.userL1?.langCode) Column( children: [ const SizedBox(height: 10),