From 6a01e9484620e1ecb56c94105a6a2cfda33e0914 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 1 Jun 2021 13:51:33 -0700 Subject: [PATCH] New Strings, Updated Message Error UI + Make Acks Larger --- lib/l10n/intl_de.arb | 5 +++++ lib/l10n/intl_en.arb | 11 ++++++++--- lib/l10n/intl_es.arb | 5 +++++ lib/l10n/intl_fr.arb | 5 +++++ lib/l10n/intl_it.arb | 5 +++++ lib/l10n/intl_pt.arb | 5 +++++ lib/views/contactsview.dart | 2 +- lib/views/groupsettingsview.dart | 6 +++--- lib/widgets/invitationbubble.dart | 16 ++++++++++------ lib/widgets/messagebubble.dart | 24 +++++++++++++++++------- pubspec.lock | 20 +++++++++++++++++--- 11 files changed, 81 insertions(+), 23 deletions(-) diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb index f8cdf6c..3d1a360 100644 --- a/lib/l10n/intl_de.arb +++ b/lib/l10n/intl_de.arb @@ -75,10 +75,12 @@ "invitation": "Einladung", "invitationLabel": "Einladung", "inviteBtn": "Einladen", + "inviteToGroup": "", "inviteToGroupLabel": "In die Gruppe einladen", "joinGroup": "Gruppe beitreten", "joinGroupTab": "Einer Gruppe beitreten", "largeTextLabel": "Groß", + "leaveGroup": "", "listsBtn": "Listen", "loadingTor": "Tor wird geladen...", "localeDe": "Deutsche", @@ -95,6 +97,7 @@ "newBulletinLabel": "Neue Meldung", "newConnectionPaneTitle": "Neue Verbindung", "newGroupBtn": "Neue Gruppe anlegen", + "newPassword": "", "newProfile": "Neues Profil", "noPasswordWarning": "Wenn für dieses Konto kein Passwort verwendet wird, bedeutet dies, dass alle lokal gespeicherten Daten nicht verschlüsselt werden.", "password": "Passwort", @@ -116,6 +119,7 @@ "puzzleGameBtn": "Puzzlespiel", "radioNoPassword": "Unverschlüsselt (kein Passwort)", "radioUsePassword": "Passwort", + "reallyLeaveThisGroupPrompt": "", "rejectGroupBtn": "Ablehnen", "saveBtn": "Speichern", "savePeerHistory": "Peer-Verlauf speichern", @@ -153,6 +157,7 @@ "versionTor": "Version %1 mit tor %2", "viewGroupMembershipTooltip": "Gruppenmitgliedschaft anzeigen", "viewServerInfo": "", + "yesLeave": "", "yourDisplayName": "Ihr Anzeigename", "yourProfiles": "Ihre Profile", "yourServers": "Ihre Server", diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 78fecfd..8ce8f99 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -75,10 +75,12 @@ "invitation": "Invitation", "invitationLabel": "Invitation", "inviteBtn": "Invite", + "inviteToGroup": "You have been invited to join a group:", "inviteToGroupLabel": "Invite to group", "joinGroup": "Join group", "joinGroupTab": "Join a group", "largeTextLabel": "Large", + "leaveGroup": "Leave This Conversation", "listsBtn": "Lists", "loadingTor": "Loading tor...", "localeDe": "Deutsche", @@ -95,6 +97,7 @@ "newBulletinLabel": "New Bulletin", "newConnectionPaneTitle": "New Connection", "newGroupBtn": "Create new group", + "newPassword": "New Password", "newProfile": "New Profile", "noPasswordWarning": "Not using a password on this account means that all data stored locally will not be encrypted", "password": "Password", @@ -103,7 +106,7 @@ "passwordChangeError": "Error changing password: Supplied password rejected", "passwordErrorEmpty": "Password cannot be empty", "passwordErrorMatch": "Passwords do not match", - "pasteAddressToAddContact": "Paste a cwtch address here to add a new contact.", + "pasteAddressToAddContact": "Paste a cwtch address, invitation or key bundle here to add a new conversation", "peerAddress": "Address", "peerBlockedMessage": "Peer is blocked", "peerName": "Name", @@ -116,6 +119,7 @@ "puzzleGameBtn": "Puzzle Game", "radioNoPassword": "Unencrypted (No password)", "radioUsePassword": "Password", + "reallyLeaveThisGroupPrompt": "Are you sure you want to leave this conversation? All messages and attributes will be deleted.", "rejectGroupBtn": "Reject", "saveBtn": "Save", "savePeerHistory": "Save Peer History", @@ -137,12 +141,12 @@ "successfullAddedContact": "Successfully added ", "themeDark": "Dark", "themeLight": "Light", - "titleManageContacts": "Manage Contacts", + "titleManageContacts": "Conversations", "titleManageProfiles": "Manage Cwtch Profiles", "titleManageServers": "Manage Servers", "titlePlaceholder": "title...", "todoPlaceholder": "Todo...", - "tooltipAddContact": "Add a new contact", + "tooltipAddContact": "Add a new contact or conversation", "tooltipOpenSettings": "Open the settings pane", "tooltipUnlockProfiles": "Unlock encrypted profiles by entering their password.", "unblockBtn": "Unblock Peer", @@ -153,6 +157,7 @@ "versionTor": "Version %1 with tor %2", "viewGroupMembershipTooltip": "View Group Membership", "viewServerInfo": "Server Info", + "yesLeave": "Yes, Leave This Conversation", "yourDisplayName": "Your Display Name", "yourProfiles": "Your Profiles", "yourServers": "Your Servers", diff --git a/lib/l10n/intl_es.arb b/lib/l10n/intl_es.arb index 0234709..02694e9 100644 --- a/lib/l10n/intl_es.arb +++ b/lib/l10n/intl_es.arb @@ -75,10 +75,12 @@ "invitation": "Invitación", "invitationLabel": "Invitación", "inviteBtn": "Invitar", + "inviteToGroup": "", "inviteToGroupLabel": "Invitar al grupo", "joinGroup": "Únete al grupo", "joinGroupTab": "Únete a un grupo", "largeTextLabel": "Grande", + "leaveGroup": "", "listsBtn": "Listas", "loadingTor": "Cargando tor...", "localeDe": "Alemán", @@ -95,6 +97,7 @@ "newBulletinLabel": "Nuevo Boletín", "newConnectionPaneTitle": "Nueva conexión", "newGroupBtn": "Crear un nuevo grupo de chat", + "newPassword": "", "newProfile": "Nuevo perfil", "noPasswordWarning": "No usar una contraseña para esta cuenta significa que los datos almacenados localmente no serán encriptados", "password": "Contraseña", @@ -116,6 +119,7 @@ "puzzleGameBtn": "Juego de rompecabezas", "radioNoPassword": "Sin cifrado (sin contraseña)", "radioUsePassword": "Contraseña", + "reallyLeaveThisGroupPrompt": "", "rejectGroupBtn": "Rechazar", "saveBtn": "Guardar", "savePeerHistory": "Guardar el historial con contacto", @@ -153,6 +157,7 @@ "versionTor": "Versión %1 con tor %2", "viewGroupMembershipTooltip": "Ver membresía del grupo", "viewServerInfo": "Información del servidor", + "yesLeave": "", "yourDisplayName": "Tu nombre de usuario", "yourProfiles": "Tus perfiles", "yourServers": "Tus servidores", diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index 2c5fa91..59bee35 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -75,10 +75,12 @@ "invitation": "", "invitationLabel": "Invitation", "inviteBtn": "Invitation", + "inviteToGroup": "", "inviteToGroupLabel": "Inviter quelqu'un", "joinGroup": "", "joinGroupTab": "", "largeTextLabel": "Large", + "leaveGroup": "", "listsBtn": "Listes", "loadingTor": "", "localeDe": "", @@ -95,6 +97,7 @@ "newBulletinLabel": "Nouveau bulletin", "newConnectionPaneTitle": "", "newGroupBtn": "Créer un nouveau groupe", + "newPassword": "", "newProfile": "", "noPasswordWarning": "", "password": "", @@ -116,6 +119,7 @@ "puzzleGameBtn": "Puzzle", "radioNoPassword": "", "radioUsePassword": "", + "reallyLeaveThisGroupPrompt": "", "rejectGroupBtn": "Refuser", "saveBtn": "Sauvegarder", "savePeerHistory": "", @@ -153,6 +157,7 @@ "versionTor": "", "viewGroupMembershipTooltip": "", "viewServerInfo": "", + "yesLeave": "", "yourDisplayName": "", "yourProfiles": "", "yourServers": "", diff --git a/lib/l10n/intl_it.arb b/lib/l10n/intl_it.arb index e306073..fd1d432 100644 --- a/lib/l10n/intl_it.arb +++ b/lib/l10n/intl_it.arb @@ -75,10 +75,12 @@ "invitation": "Invito", "invitationLabel": "Invito", "inviteBtn": "Invitare", + "inviteToGroup": "", "inviteToGroupLabel": "Invitare nel gruppo", "joinGroup": "Unisciti al gruppo", "joinGroupTab": "Unisciti a un gruppo", "largeTextLabel": "Grande", + "leaveGroup": "", "listsBtn": "Liste", "loadingTor": "Caricamento di tor...", "localeDe": "Tedesco", @@ -95,6 +97,7 @@ "newBulletinLabel": "Nuovo bollettino", "newConnectionPaneTitle": "Nuova connessione", "newGroupBtn": "Crea un nuovo gruppo", + "newPassword": "", "newProfile": "Nuovo profilo", "noPasswordWarning": "Non utilizzare una password su questo account significa che tutti i dati archiviati localmente non verranno criptati", "password": "Password", @@ -116,6 +119,7 @@ "puzzleGameBtn": "Gioco di puzzle", "radioNoPassword": "Non criptato (senza password)", "radioUsePassword": "Password", + "reallyLeaveThisGroupPrompt": "", "rejectGroupBtn": "Rifiuta", "saveBtn": "Salva", "savePeerHistory": "Salva cronologia peer", @@ -153,6 +157,7 @@ "versionTor": "Versione %1 con tor %2", "viewGroupMembershipTooltip": "Visualizza i membri del gruppo", "viewServerInfo": "Informazioni sul server", + "yesLeave": "", "yourDisplayName": "Il tuo nome visualizzato", "yourProfiles": "I tuoi profili", "yourServers": "I tuoi server", diff --git a/lib/l10n/intl_pt.arb b/lib/l10n/intl_pt.arb index c5ec9f8..ef4ab54 100644 --- a/lib/l10n/intl_pt.arb +++ b/lib/l10n/intl_pt.arb @@ -75,10 +75,12 @@ "invitation": "", "invitationLabel": "Convite", "inviteBtn": "Convidar", + "inviteToGroup": "", "inviteToGroupLabel": "Convidar ao grupo", "joinGroup": "", "joinGroupTab": "", "largeTextLabel": "Grande", + "leaveGroup": "", "listsBtn": "Listas", "loadingTor": "", "localeDe": "", @@ -95,6 +97,7 @@ "newBulletinLabel": "Novo Boletim", "newConnectionPaneTitle": "", "newGroupBtn": "Criar novo grupo", + "newPassword": "", "newProfile": "", "noPasswordWarning": "", "password": "", @@ -116,6 +119,7 @@ "puzzleGameBtn": "Jogo de Adivinhação", "radioNoPassword": "", "radioUsePassword": "", + "reallyLeaveThisGroupPrompt": "", "rejectGroupBtn": "Recusar", "saveBtn": "Salvar", "savePeerHistory": "", @@ -153,6 +157,7 @@ "versionTor": "", "viewGroupMembershipTooltip": "", "viewServerInfo": "", + "yesLeave": "", "yourDisplayName": "", "yourProfiles": "", "yourServers": "", diff --git a/lib/views/contactsview.dart b/lib/views/contactsview.dart index 647dfff..1c5c077 100644 --- a/lib/views/contactsview.dart +++ b/lib/views/contactsview.dart @@ -47,7 +47,7 @@ class _ContactsViewState extends State { width: 10, ), Expanded( - child: Text("%1 » %2".replaceAll("%1", Provider.of(context).nickname).replaceAll("%2", "Contacts"), + child: Text("%1 » %2".replaceAll("%1", Provider.of(context).nickname).replaceAll("%2", AppLocalizations.of(context)!.titleManageContacts), overflow: TextOverflow.ellipsis, style: TextStyle(color: Provider.of(context).current().mainTextColor()))), //todo ])), actions: [ diff --git a/lib/views/groupsettingsview.dart b/lib/views/groupsettingsview.dart index 1ed6ff7..c4efe5d 100644 --- a/lib/views/groupsettingsview.dart +++ b/lib/views/groupsettingsview.dart @@ -141,7 +141,7 @@ class _GroupSettingsViewState extends State { showAlertDialog(context); }, icon: Icon(Icons.delete), - label: Text(AppLocalizations.of(context)!.deleteBtn), + label: Text(AppLocalizations.of(context)!.leaveGroup), )) ]) ]))))); @@ -166,7 +166,7 @@ class _GroupSettingsViewState extends State { ); Widget continueButton = TextButton( style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))), - child: Text(AppLocalizations.of(context)!.deleteProfileConfirmBtn), + child: Text(AppLocalizations.of(context)!.yesLeave), onPressed: () { var profileOnion = Provider.of(context, listen: false).profileOnion; var handle = Provider.of(context, listen: false).onion; @@ -179,7 +179,7 @@ class _GroupSettingsViewState extends State { // set up the AlertDialog AlertDialog alert = AlertDialog( - title: Text(AppLocalizations.of(context)!.deleteProfileConfirmBtn), + title: Text(AppLocalizations.of(context)!.reallyLeaveThisGroupPrompt), actions: [ cancelButton, continueButton, diff --git a/lib/widgets/invitationbubble.dart b/lib/widgets/invitationbubble.dart index ea4adec..cca741b 100644 --- a/lib/widgets/invitationbubble.dart +++ b/lib/widgets/invitationbubble.dart @@ -5,6 +5,7 @@ import 'package:provider/provider.dart'; import '../main.dart'; import '../model.dart'; import 'package:intl/intl.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import '../settings.dart'; @@ -56,9 +57,8 @@ class InvitationBubbleState extends State { //todo: get group name? messageStr = "You sent an invitation for " + (isGroup ? "a group" : Provider.of(context).message ?? ""); } else { - messageStr = (isGroup ? "You have been invited to join " + (Provider.of(context).inviteNick ?? "") : "This is a contact suggestion for:") + - "\n" + - (Provider.of(context).inviteTarget ?? ""); + String joinGroup = AppLocalizations.of(context)!.inviteToGroup; + messageStr = (isGroup ? joinGroup + (Provider.of(context).inviteNick ?? "") : "This is a contact suggestion for:") + "\n" + (Provider.of(context).inviteTarget ?? ""); } var wdgMessage = Center( widthFactor: 1, @@ -85,9 +85,13 @@ class InvitationBubbleState extends State { textAlign: fromMe ? TextAlign.right : TextAlign.left), !fromMe ? SizedBox(width: 1, height: 1) - : Provider.of(context).ackd - ? Icon(Icons.check_circle_outline, color: Provider.of(context).theme.messageFromMeTextColor(), size: 12) - : Icon(Icons.hourglass_bottom_outlined, color: Provider.of(context).theme.messageFromMeTextColor(), size: 12) + : Padding( + padding: EdgeInsets.all(1.0), + child: Provider.of(context).ackd == true + ? Icon(Icons.check_circle_outline, color: Provider.of(context).theme.messageFromMeTextColor(), size: 16) + : (Provider.of(context).error == true + ? Icon(Icons.error_outline, color: Provider.of(context).theme.messageFromMeTextColor(), size: 16) + : Icon(Icons.hourglass_bottom_outlined, color: Provider.of(context).theme.messageFromMeTextColor(), size: 16))) ], )); } else if (isAccepted) { diff --git a/lib/widgets/messagebubble.dart b/lib/widgets/messagebubble.dart index 84415f3..08b1224 100644 --- a/lib/widgets/messagebubble.dart +++ b/lib/widgets/messagebubble.dart @@ -1,3 +1,4 @@ +import 'package:cwtch/widgets/malformedbubble.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../model.dart'; @@ -63,23 +64,32 @@ class MessageBubbleState extends State { textAlign: fromMe ? TextAlign.right : TextAlign.left), !fromMe ? SizedBox(width: 1, height: 1) - : Provider.of(context).ackd == true - ? Icon(Icons.check_circle_outline, color: Provider.of(context).theme.messageFromMeTextColor(), size: 12) - : (Provider.of(context).error == true - ? Icon(Icons.error_outline, color: Provider.of(context).theme.messageFromMeTextColor(), size: 12) - : Icon(Icons.hourglass_bottom_outlined, color: Provider.of(context).theme.messageFromMeTextColor(), size: 12)) + : Padding( + padding: EdgeInsets.all(1.0), + child: Provider.of(context).ackd == true + ? Icon(Icons.check_circle_outline, color: Provider.of(context).theme.messageFromMeTextColor(), size: 16) + : (Provider.of(context).error == true + ? Icon(Icons.error_outline, color: Provider.of(context).theme.messageFromMeTextColor(), size: 16) + : Icon(Icons.hourglass_bottom_outlined, color: Provider.of(context).theme.messageFromMeTextColor(), size: 16))) ], )); + var error = Provider.of(context).error; + return LayoutBuilder(builder: (context, constraints) { //print(constraints.toString()+", "+constraints.maxWidth.toString()); return RepaintBoundary( child: Container( child: Container( decoration: BoxDecoration( - color: fromMe ? Provider.of(context).theme.messageFromMeBackgroundColor() : Provider.of(context).theme.messageFromOtherBackgroundColor(), + color: error + ? malformedColor + : (fromMe ? Provider.of(context).theme.messageFromMeBackgroundColor() : Provider.of(context).theme.messageFromOtherBackgroundColor()), border: Border.all( - color: fromMe ? Provider.of(context).theme.messageFromMeBackgroundColor() : Provider.of(context).theme.messageFromOtherBackgroundColor(), width: 1), + color: error + ? malformedColor + : (fromMe ? Provider.of(context).theme.messageFromMeBackgroundColor() : Provider.of(context).theme.messageFromOtherBackgroundColor()), + width: 1), borderRadius: BorderRadius.only( topLeft: Radius.circular(borderRadiousEh), topRight: Radius.circular(borderRadiousEh), diff --git a/pubspec.lock b/pubspec.lock index 7aeaf06..9624a17 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,7 +14,7 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" async: dependency: transitive description: @@ -77,7 +77,7 @@ packages: name: dbus url: "https://pub.dartlang.org" source: hosted - version: "0.5.0" + version: "0.5.1" desktop_notifications: dependency: "direct main" description: @@ -142,7 +142,7 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "1.2.0" http: dependency: transitive description: @@ -199,6 +199,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + node_interop: + dependency: transitive + description: + name: node_interop + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + node_io: + dependency: transitive + description: + name: node_io + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" package_info_plus: dependency: "direct main" description: