commit de778a09f6c1bbc22dfc5bc0841e5a37d2c1e942
parent f3056653db3135e34d67ea738bfbfe7ef1afb11f
Author: William Casarin <jb55@jb55.com>
Date: Mon, 20 Feb 2023 12:12:47 -0800
Revert localization fixes
It's crashing
Diffstat:
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/damus/Views/Events/ReplyDescription.swift b/damus/Views/Events/ReplyDescription.swift
@@ -32,7 +32,7 @@ func reply_desc(profiles: Profiles, event: NostrEvent) -> String {
let n = desc.others
if desc.pubkeys.count == 0 {
- return NSLocalizedString("Replying to self", comment: "Label to indicate that the user is replying to themself.")
+ return NSLocalizedString("Reply to self", comment: "Label to indicate that the user is replying to themself.")
}
let names: [String] = pubkeys.map {
@@ -40,20 +40,16 @@ func reply_desc(profiles: Profiles, event: NostrEvent) -> String {
return Profile.displayName(profile: prof, pubkey: $0)
}
- let othersCount = n - pubkeys.count
- if names.count > 1 {
- if othersCount == 0 {
- return String(format: NSLocalizedString("Replying to %@ & %@", comment: "Label to indicate that the user is replying to 2 users."), names[0], names[1])
- } else {
- return String(format: Bundle.main.localizedString(forKey: "replying_to_two_and_others", value: nil, table: nil), othersCount, names[0], names[1])
+ if names.count == 2 {
+ if n > 2 {
+ let othersCount = n - pubkeys.count
+ return String(format: NSLocalizedString("replying_to_two_and_others", comment: "Label to indicate that the user is replying to 2 users and others."), names[0], names[1], othersCount)
}
+ return String(format: NSLocalizedString("Replying to %@ & %@", comment: "Label to indicate that the user is replying to 2 users."), names[0], names[1])
}
- if othersCount == 0 {
- return String(format: NSLocalizedString("Replying to %@", comment: "Label to indicate that the user is replying to 1 user."), names[0])
- } else {
- return String(format: Bundle.main.localizedString(forKey: "replying_to_one_and_others", value: nil, table: nil), othersCount, names[0])
- }
+ let othersCount = n - pubkeys.count
+ return String(format: NSLocalizedString("replying_to_one_and_others", comment: "Label to indicate that the user is replying to 1 user and others."), names[0], othersCount)
}