improve translation and notificaiton displaying

pull/531/head
Ryan Zhao 3 years ago
parent 5a5741f47b
commit 4f1093beca

@ -572,7 +572,8 @@
"DISMISS_BUTTON_TEXT" = "Dismiss";
/* Button text which opens the settings app */
"OPEN_SETTINGS_BUTTON" = "Settings";
"APN_Message" = "You've got a new message";
"APN_Message" = "You've got a new message.";
"APN_Collapsed_Messages" = "You've got %@ new messages.";
"system_mode_theme" = "System";
"dark_mode_theme" = "Dark";
"light_mode_theme" = "Light";

@ -127,11 +127,11 @@ extension UserNotificationPresenterAdaptee: NotificationPresenterAdaptee {
let numberOfNotifications: Int
if let lastRequest = notifications[notificationIdentifier], let counter = lastRequest.content.userInfo[AppNotificationUserInfoKey.threadNotificationCounter] as? Int {
numberOfNotifications = counter + 1
content.body = String(format: NotificationStrings.incomingCollapsedMessagesBody, "\(numberOfNotifications)")
} else {
numberOfNotifications = 1
}
content.userInfo[AppNotificationUserInfoKey.threadNotificationCounter] = numberOfNotifications
content.body = "\(numberOfNotifications) new messages."
} else {
trigger = nil
}

@ -50,6 +50,9 @@ public class NotificationStrings: NSObject {
@objc
static public let incomingMessageBody = NSLocalizedString("APN_Message", comment: "notification body")
@objc
static public let incomingCollapsedMessagesBody = NSLocalizedString("APN_Collapsed_Messages", comment: "collapsed notification body for background polling")
@objc
static public let incomingGroupMessageTitleFormat = NSLocalizedString("NEW_GROUP_MESSAGE_NOTIFICATION_TITLE", comment: "notification title. Embeds {{author name}} and {{group name}}")

Loading…
Cancel
Save