From 2c677ef0845b9add2e8a1a19c9d1ef172bf8aa74 Mon Sep 17 00:00:00 2001 From: Yamil Medina Date: Mon, 4 Sep 2023 11:18:17 -0300 Subject: [PATCH] fix: enable translations in plurals for failed to add and failed to send messages (WPB-3788) (#2170) --- .../conversations/MessageItemComponents.kt | 4 ++-- .../home/conversations/SystemMessageItem.kt | 10 ++++++++-- .../ui/home/conversations/model/UIMessage.kt | 6 +++++- app/src/main/res/values/strings.xml | 19 ++++++++++--------- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageItemComponents.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageItemComponents.kt index 32ac2f0d460..50487161006 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageItemComponents.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageItemComponents.kt @@ -111,7 +111,7 @@ private fun MultiUserDeliveryFailure( if (partialDeliveryFailureContent.filteredRecipientsFailure.isNotEmpty()) { Text( text = stringResource( - id = R.string.label_message_partial_delivery_participants_deliver_later, + id = R.string.label_message_partial_delivery_participants_many_deliver_later, partialDeliveryFailureContent.filteredRecipientsFailure .filter { !it.asString(resources).contentEquals(resources.getString(R.string.username_unavailable_label)) @@ -166,7 +166,7 @@ private fun SingleUserDeliveryFailure( if (partialDeliveryFailureContent.failedRecipients.isNotEmpty()) { Text( text = stringResource( - id = R.string.label_message_partial_delivery_participants_deliver_later, + id = R.string.label_message_partial_delivery_participants_one_deliver_later, partialDeliveryFailureContent.failedRecipients.joinToString(", ") { it.asString(resources).ifEmpty { resources.getString(R.string.username_unavailable_label) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/SystemMessageItem.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/SystemMessageItem.kt index d674819eb4c..4074747a087 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/SystemMessageItem.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/SystemMessageItem.kt @@ -612,8 +612,14 @@ private fun SystemMessage.MemberFailedToAdd.toFailedToAddAnnotatedText( if (isMultipleUsersFailure) failedToAddAnnotatedText.append("\n") failedToAddAnnotatedText.append( res.annotatedText( - stringResId, normalStyle, boldStyle, normalColor, boldColor, errorColor, isErrorString, - memberNames.limitUserNamesList(res, usersCount).toUserNamesListString(res) + stringResId, + normalStyle, + boldStyle, + normalColor, + boldColor, + errorColor, + isErrorString, + memberNames.limitUserNamesList(res, EXPANDABLE_THRESHOLD).toUserNamesListString(res) ) ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/UIMessage.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/UIMessage.kt index 37ffd966269..a74fb16a01b 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/UIMessage.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/UIMessage.kt @@ -434,7 +434,11 @@ sealed class UIMessageContent { val memberNames: List ) : SystemMessage( R.drawable.ic_info, - R.string.label_system_message_conversation_failed_add_members_details + if (memberNames.size > 1) { + R.string.label_system_message_conversation_failed_add_many_members_details + } else { + R.string.label_system_message_conversation_failed_add_one_member_details + } ) { val usersCount = memberNames.size } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3901b294463..cad86802269 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -53,12 +53,12 @@ %s pinged %1$d participants didn\'t get your message. %s won\'t get your message. - %s will get your message later. + %s will get your message later. + %s will get your message later. 1 participant from %2$s %1$d participants from %2$s - Try again Reset Session Session successfully reset Federated @@ -173,13 +173,13 @@ https://support.wire.com - https://support.wire.com/hc/en-us/articles/207948115-Why-was-I-notified-that-a-message-from-a-contact-was-not-received- - https://support.wire.com/hc/en-us/articles/6655706999581-What-s-new-on-Android- - https://support.wire.com/hc/en-us/articles/212053645-Like-a-message - https://support.wire.com/hc/en-us/articles/360000665277-Activate-or-deactivate-read-receipts + https://support.wire.com/hc/articles/207948115-Why-was-I-notified-that-a-message-from-a-contact-was-not-received- + https://support.wire.com/hc/articles/6655706999581-What-s-new-on-Android- + https://support.wire.com/hc/articles/212053645-Like-a-message + https://support.wire.com/hc/articles/360000665277-Activate-or-deactivate-read-receipts https://support.wire.com/hc/articles/9357718008093-Backend - https://support.wire.com/hc/en-us/articles/207693005-How-can-I-verify-my-own-devices- - https://support.wire.com/hc/en-us/articles/207692235-How-can-I-compare-key-fingerprints- + https://support.wire.com/hc/articles/207693005-How-can-I-verify-my-own-devices- + https://support.wire.com/hc/articles/207692235-How-can-I-compare-key-fingerprints- https://support.wire.com/hc/categories/4719917054365-Federation Vault @@ -588,7 +588,8 @@ %1$s started the conversation With %1$s %1$s **participants** could not be added to the group. - %1$s could not be added to the group. + %1$s could not be added to the group. + %1$s could not be added to the group. This conversation is no longer verified, as some user uses at least one device without a valid end-to-end identity certificate.