Skip to content

Commit a69c4ba

Browse files
authored
fix(apps): update copies to allow easier translations management (WPB-21442) (#4422)
1 parent 6b42102 commit a69c4ba

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/SystemMessageItem.kt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -551,20 +551,23 @@ private fun SystemMessage.buildContent() = when (this) {
551551
iconTintColor = MaterialTheme.wireColorScheme.onBackground,
552552
) {
553553
val markdownTextStyle = DefaultMarkdownTextStyle.copy(normalColor = MaterialTheme.wireColorScheme.primary)
554-
val content = stringResource(
555-
id = when {
556-
isAuthorSelfUser -> R.string.label_system_message_apps_access_changed_by_self
557-
else -> R.string.label_system_message_apps_access_changed_by_other
558-
},
559-
formatArgs = arrayOf(
560-
author.asString().markdownBold(),
561-
if (isAccessEnabled) {
562-
stringResource(R.string.label_system_message_apps_access_changed_enabled)
554+
val contentResId = when {
555+
isAccessEnabled -> {
556+
if (isAuthorSelfUser) {
557+
R.string.label_system_message_apps_access_enabled_by_self
563558
} else {
564-
stringResource(R.string.label_system_message_apps_access_changed_disabled)
559+
R.string.label_system_message_apps_access_enabled_by_other
565560
}
566-
)
567-
)
561+
}
562+
else -> {
563+
if (isAuthorSelfUser) {
564+
R.string.label_system_message_apps_access_disabled_by_self
565+
} else {
566+
R.string.label_system_message_apps_access_disabled_by_other
567+
}
568+
}
569+
}
570+
val content = stringResource(id = contentResId, formatArgs = arrayOf(author.asString().markdownBold()))
568571
val footer = stringResource(R.string.label_system_message_apps_access_enabled_disclaimer)
569572
buildAnnotatedString {
570573
append(content.toMarkdownAnnotatedString())

app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/preview/PreviewSystemMessageItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ fun PreviewSystemMessageConversationMessageAppsAccessEnabled() {
478478
SystemMessageItem(
479479
message = mockMessageWithKnock.copy(
480480
messageContent = UIMessageContent.SystemMessage.ConversationAppsEnabledChanged(
481-
author = UIText.DynamicString("Barbara Cotolina"),
481+
author = UIText.DynamicString("Barbara"),
482482
isAuthorSelfUser = true,
483483
isAccessEnabled = true
484484
)

app/src/main/res/values/strings.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,9 @@
624624
<string name="conversation_details_options_tab">OPTIONS</string>
625625
<string name="conversation_details_participants_tab">PARTICIPANTS</string>
626626
<string name="conversation_details_options_group_name">GROUP NAME</string>
627-
<string name="conversation_details_conversation_admins">CONVERSATION ADMINS (%d)</string>
628-
<string name="conversation_details_conversation_members">CONVERSATION MEMBERS (%d)</string>
629-
<string name="conversation_details_conversation_apps">CONVERSATION APPS (%d)</string>
627+
<string name="conversation_details_conversation_admins">ADMINS (%d)</string>
628+
<string name="conversation_details_conversation_members">MEMBERS (%d)</string>
629+
<string name="conversation_details_conversation_apps">APPS (%d)</string>
630630
<string name="conversation_details_participants_info">This conversation has %s participants.\nUp to 500 people can join a conversation.</string>
631631
<string name="conversation_details_participants_count">%s participants</string>
632632
<string name="conversation_details_show_all_participants">Show all participants (%d)</string>
@@ -1905,9 +1905,9 @@ In group conversations, the group admin can overwrite this setting.</string>
19051905
<string name="search_results_apps_empty_description_non_team_admin">Apps are helpers that can improve your workflow. To use them, ask your team admin.</string>
19061906
<string name="search_results_apps_empty_description_disabled_for_conversation">Apps are disabled in this conversation. Enable them in the conversation options.</string>
19071907

1908-
<string name="label_system_message_apps_access_changed_enabled">enabled</string>
1909-
<string name="label_system_message_apps_access_changed_disabled">disabled</string>
1910-
<string name="label_system_message_apps_access_changed_by_self">%1$s %2$s **apps** for this conversation</string>
1911-
<string name="label_system_message_apps_access_changed_by_other">%1$s %2$s **apps** for this conversation</string>
1908+
<string name="label_system_message_apps_access_enabled_by_self">%1$s enabled **apps** for this conversation</string>
1909+
<string name="label_system_message_apps_access_disabled_by_self">%1$s disabled **apps** for this conversation</string>
1910+
<string name="label_system_message_apps_access_enabled_by_other">%1$s enabled **apps** for this conversation</string>
1911+
<string name="label_system_message_apps_access_disabled_by_other">%1$s disabled **apps** for this conversation</string>
19121912
<string name="label_system_message_apps_access_enabled_disclaimer">Added apps have access to the content of this conversation.</string>
19131913
</resources>

0 commit comments

Comments
 (0)