From dcf328e7acb5b3d35fdfcacb6d7be17d6269c1b2 Mon Sep 17 00:00:00 2001 From: Terry Yiu <963907+tyiu@users.noreply.github.com> Date: Fri, 6 Jan 2023 21:40:06 -0500 Subject: [PATCH] Fix localization bugs --- damus/Views/EditMetadataView.swift | 4 ++-- damus/Views/EventView.swift | 6 +++--- damus/en.lproj/Localizable.stringsdict | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/damus/Views/EditMetadataView.swift b/damus/Views/EditMetadataView.swift index a93cf52d..f0713347 100644 --- a/damus/Views/EditMetadataView.swift +++ b/damus/Views/EditMetadataView.swift @@ -160,9 +160,9 @@ struct EditMetadataView: View { Text("NIP-05 Verification") }, footer: { if let parts = nip05_parts { - Text(String.localizedStringWithFormat("'%@' at '%@' will be used for verification", parts.username, parts.host)) + Text("'\(parts.username)' at '\(parts.host)' will be used for verification", comment: "Description of how the nip05 identifier would be used for verification.") } else { - Text(String.localizedStringWithFormat("'%@' is an invalid nip05 identifier. It should look like an email.", nip05)) + Text("'\(nip05)' is an invalid nip05 identifier. It should look like an email.", comment: "Description of why the nip05 identifier is invalid.") } }) diff --git a/damus/Views/EventView.swift b/damus/Views/EventView.swift index 5cb5581f..014e4c8c 100644 --- a/damus/Views/EventView.swift +++ b/damus/Views/EventView.swift @@ -380,13 +380,13 @@ func reply_desc(profiles: Profiles, event: NostrEvent) -> String { 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."), othersCount, names[0], names[1]) + 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.localizedStringWithFormat("Replying to %@ & %@", names[0], names[1]) + return String(format: NSLocalizedString("Replying to %@ & %@", comment: "Label to indicate that the user is replying to 2 users."), names[0], names[1]) } 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."), othersCount, names[0]) + 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) } diff --git a/damus/en.lproj/Localizable.stringsdict b/damus/en.lproj/Localizable.stringsdict index 69fa736a..53570fc5 100644 --- a/damus/en.lproj/Localizable.stringsdict +++ b/damus/en.lproj/Localizable.stringsdict @@ -5,7 +5,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Replying to %2$@%#@others@ + Replying to %@%#@others@ others NSStringFormatSpecTypeKey @@ -23,7 +23,7 @@ replying_to_two_and_others NSStringLocalizedFormatKey - Replying to %2$@, %3$@%#@others@ + Replying to %@, %@%#@others@ others NSStringFormatSpecTypeKey