From 94f87a5312af33e67e47cbf7e8b7c640fe96ff24 Mon Sep 17 00:00:00 2001 From: William Jordan-Cooley Date: Fri, 14 Jun 2024 08:38:10 -0400 Subject: [PATCH] copy edits --- assets/l10n/intl_en.arb | 14 ++++++++------ assets/l10n/intl_es.arb | 8 ++++---- lib/pangea/enum/span_data_type.dart | 7 +++++-- lib/pangea/utils/match_copy.dart | 18 +++++++++++------- lib/pangea/widgets/igc/span_card.dart | 7 ++++--- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 7fceca29b..6974d82f0 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -2514,7 +2514,7 @@ "type": "text", "placeholders": {} }, - "interactiveTranslatorAutoPlaySliderHeader": "Auto Play Interactive Translator", + "interactiveTranslatorAutoPlaySliderHeader": "Autoplay translation", "@interactiveTranslatorAutoPlaySliderHeader": { "type": "text", "placeholders": {} @@ -2884,21 +2884,23 @@ "type": "text", "placeholders": {} }, - "helpMeTranslate": "Help me translate!", + "helpMeTranslate": "Yes!", "@helpMeTranslate": { "type": "text", "placeholders": {} }, - "needsItShortMessage": "Try interactive translation!", + "needsItShortMessage": "Out of target", "needsIGCShortMessage": "Try interactive grammar assistance!", "@needsItShortMessage": { "type": "text", "placeholders": {} }, - "needsItMessage": "This message has too many words in your base language.", + "needsItMessage": "Wait, that's not {targetLanguage}! Do you need help translating?", "@needsItMessage": { "type": "text", - "placeholders": {} + "placeholders": { + "targetLanguage": {} + } }, "needsIgcMessage": "This message has a grammar error.", "tokenTranslationTitle": "A word is in your base language.", @@ -3974,4 +3976,4 @@ "roomDataMissing": "Some data may be missing from rooms in which you are not a member.", "updatePhoneOS": "You may need to update your device's OS version.", "wordsPerMinute": "Words per minute" -} +} \ No newline at end of file diff --git a/assets/l10n/intl_es.arb b/assets/l10n/intl_es.arb index 3d652ac2a..819caeea0 100644 --- a/assets/l10n/intl_es.arb +++ b/assets/l10n/intl_es.arb @@ -3099,7 +3099,7 @@ "type": "text", "placeholders": {} }, - "interactiveTranslatorAutoPlaySliderHeader": "Traductora interactiva de reproducción automática", + "interactiveTranslatorAutoPlaySliderHeader": "Traducción de reproducción automática", "interactiveTranslatorAutoPlay": "Traductora interactiva de reproducción automática", "@interactiveTranslatorAutoPlay": { "type": "text", @@ -3172,10 +3172,10 @@ "translationSeemsFinished": "La traducción parece estar terminada.", "needsItShortMessage": "¡Pruebe la traducción interactiva!", "needsIGCShortMessage": "¡Pruebe el corrector gramatical interactivo!", - "needsItMessage": "Este mensaje tiene demasiadas palabras en su idioma base.", + "needsItMessage": "Espera, ¡ese no es {targetLanguage}! ¿Necesitas ayuda para traducir?", "needsIgcMessage": "Este mensaje tiene un error gramatical.", "tokenTranslationTitle": "Una palabra está en su idioma base.", - "helpMeTranslate": "¡Ayúdeme a traducir!", + "helpMeTranslate": "¡Sí!", "setToPublicSettingsTitle": "¿Quiere encontrar un compañero de conversación?", "setToPublicSettingsDesc": "Antes de que pueda buscar un compañero de conversación, debe configurar la visibilidad de su perfil como pública.", "publicProfileTitle": "Perfil público", @@ -4663,4 +4663,4 @@ "conversationBotDiscussionZone_discussionTriggerReactionKeyLabel": "Reacción al envío del aviso de debate", "studentAnalyticsNotAvailable": "Datos de los estudiantes no disponibles actualmente", "roomDataMissing": "Es posible que falten algunos datos de las salas de las que no es miembro." -} +} \ No newline at end of file diff --git a/lib/pangea/enum/span_data_type.dart b/lib/pangea/enum/span_data_type.dart index 5e4fdf8cb..949aac26b 100644 --- a/lib/pangea/enum/span_data_type.dart +++ b/lib/pangea/enum/span_data_type.dart @@ -1,5 +1,5 @@ +import 'package:fluffychat/widgets/matrix.dart'; import 'package:flutter/material.dart'; - import 'package:flutter_gen/gen_l10n/l10n.dart'; enum SpanDataTypeEnum { @@ -32,7 +32,10 @@ extension SpanDataTypeEnumExt on SpanDataTypeEnum { case SpanDataTypeEnum.correction: return L10n.of(context)!.correctionDefaultPrompt; case SpanDataTypeEnum.itStart: - return L10n.of(context)!.needsItMessage; + return L10n.of(context)!.needsItMessage( + MatrixState.pangeaController.languageController.userL2?.displayName ?? + "target language", + ); } } } diff --git a/lib/pangea/utils/match_copy.dart b/lib/pangea/utils/match_copy.dart index 28080f9b5..86d784356 100644 --- a/lib/pangea/utils/match_copy.dart +++ b/lib/pangea/utils/match_copy.dart @@ -1,13 +1,13 @@ import 'dart:developer'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; - -import 'package:flutter_gen/gen_l10n/l10n.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; - import 'package:fluffychat/pangea/enum/span_data_type.dart'; import 'package:fluffychat/pangea/utils/error_handler.dart'; +import 'package:fluffychat/widgets/matrix.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; + import '../constants/match_rule_ids.dart'; import '../models/pangea_match_model.dart'; @@ -96,7 +96,11 @@ class MatchCopy { switch (afterColon) { case MatchRuleIds.interactiveTranslation: title = l10n.needsItShortMessage; - description = l10n.needsItMessage; + description = l10n.needsItMessage( + MatrixState + .pangeaController.languageController.userL2?.displayName ?? + "target language", + ); break; case MatchRuleIds.tokenNeedsTranslation: title = l10n.tokenTranslationTitle; diff --git a/lib/pangea/widgets/igc/span_card.dart b/lib/pangea/widgets/igc/span_card.dart index 52901bfa2..9b9fbb4ec 100644 --- a/lib/pangea/widgets/igc/span_card.dart +++ b/lib/pangea/widgets/igc/span_card.dart @@ -162,6 +162,7 @@ class WordMatchContent extends StatelessWidget { try { return Column( children: [ + // if (!controller.widget.scm.pangeaMatch!.isITStart) CardHeader( text: controller.error?.toString() ?? matchCopy.title, botExpression: controller.error == null @@ -222,7 +223,7 @@ class WordMatchContent extends StatelessWidget { opacity: 0.8, child: TextButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( AppConfig.primaryColor.withOpacity(0.1), ), ), @@ -249,7 +250,7 @@ class WordMatchContent extends StatelessWidget { ? onReplaceSelected : null, style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( (controller.selectedChoice != null ? controller.selectedChoice!.color : AppConfig.primaryColor) @@ -272,7 +273,7 @@ class WordMatchContent extends StatelessWidget { ); }, style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( (AppConfig.primaryColor).withOpacity(0.1), ), ),