Create and use UnreadCountFormatter. Fix #3892.

This commit is contained in:
Brent Simmons
2024-10-26 21:57:58 -07:00
parent 4adbd2cdec
commit eb84862379
8 changed files with 42 additions and 7 deletions

View File

@@ -26,7 +26,8 @@ class FeedTableViewCell : VibrantTableViewCell {
get {
if unreadCount > 0 {
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessiblity")
return "\(name) \(unreadCount) \(unreadLabel)"
let unreadCountString = UnreadCountFormatter.string(from: unreadCount)
return "\(name) \(unreadCountString) \(unreadLabel)"
} else {
return name
}

View File

@@ -23,7 +23,8 @@ class FeedTableViewSectionHeader: UITableViewHeaderFooterView {
get {
if unreadCount > 0 {
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessiblity")
return "\(name) \(unreadCount) \(unreadLabel) \(expandedStateMessage) "
let unreadCountString = UnreadCountFormatter.string(from: unreadCount)
return "\(name) \(unreadCountString) \(unreadLabel) \(expandedStateMessage) "
} else {
return "\(name) \(expandedStateMessage) "
}

View File

@@ -35,7 +35,7 @@ class FeedUnreadCountView : UIView {
}
var unreadCountString: String {
return unreadCount < 1 ? "" : "\(unreadCount)"
UnreadCountFormatter.string(from: unreadCount)
}
private var contentSizeIsValid = false