diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 0b5de9c78..cf65b9ce8 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -1,16 +1,21 @@ "Notification" = "Notification"; "a11y_delete" = "Delete"; "a11y_hide_password" = "Hide password"; +"a11y_jump_to_bottom" = "Jump to bottom"; "a11y_notifications_mentions_only" = "Mentions only"; "a11y_notifications_muted" = "Muted"; +"a11y_page_n" = "Page %1$d"; "a11y_pause" = "Pause"; "a11y_pin_field" = "PIN field"; "a11y_play" = "Play"; "a11y_poll" = "Poll"; "a11y_poll_end" = "Ended poll"; +"a11y_react_with" = "React with %1$@"; +"a11y_react_with_other_emojis" = "React with other emojis"; "a11y_read_receipts_multiple" = "Read by %1$@ and %2$@"; "a11y_read_receipts_single" = "Read by %1$@"; "a11y_read_receipts_tap_to_show_all" = "Tap to show all"; +"a11y_remove_reaction_with" = "Remove reaction with %1$@"; "a11y_send_files" = "Send files"; "a11y_show_password" = "Show password"; "a11y_start_call" = "Start a call"; @@ -33,9 +38,11 @@ "action_create" = "Create"; "action_create_a_room" = "Create a room"; "action_decline" = "Decline"; +"action_delete_poll" = "Delete Poll"; "action_disable" = "Disable"; "action_done" = "Done"; "action_edit" = "Edit"; +"action_edit_poll" = "Edit poll"; "action_enable" = "Enable"; "action_end_poll" = "End poll"; "action_enter_pin" = "Enter PIN"; @@ -87,7 +94,6 @@ "action_try_again" = "Try again"; "action_view_source" = "View source"; "action_yes" = "Yes"; -"action.edit_poll" = "Edit poll"; "common_about" = "About"; "common_acceptable_use_policy" = "Acceptable use policy"; "common_advanced_settings" = "Advanced settings"; @@ -232,8 +238,7 @@ "notification_invitation_action_join" = "Join"; "notification_invitation_action_reject" = "Reject"; "notification_invite_body" = "Invited you to chat"; -"notification_mentioned_you_body" = "%1$@ mentioned you.\n%2$@"; -"notification_mentioned_you_fallback_body" = "You have been mentioned.\n%1$@"; +"notification_mentioned_you_body" = "Mentioned you: %1$@"; "notification_new_messages" = "New Messages"; "notification_reaction_body" = "Reacted with %1$@"; "notification_room_action_mark_as_read" = "Mark as read"; @@ -370,6 +375,7 @@ "screen_create_room_public_option_title" = "Public room (anyone)"; "screen_create_room_room_name_label" = "Room name"; "screen_create_room_topic_label" = "Topic (optional)"; +"screen_edit_poll_title" = "Edit poll"; "screen_edit_profile_display_name" = "Display name"; "screen_edit_profile_display_name_placeholder" = "Your display name"; "screen_edit_profile_error" = "An unknown error was encountered and the information couldn't be changed."; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 9e1a28d2b..fdbcd674c 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -18,10 +18,16 @@ public enum L10n { } /// Hide password public static var a11yHidePassword: String { return L10n.tr("Localizable", "a11y_hide_password") } + /// Jump to bottom + public static var a11yJumpToBottom: String { return L10n.tr("Localizable", "a11y_jump_to_bottom") } /// Mentions only public static var a11yNotificationsMentionsOnly: String { return L10n.tr("Localizable", "a11y_notifications_mentions_only") } /// Muted public static var a11yNotificationsMuted: String { return L10n.tr("Localizable", "a11y_notifications_muted") } + /// Page %1$d + public static func a11yPageN(_ p1: Int) -> String { + return L10n.tr("Localizable", "a11y_page_n", p1) + } /// Pause public static var a11yPause: String { return L10n.tr("Localizable", "a11y_pause") } /// PIN field @@ -32,6 +38,12 @@ public enum L10n { public static var a11yPoll: String { return L10n.tr("Localizable", "a11y_poll") } /// Ended poll public static var a11yPollEnd: String { return L10n.tr("Localizable", "a11y_poll_end") } + /// React with %1$@ + public static func a11yReactWith(_ p1: Any) -> String { + return L10n.tr("Localizable", "a11y_react_with", String(describing: p1)) + } + /// React with other emojis + public static var a11yReactWithOtherEmojis: String { return L10n.tr("Localizable", "a11y_react_with_other_emojis") } /// Read by %1$@ and %2$@ public static func a11yReadReceiptsMultiple(_ p1: Any, _ p2: Any) -> String { return L10n.tr("Localizable", "a11y_read_receipts_multiple", String(describing: p1), String(describing: p2)) @@ -46,6 +58,10 @@ public enum L10n { } /// Tap to show all public static var a11yReadReceiptsTapToShowAll: String { return L10n.tr("Localizable", "a11y_read_receipts_tap_to_show_all") } + /// Remove reaction with %1$@ + public static func a11yRemoveReactionWith(_ p1: Any) -> String { + return L10n.tr("Localizable", "a11y_remove_reaction_with", String(describing: p1)) + } /// Send files public static var a11ySendFiles: String { return L10n.tr("Localizable", "a11y_send_files") } /// Show password @@ -90,12 +106,16 @@ public enum L10n { public static var actionCreateARoom: String { return L10n.tr("Localizable", "action_create_a_room") } /// Decline public static var actionDecline: String { return L10n.tr("Localizable", "action_decline") } + /// Delete Poll + public static var actionDeletePoll: String { return L10n.tr("Localizable", "action_delete_poll") } /// Disable public static var actionDisable: String { return L10n.tr("Localizable", "action_disable") } /// Done public static var actionDone: String { return L10n.tr("Localizable", "action_done") } /// Edit public static var actionEdit: String { return L10n.tr("Localizable", "action_edit") } + /// Edit poll + public static var actionEditPoll: String { return L10n.tr("Localizable", "action_edit_poll") } /// Enable public static var actionEnable: String { return L10n.tr("Localizable", "action_enable") } /// End poll @@ -544,15 +564,9 @@ public enum L10n { } /// Invited you to chat public static var notificationInviteBody: String { return L10n.tr("Localizable", "notification_invite_body") } - /// %1$@ mentioned you. - /// %2$@ - public static func notificationMentionedYouBody(_ p1: Any, _ p2: Any) -> String { - return L10n.tr("Localizable", "notification_mentioned_you_body", String(describing: p1), String(describing: p2)) - } - /// You have been mentioned. - /// %1$@ - public static func notificationMentionedYouFallbackBody(_ p1: Any) -> String { - return L10n.tr("Localizable", "notification_mentioned_you_fallback_body", String(describing: p1)) + /// Mentioned you: %1$@ + public static func notificationMentionedYouBody(_ p1: Any) -> String { + return L10n.tr("Localizable", "notification_mentioned_you_body", String(describing: p1)) } /// New Messages public static var notificationNewMessages: String { return L10n.tr("Localizable", "notification_new_messages") } @@ -914,6 +928,8 @@ public enum L10n { public static var screenDmDetailsUnblockAlertDescription: String { return L10n.tr("Localizable", "screen_dm_details_unblock_alert_description") } /// Unblock user public static var screenDmDetailsUnblockUser: String { return L10n.tr("Localizable", "screen_dm_details_unblock_user") } + /// Edit poll + public static var screenEditPollTitle: String { return L10n.tr("Localizable", "screen_edit_poll_title") } /// Display name public static var screenEditProfileDisplayName: String { return L10n.tr("Localizable", "screen_edit_profile_display_name") } /// Your display name @@ -1600,11 +1616,6 @@ public enum L10n { public static var testLanguageIdentifier: String { return L10n.tr("Localizable", "test_language_identifier") } /// en public static var testUntranslatedDefaultLanguageIdentifier: String { return L10n.tr("Localizable", "test_untranslated_default_language_identifier") } - - public enum Action { - /// Edit poll - public static var editPoll: String { return L10n.tr("Localizable", "action.edit_poll") } - } } // swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length // swiftlint:enable nesting type_body_length type_name vertical_whitespace_opening_braces diff --git a/NSE/Sources/NotificationContentBuilder.swift b/NSE/Sources/NotificationContentBuilder.swift index 1f1ab1914..497af9132 100644 --- a/NSE/Sources/NotificationContentBuilder.swift +++ b/NSE/Sources/NotificationContentBuilder.swift @@ -101,17 +101,8 @@ struct NotificationContentBuilder { let displayName = notificationItem.senderDisplayName ?? notificationItem.roomDisplayName let message = String(messageEventStringBuilder.buildAttributedString(for: messageType, senderDisplayName: displayName, prefixWithSenderName: false).characters) - let body: String - if notificationItem.hasMention { - if let senderDisplayName = notificationItem.senderDisplayName { - body = L10n.notificationMentionedYouBody(senderDisplayName, message) - } else { - body = L10n.notificationMentionedYouFallbackBody(message) - } - } else { - body = message - } - notification.body = body + + notification.body = notificationItem.hasMention ? L10n.notificationMentionedYouBody(message) : message switch messageType { case .image(content: let content):