From 993523cbdd85c25db7f057a9ee1173a97b773e4b Mon Sep 17 00:00:00 2001 From: Doug Date: Mon, 11 Nov 2024 12:44:38 +0000 Subject: [PATCH] Update the strings for unsupported calls. --- .../Localizations/en.lproj/Localizable.strings | 2 ++ ElementX/Sources/Generated/Strings.swift | 4 ++++ .../CallInviteRoomTimelineView.swift | 15 +++++++++------ .../Room/RoomSummary/RoomEventStringBuilder.swift | 2 +- NSE/Sources/NotificationContentBuilder.swift | 2 +- ...st_callInviteRoomTimelineView-iPad-en-GB.1.png | 4 ++-- ...t_callInviteRoomTimelineView-iPad-pseudo.1.png | 4 ++-- ...llInviteRoomTimelineView-iPhone-16-en-GB.1.png | 4 ++-- ...lInviteRoomTimelineView-iPhone-16-pseudo.1.png | 4 ++-- 9 files changed, 25 insertions(+), 16 deletions(-) diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 3b8b01bc05..2633939413 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -226,6 +226,7 @@ "common_unable_to_invite_title" = "Unable to send invite(s)"; "common_unlock" = "Unlock"; "common_unmute" = "Unmute"; +"common_unsupported_call" = "Unsupported call"; "common_unsupported_event" = "Unsupported event"; "common_username" = "Username"; "common_verification_cancelled" = "Verification cancelled"; @@ -789,6 +790,7 @@ "screen_room_timeline_add_reaction" = "Add emoji"; "screen_room_timeline_beginning_of_room" = "This is the beginning of %1$@."; "screen_room_timeline_beginning_of_room_no_name" = "This is the beginning of this conversation."; +"screen_room_timeline_legacy_call" = "Unsupported call. Ask if the caller can use to the new Element X app."; "screen_room_timeline_less_reactions" = "Show less"; "screen_room_timeline_message_copied" = "Message copied"; "screen_room_timeline_no_permission_to_post" = "You do not have permission to post to this room"; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index fa25268816..1bb831c6b8 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -512,6 +512,8 @@ internal enum L10n { internal static var commonUnlock: String { return L10n.tr("Localizable", "common_unlock") } /// Unmute internal static var commonUnmute: String { return L10n.tr("Localizable", "common_unmute") } + /// Unsupported call + internal static var commonUnsupportedCall: String { return L10n.tr("Localizable", "common_unsupported_call") } /// Unsupported event internal static var commonUnsupportedEvent: String { return L10n.tr("Localizable", "common_unsupported_event") } /// Username @@ -1926,6 +1928,8 @@ internal enum L10n { } /// This is the beginning of this conversation. internal static var screenRoomTimelineBeginningOfRoomNoName: String { return L10n.tr("Localizable", "screen_room_timeline_beginning_of_room_no_name") } + /// Unsupported call. Ask if the caller can use to the new Element X app. + internal static var screenRoomTimelineLegacyCall: String { return L10n.tr("Localizable", "screen_room_timeline_legacy_call") } /// Show less internal static var screenRoomTimelineLessReactions: String { return L10n.tr("Localizable", "screen_room_timeline_less_reactions") } /// Message copied diff --git a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/CallInviteRoomTimelineView.swift b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/CallInviteRoomTimelineView.swift index 3beab6197c..05d57448c8 100644 --- a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/CallInviteRoomTimelineView.swift +++ b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/CallInviteRoomTimelineView.swift @@ -13,12 +13,15 @@ struct CallInviteRoomTimelineView: View { let timelineItem: CallInviteRoomTimelineItem var body: some View { - Label(title: { Text(L10n.commonCallInvite) }, - icon: { CompoundIcon(\.voiceCall, size: .medium, relativeTo: .compound.bodyMD) }) - .font(.compound.bodyMD) - .foregroundColor(.compound.textSecondary) - .frame(maxWidth: .infinity, alignment: .center) - .padding() + Label { + Text(L10n.screenRoomTimelineLegacyCall) + } icon: { + CompoundIcon(\.voiceCall, size: .medium, relativeTo: .compound.bodyMD) + } + .font(.compound.bodyMD) + .foregroundColor(.compound.textSecondary) + .frame(maxWidth: .infinity, alignment: .center) + .padding() } } diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift index a5948fc4e7..1e3222a29d 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift @@ -73,7 +73,7 @@ struct RoomEventStringBuilder { } return prefix(L10n.commonPollSummary(question), with: displayName) case .callInvite: - return prefix(L10n.commonCallInvite, with: displayName) + return prefix(L10n.commonUnsupportedCall, with: displayName) case .callNotify: return prefix(L10n.commonCallStarted, with: displayName) } diff --git a/NSE/Sources/NotificationContentBuilder.swift b/NSE/Sources/NotificationContentBuilder.swift index f767a9538d..383098d176 100644 --- a/NSE/Sources/NotificationContentBuilder.swift +++ b/NSE/Sources/NotificationContentBuilder.swift @@ -131,7 +131,7 @@ struct NotificationContentBuilder { private func processCallInviteEvent(notificationItem: NotificationItemProxyProtocol, mediaProvider: MediaProviderProtocol?) async throws -> UNMutableNotificationContent { let notification = try await processCommonRoomMessage(notificationItem: notificationItem, mediaProvider: mediaProvider) - notification.body = L10n.commonCallInvite + notification.body = L10n.commonUnsupportedCall return notification } diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPad-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPad-en-GB.1.png index 8f0b1331f5..b81a7696c9 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPad-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPad-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:73e3426c1023e8174271fb1e163b85033ab1ea531881ed2a5a9f3db24ebd5598 -size 73834 +oid sha256:83c70644604dc70c886dea41fc3935e9d8d7bed388e0d57619bbdfe026c3b0c5 +size 78127 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPad-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPad-pseudo.1.png index eeefc7e2d8..a667d1bf06 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPad-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPad-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0b9c353ac087285f4b2a7ac41f032f891cccef0cc76e1ea11c562223abdfb122 -size 77179 +oid sha256:d22830f81bb98725d9e25e49814b3263269ffd6f59a0af60fe19d55e13ab1448 +size 84129 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPhone-16-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPhone-16-en-GB.1.png index 2e62a1a941..a3aa4dbc25 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPhone-16-en-GB.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPhone-16-en-GB.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f9fc5b3400d6f5ee581d283f2e38dc0a9502f66f8d912a0158c8856eee650f9 -size 33067 +oid sha256:3f9beb2df735de7ad5d2c3c187b236672813db91a987992b13e2a344c663e3cf +size 38721 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPhone-16-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPhone-16-pseudo.1.png index 59252b40da..abb75a6173 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPhone-16-pseudo.1.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_callInviteRoomTimelineView-iPhone-16-pseudo.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a08fabc8d61ef8ea8ae9e161b5c560e30eac85097823dc5077d1f32e65975cfb -size 37845 +oid sha256:7210cfeed3af08712b88d2f845118d284adf441f11f5cf03b84ea7b3d02d6205 +size 47915