diff --git a/damus.xcodeproj/project.pbxproj b/damus.xcodeproj/project.pbxproj index ae344ec1..f14f11c8 100644 --- a/damus.xcodeproj/project.pbxproj +++ b/damus.xcodeproj/project.pbxproj @@ -11,6 +11,10 @@ 3169CAE6294E69C000EE4006 /* EmptyTimelineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3169CAE5294E69C000EE4006 /* EmptyTimelineView.swift */; }; 3169CAED294FCCFC00EE4006 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3169CAEC294FCCFC00EE4006 /* Constants.swift */; }; 31D2E847295218AF006D67F8 /* Shimmer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31D2E846295218AF006D67F8 /* Shimmer.swift */; }; + 3A3040ED29A5CB86008A0F29 /* ReplyDescriptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3040EC29A5CB86008A0F29 /* ReplyDescriptionTests.swift */; }; + 3A3040EF29A8FEE9008A0F29 /* EventDetailBarTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3040EE29A8FEE9008A0F29 /* EventDetailBarTests.swift */; }; + 3A3040F129A8FF97008A0F29 /* LocalizationUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3040F029A8FF97008A0F29 /* LocalizationUtil.swift */; }; + 3A3040F329A91366008A0F29 /* ProfileViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3040F229A91366008A0F29 /* ProfileViewTests.swift */; }; 3A4325A82961E11400BFCD9D /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 3A4325AA2961E11400BFCD9D /* Localizable.stringsdict */; }; 3AA247FD297E3CFF0090C62D /* RepostsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA247FC297E3CFF0090C62D /* RepostsModel.swift */; }; 3AA247FF297E3D900090C62D /* RepostsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA247FE297E3D900090C62D /* RepostsView.swift */; }; @@ -257,6 +261,16 @@ 3A25EF142992DA5D008ABE69 /* el-GR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "el-GR"; path = "el-GR.lproj/Localizable.strings"; sourceTree = ""; }; 3A25EF152992DA5D008ABE69 /* el-GR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "el-GR"; path = "el-GR.lproj/Localizable.stringsdict"; sourceTree = ""; }; 3A2B8B0A296A8982009CC16D /* en-US */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "en-US"; path = "en-US.lproj/Localizable.stringsdict"; sourceTree = ""; }; + 3A3040EC29A5CB86008A0F29 /* ReplyDescriptionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplyDescriptionTests.swift; sourceTree = ""; }; + 3A3040EE29A8FEE9008A0F29 /* EventDetailBarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventDetailBarTests.swift; sourceTree = ""; }; + 3A3040F029A8FF97008A0F29 /* LocalizationUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizationUtil.swift; sourceTree = ""; }; + 3A3040F229A91366008A0F29 /* ProfileViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewTests.swift; sourceTree = ""; }; + 3A3040F929A91ED6008A0F29 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = "zh-HK.lproj/InfoPlist.strings"; sourceTree = ""; }; + 3A3040FA29A91EFC008A0F29 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = "zh-HK.lproj/Localizable.strings"; sourceTree = ""; }; + 3A3040FB29A91F03008A0F29 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "zh-HK"; path = "zh-HK.lproj/Localizable.stringsdict"; sourceTree = ""; }; + 3A3040FC29A91F31008A0F29 /* zh-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-TW"; path = "zh-TW.lproj/InfoPlist.strings"; sourceTree = ""; }; + 3A3040FD29A91F31008A0F29 /* zh-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "zh-TW"; path = "zh-TW.lproj/Localizable.stringsdict"; sourceTree = ""; }; + 3A3040FE29A91F31008A0F29 /* zh-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-TW"; path = "zh-TW.lproj/Localizable.strings"; sourceTree = ""; }; 3A41E559299D52BE001FA465 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/InfoPlist.strings; sourceTree = ""; }; 3A41E55A299D52BE001FA465 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Localizable.strings; sourceTree = ""; }; 3A41E55B299D52BE001FA465 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = id; path = id.lproj/Localizable.stringsdict; sourceTree = ""; }; @@ -810,6 +824,7 @@ 4C2CDDF6299D4A5E00879FD5 /* Debouncer.swift */, 7C95CAED299DCEF1009DCB67 /* KFOptionSetter+.swift */, 4CE0E2AE29A2E82100DB4CA2 /* EventHolder.swift */, + 3A3040F029A8FF97008A0F29 /* LocalizationUtil.swift */, ); path = Util; sourceTree = ""; @@ -971,6 +986,9 @@ 4CF0ABDB2981A19E00D66079 /* ListTests.swift */, 4CB883A9297612FF00DC99E7 /* ZapTests.swift */, 4CB883AD2976FA9300DC99E7 /* FormatTests.swift */, + 3A3040EC29A5CB86008A0F29 /* ReplyDescriptionTests.swift */, + 3A3040EE29A8FEE9008A0F29 /* EventDetailBarTests.swift */, + 3A3040F229A91366008A0F29 /* ProfileViewTests.swift */, ); path = damusTests; sourceTree = ""; @@ -1160,6 +1178,8 @@ id, cs, ru, + "zh-HK", + "zh-TW", ); mainGroup = 4CE6DEDA27F7A08100C66700; packageReferences = ( @@ -1289,6 +1309,7 @@ 31D2E847295218AF006D67F8 /* Shimmer.swift in Sources */, F7908E97298B1FDF00AB113A /* NIPURLBuilder.swift in Sources */, 4C285C8228385570008A31F1 /* CarouselView.swift in Sources */, + 3A3040F129A8FF97008A0F29 /* LocalizationUtil.swift in Sources */, F75BA12D29A1855400E10810 /* BookmarksManager.swift in Sources */, 4C3EA67F28FFC01D00C48A62 /* InvoiceView.swift in Sources */, 4CE8794829941DA700F758CC /* RelayFilters.swift in Sources */, @@ -1416,8 +1437,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3A3040ED29A5CB86008A0F29 /* ReplyDescriptionTests.swift in Sources */, 3ACBCB78295FE5C70037388A /* TimeAgoTests.swift in Sources */, DD597CBD2963D85A00C64D32 /* MarkdownTests.swift in Sources */, + 3A3040EF29A8FEE9008A0F29 /* EventDetailBarTests.swift in Sources */, 4C3EA67B28FF7B3900C48A62 /* InvoiceTests.swift in Sources */, 4C363A9E2828A822006E126D /* ReplyTests.swift in Sources */, 4CB883AA297612FF00DC99E7 /* ZapTests.swift in Sources */, @@ -1427,6 +1450,7 @@ 4C90BD1C283AC38E008EE7EF /* Bech32Tests.swift in Sources */, 50A50A8D29A09E1C00C01BE7 /* RequestTests.swift in Sources */, 4CE6DEF827F7A08200C66700 /* damusTests.swift in Sources */, + 3A3040F329A91366008A0F29 /* ProfileViewTests.swift in Sources */, 4CF0ABDC2981A19E00D66079 /* ListTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1476,6 +1500,8 @@ 3A41E55B299D52BE001FA465 /* id */, 3A8624DB299E82BE00BD8BE9 /* cs */, 3A827A1A299FC69D00C4D171 /* ru */, + 3A3040FB29A91F03008A0F29 /* zh-HK */, + 3A3040FD29A91F31008A0F29 /* zh-TW */, ); name = Localizable.stringsdict; sourceTree = ""; @@ -1499,6 +1525,8 @@ 3A41E559299D52BE001FA465 /* id */, 3A8624D9299E82BE00BD8BE9 /* cs */, 3A827A18299FC69D00C4D171 /* ru */, + 3A3040F929A91ED6008A0F29 /* zh-HK */, + 3A3040FC29A91F31008A0F29 /* zh-TW */, ); name = InfoPlist.strings; sourceTree = ""; @@ -1522,6 +1550,8 @@ 3A41E55A299D52BE001FA465 /* id */, 3A8624DA299E82BE00BD8BE9 /* cs */, 3A827A19299FC69D00C4D171 /* ru */, + 3A3040FA29A91EFC008A0F29 /* zh-HK */, + 3A3040FE29A91F31008A0F29 /* zh-TW */, ); name = Localizable.strings; sourceTree = ""; diff --git a/damus/Components/ZapButton.swift b/damus/Components/ZapButton.swift index 36c3ea23..d96b44a9 100644 --- a/damus/Components/ZapButton.swift +++ b/damus/Components/ZapButton.swift @@ -109,10 +109,12 @@ struct ZapButton: View { } } .accessibilityLabel(NSLocalizedString("Zap", comment: "Accessibility label for zap button")) - - Text(String("\(bar.zap_total > 0 ? "\(format_msats_abbrev(bar.zap_total))" : "")")) - .font(.footnote) - .foregroundColor(bar.zapped ? Color.orange : Color.gray) + + if bar.zap_total > 0 { + Text(verbatim: format_msats_abbrev(bar.zap_total)) + .font(.footnote) + .foregroundColor(bar.zapped ? Color.orange : Color.gray) + } } .sheet(isPresented: $showing_select_wallet, onDismiss: {showing_select_wallet = false}) { SelectWalletView(showingSelectWallet: $showing_select_wallet, our_pubkey: damus_state.pubkey, invoice: invoice) diff --git a/damus/ContentView.swift b/damus/ContentView.swift index f3416eae..c255e841 100644 --- a/damus/ContentView.swift +++ b/damus/ContentView.swift @@ -166,7 +166,7 @@ struct ContentView: View { Text("Universe 🛸", comment: "Toolbar label for the universal view where posts from all connected relay servers appear.") .bold() case .none: - Text("", comment: "Toolbar label for unknown views. This label would be displayed only if a new timeline view is added but a toolbar label was not explicitly assigned to it yet.") + Text(verbatim: "") } } } diff --git a/damus/Models/Mentions.swift b/damus/Models/Mentions.swift index 445bb707..fb408840 100644 --- a/damus/Models/Mentions.swift +++ b/damus/Models/Mentions.swift @@ -263,17 +263,19 @@ func format_msats_abbrev(_ msats: Int64) -> String { return formatter.string(from: sats) ?? sats.stringValue } -func format_msats(_ msat: Int64) -> String { +func format_msats(_ msat: Int64, locale: Locale = Locale.current) -> String { let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .decimal numberFormatter.minimumFractionDigits = 0 numberFormatter.maximumFractionDigits = 3 numberFormatter.roundingMode = .down + numberFormatter.locale = locale let sats = NSNumber(value: (Double(msat) / 1000.0)) let formattedSats = numberFormatter.string(from: sats) ?? sats.stringValue - return String(format: Bundle.main.localizedString(forKey: "sats_count", value: nil, table: nil), sats.decimalValue as NSDecimalNumber, formattedSats) + let bundle = bundleForLocale(locale: locale) + return String(format: bundle.localizedString(forKey: "sats_count", value: nil, table: nil), locale: locale, sats.decimalValue as NSDecimalNumber, formattedSats) } func convert_invoice_block(_ b: invoice_block) -> Block? { diff --git a/damus/Util/LocalizationUtil.swift b/damus/Util/LocalizationUtil.swift new file mode 100644 index 00000000..de496d60 --- /dev/null +++ b/damus/Util/LocalizationUtil.swift @@ -0,0 +1,19 @@ +// +// LocalizationUtil.swift +// damus +// +// Created by Terry Yiu on 2/24/23. +// + +import Foundation + +func bundleForLocale(locale: Locale) -> Bundle { + let path = Bundle.main.path(forResource: locale.identifier, ofType: "lproj") + return path != nil ? (Bundle(path: path!) ?? Bundle.main) : Bundle.main +} + +func formatInt(_ int: Int) -> String { + let numberFormatter = NumberFormatter() + numberFormatter.numberStyle = .decimal + return numberFormatter.string(from: NSNumber(integerLiteral: int)) ?? "\(int)" +} diff --git a/damus/Util/TimeAgo.swift b/damus/Util/TimeAgo.swift index 70626fb2..15917cbd 100644 --- a/damus/Util/TimeAgo.swift +++ b/damus/Util/TimeAgo.swift @@ -50,5 +50,6 @@ public func time_ago_since(_ date: Date, _ calendar: Calendar = Calendar.current return formatter.string(from: DateComponents(calendar: calendar, second: second))! } - return NSLocalizedString("now", comment: "String indicating that a given timestamp just occurred") + let bundle = bundleForLocale(locale: calendar.locale ?? Locale.current) + return NSLocalizedString("now", bundle: bundle, comment: "String indicating that a given timestamp just occurred") } diff --git a/damus/Views/ActionBar/EventDetailBar.swift b/damus/Views/ActionBar/EventDetailBar.swift index f4180706..c9005855 100644 --- a/damus/Views/ActionBar/EventDetailBar.swift +++ b/damus/Views/ActionBar/EventDetailBar.swift @@ -26,14 +26,18 @@ struct EventDetailBar: View { HStack { if bar.boosts > 0 { NavigationLink(destination: RepostsView(damus_state: state, model: RepostsModel(state: state, target: target))) { - Text("\(Text(verbatim: "\(bar.boosts)").font(.body.bold())) \(Text(String(format: Bundle.main.localizedString(forKey: "reposts_count", value: nil, table: nil), bar.boosts)).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many reposts. In source English, the first variable is the number of reposts, and the second variable is 'Repost' or 'Reposts'.") + let count = Text(verbatim: "\(formatInt(bar.boosts))").font(.body.bold()) + let noun = Text(verbatim: "\(repostsCountString(bar.boosts))").foregroundColor(.gray) + Text("\(count) \(noun)", comment: "Sentence composed of 2 variables to describe how many reposts. In source English, the first variable is the number of reposts, and the second variable is 'Repost' or 'Reposts'.") } .buttonStyle(PlainButtonStyle()) } if bar.likes > 0 { NavigationLink(destination: ReactionsView(damus_state: state, model: ReactionsModel(state: state, target: target))) { - Text("\(Text(verbatim: "\(bar.likes)").font(.body.bold())) \(Text(String(format: Bundle.main.localizedString(forKey: "reactions_count", value: nil, table: nil), bar.likes)).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many reactions there are on a post. In source English, the first variable is the number of reactions, and the second variable is 'Reaction' or 'Reactions'.") + let count = Text(verbatim: "\(formatInt(bar.likes))").font(.body.bold()) + let noun = Text(verbatim: "\(reactionsCountString(bar.likes))").foregroundColor(.gray) + Text("\(count) \(noun)", comment: "Sentence composed of 2 variables to describe how many reactions there are on a post. In source English, the first variable is the number of reactions, and the second variable is 'Reaction' or 'Reactions'.") } .buttonStyle(PlainButtonStyle()) } @@ -41,7 +45,9 @@ struct EventDetailBar: View { if bar.zaps > 0 { let dst = ZapsView(state: state, target: .note(id: target, author: target_pk)) NavigationLink(destination: dst) { - Text("\(Text(verbatim: "\(bar.zaps)").font(.body.bold())) \(Text(String(format: Bundle.main.localizedString(forKey: "zaps_count", value: nil, table: nil), bar.zaps)).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many zap payments there are on a post. In source English, the first variable is the number of zap payments, and the second variable is 'Zap' or 'Zaps'.") + let count = Text(verbatim: "\(formatInt(bar.zaps))").font(.body.bold()) + let noun = Text(verbatim: "\(zapsCountString(bar.zaps))").foregroundColor(.gray) + Text("\(count) \(noun)", comment: "Sentence composed of 2 variables to describe how many zap payments there are on a post. In source English, the first variable is the number of zap payments, and the second variable is 'Zap' or 'Zaps'.") } .buttonStyle(PlainButtonStyle()) } @@ -49,6 +55,21 @@ struct EventDetailBar: View { } } +func repostsCountString(_ count: Int, locale: Locale = Locale.current) -> String { + let bundle = bundleForLocale(locale: locale) + return String(format: bundle.localizedString(forKey: "reposts_count", value: nil, table: nil), locale: locale, count) +} + +func reactionsCountString(_ count: Int, locale: Locale = Locale.current) -> String { + let bundle = bundleForLocale(locale: locale) + return String(format: bundle.localizedString(forKey: "reactions_count", value: nil, table: nil), locale: locale, count) +} + +func zapsCountString(_ count: Int, locale: Locale = Locale.current) -> String { + let bundle = bundleForLocale(locale: locale) + return String(format: bundle.localizedString(forKey: "zaps_count", value: nil, table: nil), locale: locale, count) +} + struct EventDetailBar_Previews: PreviewProvider { static var previews: some View { EventDetailBar(state: test_damus_state(), target: "", target_pk: "") diff --git a/damus/Views/ConfigView.swift b/damus/Views/ConfigView.swift index f2adb061..a246a8ca 100644 --- a/damus/Views/ConfigView.swift +++ b/damus/Views/ConfigView.swift @@ -220,10 +220,10 @@ struct ConfigView: View { } } - let bundleShortVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String - let bundleVersion = Bundle.main.infoDictionary?["CFBundleVersion"] as! String - Section(NSLocalizedString("Version", comment: "Section title for displaying the version number of the Damus app.")) { - Text(verbatim: "\(bundleShortVersion) (\(bundleVersion))") + if let bundleShortVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"], let bundleVersion = Bundle.main.infoDictionary?["CFBundleVersion"] { + Section(NSLocalizedString("Version", comment: "Section title for displaying the version number of the Damus app.")) { + Text(verbatim: "\(bundleShortVersion) (\(bundleVersion))") + } } } } diff --git a/damus/Views/EventDetailView.swift b/damus/Views/EventDetailView.swift index d8654392..18999bee 100644 --- a/damus/Views/EventDetailView.swift +++ b/damus/Views/EventDetailView.swift @@ -23,7 +23,7 @@ func scroll_after_load(thread: ThreadModel, proxy: ScrollViewProxy) { struct EventDetailView_Previews: PreviewProvider { static var previews: some View { - let state = test_damus_state() + let _ = test_damus_state() EventDetailView() } } diff --git a/damus/Views/Events/EventMenu.swift b/damus/Views/Events/EventMenu.swift index da375fbc..57228d91 100644 --- a/damus/Views/Events/EventMenu.swift +++ b/damus/Views/Events/EventMenu.swift @@ -48,7 +48,7 @@ struct EventMenuContext: View { } label: { let imageName = isBookmarked ? "bookmark.fill" : "bookmark" let unBookmarkString = NSLocalizedString("Un-Bookmark", comment: "Context menu option for un-bookmarking a note") - let bookmarkString = NSLocalizedString("Bookmark", comment: "Context menu optoin for bookmarking a note") + let bookmarkString = NSLocalizedString("Bookmark", comment: "Context menu option for bookmarking a note") Label(isBookmarked ? unBookmarkString : bookmarkString, systemImage: imageName) } .onAppear { diff --git a/damus/Views/Events/ReplyDescription.swift b/damus/Views/Events/ReplyDescription.swift index 7e130d62..fa8f471a 100644 --- a/damus/Views/Events/ReplyDescription.swift +++ b/damus/Views/Events/ReplyDescription.swift @@ -26,13 +26,15 @@ struct ReplyDescription_Previews: PreviewProvider { } } -func reply_desc(profiles: Profiles, event: NostrEvent) -> String { +func reply_desc(profiles: Profiles, event: NostrEvent, locale: Locale = Locale.current) -> String { let desc = make_reply_description(event.tags) let pubkeys = desc.pubkeys let n = desc.others + let bundle = bundleForLocale(locale: locale) + if desc.pubkeys.count == 0 { - return NSLocalizedString("Replying to self", comment: "Label to indicate that the user is replying to themself.") + return NSLocalizedString("Replying to self", bundle: bundle, comment: "Label to indicate that the user is replying to themself.") } let names: [String] = pubkeys.map { @@ -40,20 +42,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 { + let othersCount = n - pubkeys.count if othersCount == 0 { - return String(format: "Replying to %@ & %@", names[0], names[1]) + return String(format: NSLocalizedString("Replying to %@ & %@", bundle: bundle, comment: "Label to indicate that the user is replying to 2 users."), locale: locale, names[0], names[1]) } else { - return String(format: "Replying to %@, %@ & %d others", names[0], names[1], othersCount) + return String(format: bundle.localizedString(forKey: "replying_to_two_and_others", value: nil, table: nil), locale: locale, othersCount, names[0], names[1]) } } - if othersCount == 0 { - return String(format: "Replying to %@", names[0]) - } else { - return String(format: "Replying to %@ & %d others", names[0], othersCount) - } + return String(format: NSLocalizedString("Replying to %@", bundle: bundle, comment: "Label to indicate that the user is replying to 1 user."), locale: locale, names[0]) } diff --git a/damus/Views/FollowButtonView.swift b/damus/Views/FollowButtonView.swift index d79a17de..1e96c34c 100644 --- a/damus/Views/FollowButtonView.swift +++ b/damus/Views/FollowButtonView.swift @@ -19,7 +19,7 @@ struct FollowButtonView: View { Button { follow_state = perform_follow_btn_action(follow_state, target: target) } label: { - Text(follow_btn_txt(follow_state, follows_you: follows_you)) + Text(verbatim: "\(follow_btn_txt(follow_state, follows_you: follows_you))") .frame(width: 105, height: 30) //.padding(.vertical, 10) .font(.caption.weight(.bold)) diff --git a/damus/Views/FollowingView.swift b/damus/Views/FollowingView.swift index 4628b2ce..41e9bfc6 100644 --- a/damus/Views/FollowingView.swift +++ b/damus/Views/FollowingView.swift @@ -29,7 +29,6 @@ struct FollowersView: View { @EnvironmentObject var followers: FollowersModel var body: some View { - let profile = damus_state.profiles.lookup(id: whos) ScrollView { LazyVStack(alignment: .leading) { ForEach(followers.contacts ?? [], id: \.self) { pk in @@ -38,7 +37,7 @@ struct FollowersView: View { } .padding() } - .navigationBarTitle(NSLocalizedString("\(Profile.displayName(profile: profile, pubkey: whos))'s Followers", comment: "Navigation bar title for view that shows who is following a user.")) + .navigationBarTitle(NSLocalizedString("Followers", comment: "Navigation bar title for view that shows who is following a user.")) .onAppear { followers.subscribe() } @@ -56,8 +55,6 @@ struct FollowingView: View { let whos: String var body: some View { - let profile = damus_state.profiles.lookup(id: whos) - let who = Profile.displayName(profile: profile, pubkey: whos) ScrollView { LazyVStack(alignment: .leading) { ForEach(following.contacts, id: \.self) { pk in @@ -72,7 +69,7 @@ struct FollowingView: View { .onDisappear { following.unsubscribe() } - .navigationBarTitle(NSLocalizedString("\(who) following", comment: "Navigation bar title for view that shows who a user is following.")) + .navigationBarTitle(NSLocalizedString("Following", comment: "Navigation bar title for view that shows who a user is following.")) } } diff --git a/damus/Views/ProfileName.swift b/damus/Views/ProfileName.swift index 9e8d6be8..dfabc9d5 100644 --- a/damus/Views/ProfileName.swift +++ b/damus/Views/ProfileName.swift @@ -67,7 +67,7 @@ struct ProfileName: View { var body: some View { HStack(spacing: 2) { - Text(prefix + String(display_name ?? Profile.displayName(profile: profile, pubkey: pubkey))) + Text(verbatim: "\(prefix)\(String(display_name ?? Profile.displayName(profile: profile, pubkey: pubkey)))") .font(.body) .fontWeight(prefix == "@" ? .none : .bold) if let nip05 = current_nip05 { @@ -136,11 +136,11 @@ struct EventProfileName: View { .font(.body.weight(.bold)) .padding([.trailing], 2) - Text("@" + String(display_name ?? Profile.displayName(profile: profile, pubkey: pubkey))) + Text(verbatim: "@\(display_name ?? Profile.displayName(profile: profile, pubkey: pubkey))") .foregroundColor(Color("DamusMediumGrey")) .font(eventviewsize_to_font(size)) } else { - Text(String(display_name ?? Profile.displayName(profile: profile, pubkey: pubkey))) + Text(verbatim: "\(display_name ?? Profile.displayName(profile: profile, pubkey: pubkey))") .font(eventviewsize_to_font(size)) .fontWeight(.bold) } diff --git a/damus/Views/ProfileView.swift b/damus/Views/ProfileView.swift index 9828b207..dc7e03ca 100644 --- a/damus/Views/ProfileView.swift +++ b/damus/Views/ProfileView.swift @@ -49,6 +49,16 @@ func follow_btn_enabled_state(_ fs: FollowState) -> Bool { } } +func followersCountString(_ count: Int, locale: Locale = Locale.current) -> String { + let bundle = bundleForLocale(locale: locale) + return String(format: bundle.localizedString(forKey: "followers_count", value: nil, table: nil), locale: locale, count) +} + +func relaysCountString(_ count: Int, locale: Locale = Locale.current) -> String { + let bundle = bundleForLocale(locale: locale) + return String(format: bundle.localizedString(forKey: "relays_count", value: nil, table: nil), locale: locale, count) +} + struct EditButton: View { let damus_state: DamusState @@ -319,7 +329,9 @@ struct ProfileView: View { .foregroundColor(.gray) } else { let followerCount = followers.count! - Text("\(Text(verbatim: "\(followerCount)").font(.subheadline.weight(.medium))) \(Text(String(format: Bundle.main.localizedString(forKey: "followers_count", value: nil, table: nil), followerCount)).font(.subheadline).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many people are following a user. In source English, the first variable is the number of followers, and the second variable is 'Follower' or 'Followers'.") + let count_text = Text(verbatim: "\(formatInt(followerCount))").font(.subheadline.weight(.medium)) + let noun_text = Text(verbatim: "\(followersCountString(followerCount))").font(.subheadline).foregroundColor(.gray) + Text("\(count_text) \(noun_text)", comment: "Sentence composed of 2 variables to describe how many people are following a user. In source English, the first variable is the number of followers, and the second variable is 'Follower' or 'Followers'.") } } } @@ -343,7 +355,9 @@ struct ProfileView: View { let following_model = FollowingModel(damus_state: damus_state, contacts: contacts) NavigationLink(destination: FollowingView(damus_state: damus_state, following: following_model, whos: profile.pubkey)) { HStack { - Text("\(Text(verbatim: "\(profile.following)").font(.subheadline.weight(.medium))) \(Text("Following", comment: "Part of a larger sentence to describe how many profiles a user is following.").font(.subheadline).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many profiles a user is following. In source English, the first variable is the number of profiles being followed, and the second variable is 'Following'.") + let count_text = Text(verbatim: "\(formatInt(profile.following))").font(.subheadline.weight(.medium)) + let noun_text = Text("Following", comment: "Text on the user profile page next to the number of accounts a user is following.").font(.subheadline).foregroundColor(.gray) + Text("\(count_text) \(noun_text)", comment: "Sentence composed of 2 variables to describe how many profiles a user is following. In source English, the first variable is the number of profiles being followed, and the second variable is 'Following'.") } } .buttonStyle(PlainButtonStyle()) @@ -366,7 +380,9 @@ struct ProfileView: View { if let relays = profile.relays { // Only open relay config view if the user is logged in with private key and they are looking at their own profile. - let relay_text = Text("\(Text(verbatim: "\(relays.keys.count)").font(.subheadline.weight(.medium))) \(Text(String(format: Bundle.main.localizedString(forKey: "relays_count", value: nil, table: nil), relays.keys.count)).font(.subheadline).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many relay servers a user is connected. In source English, the first variable is the number of relay servers, and the second variable is 'Relay' or 'Relays'.") + let count_text = Text(verbatim: "\(formatInt(relays.keys.count))").font(.subheadline.weight(.medium)) + let noun_text = Text(verbatim: "\(relaysCountString(relays.keys.count))").font(.subheadline).foregroundColor(.gray) + let relay_text = Text("\(count_text) \(noun_text)", comment: "Sentence composed of 2 variables to describe how many relay servers a user is connected. In source English, the first variable is the number of relay servers, and the second variable is 'Relay' or 'Relays'.") if profile.pubkey == damus_state.pubkey && damus_state.is_privkey_user { NavigationLink(destination: RelayConfigView(state: damus_state)) { relay_text @@ -506,7 +522,7 @@ struct KeyView: View { .symbolRenderingMode(.palette) } .padding(.leading,4) - Text(abbrev_pubkey(bech32, amount: 16)) + Text(verbatim: "\(abbrev_pubkey(bech32, amount: 16))") .font(.footnote) .foregroundColor(keyColor()) } diff --git a/damus/Views/Timeline/LoadMoreButton.swift b/damus/Views/Timeline/LoadMoreButton.swift index d98ffdae..cda930e4 100644 --- a/damus/Views/Timeline/LoadMoreButton.swift +++ b/damus/Views/Timeline/LoadMoreButton.swift @@ -23,7 +23,7 @@ struct LoadMoreButton: View { Group { if events.queued > 0 { Button(action: click) { - Text("Load \(events.queued) more") + Text("Load \(events.queued) more", comment: "Button text for loading more events, where the variable is the number of events.") } .font(.system(size: 14, weight: .bold)) .padding(10) diff --git a/damus/ar.lproj/InfoPlist.strings b/damus/ar.lproj/InfoPlist.strings index 8e309fb5..3841fdae 100644 Binary files a/damus/ar.lproj/InfoPlist.strings and b/damus/ar.lproj/InfoPlist.strings differ diff --git a/damus/ar.lproj/Localizable.strings b/damus/ar.lproj/Localizable.strings index 5939d083..4dc7b225 100644 Binary files a/damus/ar.lproj/Localizable.strings and b/damus/ar.lproj/Localizable.strings differ diff --git a/damus/ar.lproj/Localizable.stringsdict b/damus/ar.lproj/Localizable.stringsdict index 6f616cae..d2bba902 100644 --- a/damus/ar.lproj/Localizable.stringsdict +++ b/damus/ar.lproj/Localizable.stringsdict @@ -4,51 +4,51 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - %d منشورات اضافية - many - %d منشورات اضافية - one - %d منشور اضافي - other - %d منشورات اضافية - two - %d منشوران zero - %d منشورات أخرى + ... %d منشورات أخرى ... + one + ... %d منشور اضافي ... + two + ... %d منشوران ... + few + ... %d منشورات اضافية ... + many + ... %d منشورات اضافية ... + other + ... %d منشورات اضافية ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - المتابعون - many - المتابعون - one - متابع - other - المتابعون - two - متابعان zero متابع + one + متابع + two + متابعان + few + المتابِعون + many + المتابِعون + other + المتابِعون - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -60,18 +60,18 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + zero + تفاعل + one + تفاعل + two + تفاعلان few تفاعلات many تفاعل - one - تفاعل other تفاعل - two - تفاعل - zero - تفاعل relays_count @@ -84,66 +84,66 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + zero + موصّل + one + موصّل + two + موصّلان few موصّلات many - موصّلات - one - موصّل + موصّل other - موصّلات - two - موصّلان - zero موصّل replying_to_one_and_others NSStringLocalizedFormatKey - رد على %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d آخرون - many - & %d آخرون - one - & %d آخر - other - & %d آخرين - two - & %d آخران zero - + رد على %2$@ + one + الرد على %2$@ & %1$d آخر + two + الرد على %2$@ & %1$d آخرين + few + الرد على %2$@ & %1$d آخرين + many + الرد على %2$@ & %1$d آخرين + other + الرد على %2$@ & %1$d آخرين replying_to_two_and_others NSStringLocalizedFormatKey - رد على%@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d آخرون - many - & %d آخرون - one - & %d آخر - other - & %d آخرين - two - & %d آخران zero - + الرد على %2$@, %3$@ & %1$d others + one + الرد على %2$@, %3$@ & %1$d آخر + two + الرد على %2$@, %3$@ & %1$d آخرين + few + الرد على %2$@, %3$@ & %1$d آخرين + many + الرد على %2$@, %3$@ & %1$d آخرين + other + الرد على %2$@, %3$@ & %1$d آخرين reposts_count @@ -156,18 +156,18 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d - few - اعادات نشر - many + zero اعادات نشر one اعادة نشر - other - اعادات نشر two + اعادتا نشر + few اعادات نشر - zero - اعادات نشر + many + اعادة نشر + other + اعادة نشر sats_count @@ -180,18 +180,18 @@ NSStringPluralRuleType NSStringFormatValueTypeKey @ + zero + %2$@ ساتوشي + one + %2$@ ساتوشي + two + %2$@ ساتوشي few %2$@ ساتوشي many %2$@ ساتوشي - one - %2$@ ساتوشي other %2$@ ساتوشي - two - %2$@ ساتوشي - zero - %2$@ ساتوشي zaps_count @@ -204,18 +204,18 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d - few - وميض - many + zero وميض one ومضة - other - وميض two - وميض - zero - وميض + ومضتان + few + ومضات + many + ومضة + other + ومضة diff --git a/damus/cs.lproj/InfoPlist.strings b/damus/cs.lproj/InfoPlist.strings index 935ad617..192eda4c 100644 Binary files a/damus/cs.lproj/InfoPlist.strings and b/damus/cs.lproj/InfoPlist.strings differ diff --git a/damus/cs.lproj/Localizable.strings b/damus/cs.lproj/Localizable.strings index 730fa87c..6a8ba2d8 100644 Binary files a/damus/cs.lproj/Localizable.strings and b/damus/cs.lproj/Localizable.strings differ diff --git a/damus/cs.lproj/Localizable.stringsdict b/damus/cs.lproj/Localizable.stringsdict index ff34d940..5711b13a 100644 --- a/damus/cs.lproj/Localizable.stringsdict +++ b/damus/cs.lproj/Localizable.stringsdict @@ -4,43 +4,43 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - %d other notes - many - %d other notes one - %d jiná poznámka + ... %d jiná poznámka ... + few + ... %d other notes ... + many + ... %d other notes ... other - %d jiné poznámky + ... %d jiné poznámky ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Seguidor few Followers many Followers - one - Seguidor other Sledují - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -52,12 +52,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Reakce few Reactions many Reactions - one - Reakce other Reakce @@ -72,12 +72,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Relé few Relays many Relays - one - Relé other Relé @@ -85,45 +85,41 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Odpověď na %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d others - many - & %d others one - a %d další + Odpověď na %2$@ a %1$d další + few + Odpověď na %2$@ a %1$d others + many + Odpověď na %2$@ a %1$d others other - a %d další - zero - + Odpověď na %2$@ a %1$d další replying_to_two_and_others NSStringLocalizedFormatKey - Odpovědět na %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d others - many - & %d others one - a %d další + Odpovědět na %2$@, %3$@ & %1$d další + few + Odpovědět na %2$@, %3$@ & %1$d others + many + Odpovědět na %2$@, %3$@ & %1$d others other - a %d další - zero - + Odpovědět na %2$@, %3$@ & %1$d další reposts_count @@ -136,12 +132,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Přesdílet few Reposts many Reposts - one - Přesdílet other Přesdílené @@ -156,12 +152,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey @ + one + %2$@ sat few %2$@ sats many %2$@ sats - one - %2$@ sat other %2$@ satů @@ -176,12 +172,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Zap few Zaps many Zaps - one - Zap other Zapů diff --git a/damus/de.lproj/InfoPlist.strings b/damus/de.lproj/InfoPlist.strings index 9bff2e1a..ab356d91 100644 Binary files a/damus/de.lproj/InfoPlist.strings and b/damus/de.lproj/InfoPlist.strings differ diff --git a/damus/de.lproj/Localizable.strings b/damus/de.lproj/Localizable.strings index 68a8ec24..b0eb6fc0 100644 Binary files a/damus/de.lproj/Localizable.strings and b/damus/de.lproj/Localizable.strings differ diff --git a/damus/de.lproj/Localizable.stringsdict b/damus/de.lproj/Localizable.stringsdict index 8bede21a..0cf15cc3 100644 --- a/damus/de.lproj/Localizable.stringsdict +++ b/damus/de.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,15 +13,15 @@ NSStringFormatValueTypeKey d one - %d andere Notiz + ... %d andere Notiz ... other - %d andere Notizen + ... %d andere Notizen ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -31,8 +33,6 @@ other Follower - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -69,7 +69,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Antwort an %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -77,17 +77,15 @@ NSStringFormatValueTypeKey d one - & %d andere + Antwort an %2$@ & %1$d andere other - & %d andere - zero - + Antwort an %2$@ & %1$d andere replying_to_two_and_others NSStringLocalizedFormatKey - Antwort an %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -95,11 +93,9 @@ NSStringFormatValueTypeKey d one - & %d andere + Antwort an %2$@, %3$@ & %1$d andere other - & %d andere - zero - + Antwort an %2$@, %3$@ & %1$d andere reposts_count diff --git a/damus/el-GR.lproj/InfoPlist.strings b/damus/el-GR.lproj/InfoPlist.strings index 59d7f996..91d408c9 100644 Binary files a/damus/el-GR.lproj/InfoPlist.strings and b/damus/el-GR.lproj/InfoPlist.strings differ diff --git a/damus/el-GR.lproj/Localizable.strings b/damus/el-GR.lproj/Localizable.strings index 19ee5ec0..16534267 100644 Binary files a/damus/el-GR.lproj/Localizable.strings and b/damus/el-GR.lproj/Localizable.strings differ diff --git a/damus/el-GR.lproj/Localizable.stringsdict b/damus/el-GR.lproj/Localizable.stringsdict index dab971b4..41ced9e5 100644 --- a/damus/el-GR.lproj/Localizable.stringsdict +++ b/damus/el-GR.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,15 +13,15 @@ NSStringFormatValueTypeKey d one - %d άλλη σημείωση + ... %d άλλη σημείωση ... other - %d άλλες σημειώσεις + ... %d άλλες σημειώσεις ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -31,8 +33,6 @@ other Ακόλουθοι - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -69,7 +69,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Απάντηση προς %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -77,17 +77,15 @@ NSStringFormatValueTypeKey d one - & %d άλλον + Replying to %2$@ & %1$d other other - & %d άλλους - zero - + Replying to %2$@ & %1$d others replying_to_two_and_others NSStringLocalizedFormatKey - Απάντηση προς %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -95,11 +93,9 @@ NSStringFormatValueTypeKey d one - & %d άλλον + Απάντηση προς %2$@, %3$@ & %1$d άλλον other - & %d άλλους - zero - + Απάντηση προς %2$@, %3$@ & %1$d άλλους reposts_count diff --git a/damus/en-US.lproj/Localizable.stringsdict b/damus/en-US.lproj/Localizable.stringsdict index 4441ecbf..21ef04ab 100644 --- a/damus/en-US.lproj/Localizable.stringsdict +++ b/damus/en-US.lproj/Localizable.stringsdict @@ -66,22 +66,6 @@ Relays - replying_to_one_and_others - - NSStringLocalizedFormatKey - %#@OTHERS@ - OTHERS - - NSStringFormatSpecTypeKey - NSStringPluralRuleType - NSStringFormatValueTypeKey - d - one - Replying to %2$@ & %1$d other - other - Replying to %2$@ & %1$d others - - replying_to_two_and_others NSStringLocalizedFormatKey diff --git a/damus/en-US.xcloc/Localized Contents/en-US.xliff b/damus/en-US.xcloc/Localized Contents/en-US.xliff index 778e5c73..e9a01b82 100644 --- a/damus/en-US.xcloc/Localized Contents/en-US.xliff +++ b/damus/en-US.xcloc/Localized Contents/en-US.xliff @@ -73,16 +73,6 @@ Sentence composed of 2 variables to describe how many people are following a use '%@' is an invalid NIP-05 identifier. It should look like an email. Description of why the nip05 identifier is invalid. - - (Profile.displayName(profile: profile, pubkey: whos))'s Followers - (Profile.displayName(profile: profile, pubkey: whos))'s Followers - Navigation bar title for view that shows who is following a user. - - - (who) following - (who) following - Navigation bar title for view that shows who a user is following. - API Key (optional) API Key (optional) @@ -211,6 +201,17 @@ Sentence composed of 2 variables to describe how many people are following a use Blue Wallet Dropdown option label for Lightning wallet, Blue Wallet. + + Bookmark + Bookmark + Context menu option for bookmarking a note + + + Bookmarks + Bookmarks + Sidebar menu label for Bookmarks view. + Title of bookmarks view + Boosts Boosts @@ -247,6 +248,11 @@ Sentence composed of 2 variables to describe how many people are following a use Clear Button for clearing cached data. + + Clear All + Clear All + Button for clearing bookmarks data. + Clear Cache Clear Cache @@ -470,12 +476,12 @@ Sentence composed of 2 variables to describe how many people are following a use Followers Followers - Label describing followers of a user. + Navigation bar title for view that shows who is following a user. Following Following - Part of a larger sentence to describe how many profiles a user is following. + Navigation bar title for view that shows who a user is following. Following... @@ -573,6 +579,11 @@ Sentence composed of 2 variables to describe how many people are following a use Like Accessibility Label for Like button + + Load %lld more + Load %lld more + Button text for loading more events, where the variable is the number of events. + Local authentication to access private key Local authentication to access private key @@ -1041,6 +1052,11 @@ Label for filter for seeing your posts and replies (instead of only your posts). URL Example URL to LibreTranslate server + + Un-Bookmark + Un-Bookmark + Context menu option for un-bookmarking a note + Unfollow Unfollow @@ -1123,6 +1139,11 @@ Label for filter for seeing your posts and replies (instead of only your posts). Yes, Post with Private Key Button to proceed with posting a note even though it looks like they might be posting a private key. + + You have no bookmarks yet, add them in the context menu + You have no bookmarks yet, add them in the context menu + Text indicating that there are no bookmarks to be viewed + Your Name Your Name @@ -1275,21 +1296,6 @@ Label for filter for seeing your posts and replies (instead of only your posts). Relays - - %#@OTHERS@ - %#@OTHERS@ - - - - Replying to %2$@ & %1$d other - Replying to %2$@ & %1$d other - - - - Replying to %2$@ & %1$d others - Replying to %2$@ & %1$d others - - %#@OTHERS@ %#@OTHERS@ diff --git a/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings b/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings index ee39b694..d13f961a 100644 Binary files a/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings and b/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings differ diff --git a/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.stringsdict b/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.stringsdict index 4441ecbf..21ef04ab 100644 --- a/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.stringsdict +++ b/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.stringsdict @@ -66,22 +66,6 @@ Relays - replying_to_one_and_others - - NSStringLocalizedFormatKey - %#@OTHERS@ - OTHERS - - NSStringFormatSpecTypeKey - NSStringPluralRuleType - NSStringFormatValueTypeKey - d - one - Replying to %2$@ & %1$d other - other - Replying to %2$@ & %1$d others - - replying_to_two_and_others NSStringLocalizedFormatKey diff --git a/damus/es-419.lproj/InfoPlist.strings b/damus/es-419.lproj/InfoPlist.strings index cb67cc98..8e2d9242 100644 Binary files a/damus/es-419.lproj/InfoPlist.strings and b/damus/es-419.lproj/InfoPlist.strings differ diff --git a/damus/es-419.lproj/Localizable.strings b/damus/es-419.lproj/Localizable.strings index a0305a31..4b15a951 100644 Binary files a/damus/es-419.lproj/Localizable.strings and b/damus/es-419.lproj/Localizable.strings differ diff --git a/damus/es-419.lproj/Localizable.stringsdict b/damus/es-419.lproj/Localizable.stringsdict index 740d250b..6fce4a53 100644 --- a/damus/es-419.lproj/Localizable.stringsdict +++ b/damus/es-419.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,15 +13,17 @@ NSStringFormatValueTypeKey d one - %d otra nota + ... %d otra nota ... + many + ... %d otras notas ... other - %d otras notas + ... %d otras notas... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -28,11 +32,11 @@ d one Seguidor + many + Seguidores other Seguidores - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -46,6 +50,8 @@ d one Reacción + many + Reacciones other Reacciones @@ -62,6 +68,8 @@ d one Relé + many + Relés other Relés @@ -69,7 +77,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Respondiendo a %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -77,17 +85,17 @@ NSStringFormatValueTypeKey d one - y %d otro + Respondiendo a %2$@ y %1$d otro + many + Respondiendo a %2$@ y %1$d otros other - y %d otros - zero - + Respondiendo a %2$@ y %1$d otros replying_to_two_and_others NSStringLocalizedFormatKey - Respondiendo a %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -95,11 +103,11 @@ NSStringFormatValueTypeKey d one - y %d otro + Respondiendo a %2$@, %3$@ y %1$d otro + many + Respondiendo a %2$@, %3$@ y %1$d otros other - y %d otros - zero - + Respondiendo a %2$@, %3$@ y %1$d otros reposts_count @@ -114,6 +122,8 @@ d one Republicación + many + Republicaciones other Republicaciones @@ -130,6 +140,8 @@ @ one %2$@ sat + many + %2$@ sats other %2$@ sats @@ -146,6 +158,8 @@ d one Zap + many + Zaps other Zaps diff --git a/damus/fr-FR.lproj/InfoPlist.strings b/damus/fr-FR.lproj/InfoPlist.strings index 5e1126a0..14b5b6ac 100644 Binary files a/damus/fr-FR.lproj/InfoPlist.strings and b/damus/fr-FR.lproj/InfoPlist.strings differ diff --git a/damus/fr-FR.lproj/Localizable.strings b/damus/fr-FR.lproj/Localizable.strings index f55cf525..12929963 100644 Binary files a/damus/fr-FR.lproj/Localizable.strings and b/damus/fr-FR.lproj/Localizable.strings differ diff --git a/damus/fr-FR.lproj/Localizable.stringsdict b/damus/fr-FR.lproj/Localizable.stringsdict index 5d27f603..84f37575 100644 --- a/damus/fr-FR.lproj/Localizable.stringsdict +++ b/damus/fr-FR.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,15 +13,17 @@ NSStringFormatValueTypeKey d one - %d autre note + ... %d autre note ... + many + ... %d autres notes ... other - %d autres notes + ... %d autres notes ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -28,11 +32,11 @@ d one Abonné + many + Abonnés other Abonnés - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -46,6 +50,8 @@ d one Réaction + many + Réactions other Réactions @@ -62,6 +68,8 @@ d one Relais + many + Relais other Relais @@ -69,7 +77,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Réponse à %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -77,17 +85,17 @@ NSStringFormatValueTypeKey d one - & %d autre + Réponse à %2$@ & %1$d autre + many + Réponse à %2$@ & %1$d autres other - & %d autres - zero - + Réponse à %2$@ & %1$d autres replying_to_two_and_others NSStringLocalizedFormatKey - Réponse à %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -95,11 +103,11 @@ NSStringFormatValueTypeKey d one - & %d autre + Réponse à %2$@, %3$@ & %1$d autre + many + Réponse à %2$@, %3$@ & %1$d autres other - & %d autres - zero - + Réponse à %2$@, %3$@ & %1$d autres reposts_count @@ -114,6 +122,8 @@ d one Republication + many + Republications other Republications @@ -130,6 +140,8 @@ @ one %2$@ sat + many + %2$@ sats other %2$@ sats @@ -146,6 +158,8 @@ d one Zap + many + Zaps other Zaps diff --git a/damus/id.lproj/InfoPlist.strings b/damus/id.lproj/InfoPlist.strings index 4ed3cb82..7612949e 100644 Binary files a/damus/id.lproj/InfoPlist.strings and b/damus/id.lproj/InfoPlist.strings differ diff --git a/damus/id.lproj/Localizable.stringsdict b/damus/id.lproj/Localizable.stringsdict index 05594248..e50aa9f4 100644 --- a/damus/id.lproj/Localizable.stringsdict +++ b/damus/id.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,13 +13,13 @@ NSStringFormatValueTypeKey d other - %d Note Lainnya + ... %d Note Lainnya ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -27,8 +29,6 @@ other Pengikut - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -61,7 +61,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Membalas ke %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -69,15 +69,13 @@ NSStringFormatValueTypeKey d other - & %d lainnya - zero - + Membalas ke %2$@ & %1$d lainnya replying_to_two_and_others NSStringLocalizedFormatKey - Membalas ke %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -85,9 +83,7 @@ NSStringFormatValueTypeKey d other - & %d lainnya - zero - + Membalas ke %2$@, %3$@ & %1$d lainnya reposts_count diff --git a/damus/it-IT.lproj/InfoPlist.strings b/damus/it-IT.lproj/InfoPlist.strings index a1b52641..182f62ae 100644 Binary files a/damus/it-IT.lproj/InfoPlist.strings and b/damus/it-IT.lproj/InfoPlist.strings differ diff --git a/damus/it-IT.lproj/Localizable.stringsdict b/damus/it-IT.lproj/Localizable.stringsdict index d728d3cc..265a6547 100644 --- a/damus/it-IT.lproj/Localizable.stringsdict +++ b/damus/it-IT.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,15 +13,17 @@ NSStringFormatValueTypeKey d one - %d altra nota + ... %d altra nota ... + many + ... %d altre note ... other - %d altre note + ... %d altre note ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -28,11 +32,11 @@ d one Seguace + many + Seguaci other Seguaci - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -46,6 +50,8 @@ d one Reazione + many + Reazioni other Reazioni @@ -62,6 +68,8 @@ d one Relè + many + Relè other Relè @@ -69,7 +77,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Rispondendo a %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -77,17 +85,17 @@ NSStringFormatValueTypeKey d one - & %d altro + Rispondendo a %2$@ & %1$d altro + many + Rispondendo a %2$@ & %1$d altri other - & %d altri - zero - + Rispondendo a %2$@ & %1$d altri replying_to_two_and_others NSStringLocalizedFormatKey - Rispondendo a %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -95,11 +103,11 @@ NSStringFormatValueTypeKey d one - & %d altro + Rispondendo a %2$@, %3$@ & %1$d altro + many + Rispondendo a %2$@, %3$@ & %1$d altri other - & %d altri - zero - + Rispondendo a %2$@, %3$@ & %1$d altri reposts_count @@ -114,6 +122,8 @@ d one Repost + many + I Repost other I Repost @@ -130,6 +140,8 @@ @ one %2$@ sat + many + %2$@ sats other %2$@ sats @@ -146,6 +158,8 @@ d one Zap + many + Zaps other Zaps diff --git a/damus/ja.lproj/InfoPlist.strings b/damus/ja.lproj/InfoPlist.strings index f618c36e..59f25bd1 100644 Binary files a/damus/ja.lproj/InfoPlist.strings and b/damus/ja.lproj/InfoPlist.strings differ diff --git a/damus/ja.lproj/Localizable.strings b/damus/ja.lproj/Localizable.strings index 6c8d32d1..b2b85e53 100644 Binary files a/damus/ja.lproj/Localizable.strings and b/damus/ja.lproj/Localizable.strings differ diff --git a/damus/ja.lproj/Localizable.stringsdict b/damus/ja.lproj/Localizable.stringsdict index aa772835..77000804 100644 --- a/damus/ja.lproj/Localizable.stringsdict +++ b/damus/ja.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,13 +13,13 @@ NSStringFormatValueTypeKey d other - %d その他のNote + ... %d その他のNote ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -27,8 +29,6 @@ other フォロワー - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -61,7 +61,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - %@%#@OTHERS@ にリプライ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -69,15 +69,13 @@ NSStringFormatValueTypeKey d other - & %d その他 - zero - + %2$@ & %1$d その他にリプライ replying_to_two_and_others NSStringLocalizedFormatKey - %@, %@%#@OTHERS@ にリプライ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -85,9 +83,7 @@ NSStringFormatValueTypeKey d other - & %d その他 - zero - + %2$@, %3$@ & %1$d その他 にリプライ reposts_count diff --git a/damus/lv-LV.lproj/Localizable.stringsdict b/damus/lv-LV.lproj/Localizable.stringsdict index 3826fe22..62b358ea 100644 --- a/damus/lv-LV.lproj/Localizable.stringsdict +++ b/damus/lv-LV.lproj/Localizable.stringsdict @@ -4,164 +4,164 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - one - %d cita ziņa - other - %d citas ziņas zero - %d other notes + ... %d other notes ... + one + ... %d cita ziņa ... + other + ... %d citas ziņas ... - NSStringLocalizedFormatKey - ··· Ziņas ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d + zero + Followers one Sekotājs other Sekotāji - zero - Followers - NSStringLocalizedFormatKey - Sekotāji reactions_count NSStringLocalizedFormatKey - Reakcijas + %#@REACTIONS@ REACTIONS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d + zero + Reactions one Reakcija other Reakcijas - zero - Reactions relays_count NSStringLocalizedFormatKey - Releji + %#@RELAYS@ RELAYS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d + zero + Relays one Relejs other Releji - zero - Relays replying_to_one_and_others NSStringLocalizedFormatKey - Atbildot %@% #Citam + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - one - & %d cits - other - & %d citiem zero - + Atbildot %2$@ & %1$d others + one + Atbildot %2$@ & %1$d cits + other + Atbildot %2$@ & %1$d citiem replying_to_two_and_others NSStringLocalizedFormatKey - Atbildot %@, %@%#Citiem + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - one - & %d cits - other - & %d citiem zero - + Atbildot %2$@, %3$@ & %1$d others + one + Atbildot %2$@, %3$@ & %1$d cits + other + Atbildot %2$@, %3$@ & %1$d citiem reposts_count NSStringLocalizedFormatKey - Pārpublicējumi + %#@REPOSTS@ REPOSTS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d + zero + Reposts one Pārpublicēt other Pārpublicējumi - zero - Reposts sats_count NSStringLocalizedFormatKey - %1$#@Sats@ + %1$#@SATS@ SATS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey @ + zero + %2$@ sats one %2$@ sati other %2$@ sati - zero - %2$@ sats zaps_count NSStringLocalizedFormatKey - Zapi + %#@ZAPS@ ZAPS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d + zero + Zaps one Zaps other Zapi - zero - Zaps diff --git a/damus/nl.lproj/InfoPlist.strings b/damus/nl.lproj/InfoPlist.strings index 0c767650..b9448498 100644 Binary files a/damus/nl.lproj/InfoPlist.strings and b/damus/nl.lproj/InfoPlist.strings differ diff --git a/damus/nl.lproj/Localizable.strings b/damus/nl.lproj/Localizable.strings index 62b9a7c6..79d1271b 100644 Binary files a/damus/nl.lproj/Localizable.strings and b/damus/nl.lproj/Localizable.strings differ diff --git a/damus/nl.lproj/Localizable.stringsdict b/damus/nl.lproj/Localizable.stringsdict index 46cc1793..a8a1c3fa 100644 --- a/damus/nl.lproj/Localizable.stringsdict +++ b/damus/nl.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,15 +13,15 @@ NSStringFormatValueTypeKey d one - %d andere notitie + ... %d andere notitie ... other - %d andere notities + ... %d andere notities ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -31,8 +33,6 @@ other Volgers - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -69,7 +69,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Antwoord aan %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -77,17 +77,15 @@ NSStringFormatValueTypeKey d one - en %d andere gebruiker + Antwoord aan %2$@ en %1$d andere gebruiker other - en %d andere gebruikers - zero - + Antwoord aan %2$@ en %1$d andere gebruikers replying_to_two_and_others NSStringLocalizedFormatKey - Antwoord aan %@ en %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -95,11 +93,9 @@ NSStringFormatValueTypeKey d one - en %d andere gebruiker + Antwoord aan %2$@, %3$@ en %1$d andere gebruiker other - en %d andere gebruikers - zero - + Antwoord aan %2$@, %3$@ en %1$d andere gebruikers reposts_count diff --git a/damus/pl-PL.lproj/InfoPlist.strings b/damus/pl-PL.lproj/InfoPlist.strings index 1e32453f..2c29301f 100644 Binary files a/damus/pl-PL.lproj/InfoPlist.strings and b/damus/pl-PL.lproj/InfoPlist.strings differ diff --git a/damus/pl-PL.lproj/Localizable.stringsdict b/damus/pl-PL.lproj/Localizable.stringsdict index 62ffdee0..3993449c 100644 --- a/damus/pl-PL.lproj/Localizable.stringsdict +++ b/damus/pl-PL.lproj/Localizable.stringsdict @@ -4,43 +4,43 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - %d other notes - many - %d other notes one - %d inna notatka + ... %d inna notatka ... + few + ... %d other notes ... + many + ... %d other notes ... other - %d inne notatki + ... %d inne notatki ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Obserwujący few Followers many Followers - one - Obserwujący other Obserwujący - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -52,12 +52,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Reakcja few Reactions many Reactions - one - Reakcja other Reakcje @@ -72,12 +72,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Przekaźnik few Relays many Relays - one - Przekaźnik other Przekaźników @@ -85,45 +85,41 @@ replying_to_one_and_others NSStringLocalizedFormatKey - W odpowiedzi do %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d others - many - & %d others one - i %d innej osobie + W odpowiedzi do %2$@ i %1$d innej osobie + few + W odpowiedzi do %2$@ i %1$d others + many + W odpowiedzi do %2$@ i %1$d others other - i %d innym osobom - zero - + W odpowiedzi do %2$@ i %1$d innym osobom replying_to_two_and_others NSStringLocalizedFormatKey - W odpowiedzi do %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d others - many - & %d others one - i %d innej osoba + Replying to %2$@, %3$@ i %1$d innej osoba + few + Replying to %2$@, %3$@ i %1$d others + many + Replying to %2$@, %3$@ i %1$d others other - i %d innym osobom - zero - + Replying to %2$@, %3$@ i %1$d innym osobom reposts_count @@ -136,12 +132,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Podany dalej few Reposts many Reposts - one - Podany dalej other Podane dalej @@ -156,12 +152,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey @ + one + %2$@ sat few %2$@ sats many %2$@ sats - one - %2$@ sat other %2$@ satoszy @@ -176,12 +172,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Zap few Zaps many Zaps - one - Zap other Zapów diff --git a/damus/pt-PT.lproj/InfoPlist.strings b/damus/pt-PT.lproj/InfoPlist.strings index 954203d2..488ca234 100644 Binary files a/damus/pt-PT.lproj/InfoPlist.strings and b/damus/pt-PT.lproj/InfoPlist.strings differ diff --git a/damus/pt-PT.lproj/Localizable.strings b/damus/pt-PT.lproj/Localizable.strings index aabd2a1b..cc720db3 100644 Binary files a/damus/pt-PT.lproj/Localizable.strings and b/damus/pt-PT.lproj/Localizable.strings differ diff --git a/damus/pt-PT.lproj/Localizable.stringsdict b/damus/pt-PT.lproj/Localizable.stringsdict index b7d5e0f2..0dbd2f25 100644 --- a/damus/pt-PT.lproj/Localizable.stringsdict +++ b/damus/pt-PT.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,15 +13,17 @@ NSStringFormatValueTypeKey d one - %d outro note + ... %d outro note ... + many + ... %d outros notes ... other - %d outros notes + ... %d outros notes ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -28,11 +32,11 @@ d one Seguidor + many + Seguidores other Seguidores - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -46,6 +50,8 @@ d one Reação + many + Reações other Reações @@ -62,6 +68,8 @@ d one Relay + many + Relays other Relays @@ -69,7 +77,7 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Respondendo a %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -77,17 +85,17 @@ NSStringFormatValueTypeKey d one - & %d outros + Respondendo a %2$@ & %1$d outros + many + Respondendo a %2$@ & %1$d outros other - & %d outros - zero - + Respondendo a %2$@ & %1$d outros replying_to_two_and_others NSStringLocalizedFormatKey - Respondendo a %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -95,11 +103,11 @@ NSStringFormatValueTypeKey d one - & %d outros + Respondendo a %2$@, %3$@ & %1$d outros + many + Respondendo a %2$@, %3$@ & %1$d outros other - & %d outros - zero - + Respondendo a %2$@, %3$@ & %1$d outros reposts_count @@ -114,6 +122,8 @@ d one Repost + many + Reposts other Reposts @@ -130,6 +140,8 @@ @ one %2$@ sat + many + %2$@ sats other %2$@ sats @@ -146,6 +158,8 @@ d one Zap + many + Zaps other Zaps diff --git a/damus/ru.lproj/InfoPlist.strings b/damus/ru.lproj/InfoPlist.strings index 2542bda0..a2a87354 100644 Binary files a/damus/ru.lproj/InfoPlist.strings and b/damus/ru.lproj/InfoPlist.strings differ diff --git a/damus/ru.lproj/Localizable.stringsdict b/damus/ru.lproj/Localizable.stringsdict index 36ada760..f34a9b9c 100644 --- a/damus/ru.lproj/Localizable.stringsdict +++ b/damus/ru.lproj/Localizable.stringsdict @@ -4,43 +4,43 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - %d other notes - many - %d other notes one - %d другая заметка + ... %d другая заметка ... + few + ... %d other notes ... + many + ... %d other notes ... other - %d другие заметки + ... %d другие заметки ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Подписчик few Followers many Followers - one - Подписчик other Подписчики - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -52,12 +52,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Реакция few Reactions many Reactions - one - Реакция other Реакции @@ -72,12 +72,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Релей few Relays many Relays - one - Релей other Релеи @@ -85,45 +85,41 @@ replying_to_one_and_others NSStringLocalizedFormatKey - Replying to %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d others - many - & %d others one - и %d другим + В ответ %2$@ и %1$d другим + few + В ответ %2$@ и %1$d others + many + В ответ %2$@ и %1$d others other - и %d другие - zero - + В ответ %2$@ и %1$d другие replying_to_two_and_others NSStringLocalizedFormatKey - В ответ %@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d others - many - & %d others one - и %d другим + В ответ %2$@, %3$@ и %1$d другим + few + В ответ %2$@, %3$@ и %1$d others + many + В ответ %2$@, %3$@ и %1$d others other - и %d другие - zero - + В ответ %2$@, %3$@ и %1$d другие reposts_count @@ -136,12 +132,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Репост few Reposts many Reposts - one - Репост other Репосты @@ -156,12 +152,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey @ + one + %2$@ сат few %2$@ sats many %2$@ sats - one - %2$@ сат other %2$@ сат @@ -176,12 +172,12 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d + one + Зап few Zaps many Zaps - one - Зап other Запы diff --git a/damus/tr-TR.lproj/InfoPlist.strings b/damus/tr-TR.lproj/InfoPlist.strings index cbd763a5..49847167 100644 Binary files a/damus/tr-TR.lproj/InfoPlist.strings and b/damus/tr-TR.lproj/InfoPlist.strings differ diff --git a/damus/tr-TR.lproj/Localizable.strings b/damus/tr-TR.lproj/Localizable.strings index efe3f4b1..49a39729 100644 Binary files a/damus/tr-TR.lproj/Localizable.strings and b/damus/tr-TR.lproj/Localizable.strings differ diff --git a/damus/tr-TR.lproj/Localizable.stringsdict b/damus/tr-TR.lproj/Localizable.stringsdict index 8a8198bb..8f4ad99a 100644 --- a/damus/tr-TR.lproj/Localizable.stringsdict +++ b/damus/tr-TR.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey @@ -11,15 +13,15 @@ NSStringFormatValueTypeKey d one - %d diğer not + ... %d diğer not ... other - %d diğer notlar + ... %d diğer notlar ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey @@ -29,10 +31,8 @@ one Takipçi other - Takipçiler + Takipçi - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -47,7 +47,7 @@ one Tepki other - Tepkiler + Tepki relays_count @@ -63,13 +63,13 @@ one Röle other - Röleler + Röle replying_to_one_and_others NSStringLocalizedFormatKey - %@%#@OTHERS@'lara yanıt + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -77,17 +77,15 @@ NSStringFormatValueTypeKey d one - & %d diğer + %2$@ & %1$d diğer'lara yanıt other - & %d diğerleri - zero - + %2$@ & %1$d ve diğerlerine yanıt replying_to_two_and_others NSStringLocalizedFormatKey - %@, %@%#@OTHERS@'a yanıt + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey @@ -95,11 +93,9 @@ NSStringFormatValueTypeKey d one - & %d diğer + %2$@, %3$@ & %1$d diğer'a yanıt other - & %d diğerleri - zero - + %2$@, %3$@ & %1$d ve diğerlerine yanıt reposts_count @@ -115,7 +111,7 @@ one Yineleme other - Yinelemeler + Yineleme sats_count @@ -131,7 +127,7 @@ one %2$@ sat other - %2$@ sat + %2$@ sats zaps_count diff --git a/damus/zh-CN.lproj/InfoPlist.strings b/damus/zh-CN.lproj/InfoPlist.strings index 8ccb59cf..77008a38 100644 Binary files a/damus/zh-CN.lproj/InfoPlist.strings and b/damus/zh-CN.lproj/InfoPlist.strings differ diff --git a/damus/zh-CN.lproj/Localizable.strings b/damus/zh-CN.lproj/Localizable.strings index 6fef0c49..e62687a6 100644 Binary files a/damus/zh-CN.lproj/Localizable.strings and b/damus/zh-CN.lproj/Localizable.strings differ diff --git a/damus/zh-CN.lproj/Localizable.stringsdict b/damus/zh-CN.lproj/Localizable.stringsdict index 776dabcb..455bb872 100644 --- a/damus/zh-CN.lproj/Localizable.stringsdict +++ b/damus/zh-CN.lproj/Localizable.stringsdict @@ -4,51 +4,31 @@ collapsed_event_view_other_notes + NSStringLocalizedFormatKey + %#@NOTES@ NOTES NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - %d other notes - many - %d other notes - one - %d 条更多推文 other - %d 条更多推文 - two - %d other notes - zero - %d other notes + ... %d 条更多推 ... - NSStringLocalizedFormatKey - ··· %#@NOTES@ ··· followers_count + NSStringLocalizedFormatKey + %#@FOLLOWERS@ FOLLOWERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - Followers - many - Followers - one - 粉丝 other 粉丝 - two - Followers - zero - Followers - NSStringLocalizedFormatKey - %#@FOLLOWERS@ reactions_count @@ -60,18 +40,8 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d - few - Reactions - many - Reactions - one - 回应 other 回应 - two - Reactions - zero - Reactions relays_count @@ -84,66 +54,36 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d - few - Relays - many - Relays - one - 中继器 other 中继器 - two - Relays - zero - Relays replying_to_one_and_others NSStringLocalizedFormatKey - 正在回复%@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d others - many - & %d others - one - & %d 个其他用户 other - & %d 个其他用户 - two - & %d others - zero - + 正在回复%2$@ & %1$d 个其他用户 replying_to_two_and_others NSStringLocalizedFormatKey - 正在回复%@, %@%#@OTHERS@ + %#@OTHERS@ OTHERS NSStringFormatSpecTypeKey NSStringPluralRuleType NSStringFormatValueTypeKey d - few - & %d others - many - & %d others - one - & %d 个其他用户 other - & %d 个其他用户 - two - & %d others - zero - + 正在回复%2$@, %3$@ & %1$d 个其他用户 reposts_count @@ -156,18 +96,8 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d - few - Reposts - many - Reposts - one - 转发 other 转发 - two - Reposts - zero - Reposts sats_count @@ -180,18 +110,8 @@ NSStringPluralRuleType NSStringFormatValueTypeKey @ - few - %2$@ sats - many - %2$@ sats - one - %2$@ 聪 other %2$@ 聪 - two - %2$@ sats - zero - %2$@ sats zaps_count @@ -204,18 +124,8 @@ NSStringPluralRuleType NSStringFormatValueTypeKey d - few - Zaps - many - Zaps - one - 电击 other 电击 - two - Zaps - zero - Zaps diff --git a/damus/zh-HK.lproj/InfoPlist.strings b/damus/zh-HK.lproj/InfoPlist.strings new file mode 100644 index 00000000..79907ec3 Binary files /dev/null and b/damus/zh-HK.lproj/InfoPlist.strings differ diff --git a/damus/zh-HK.lproj/Localizable.strings b/damus/zh-HK.lproj/Localizable.strings new file mode 100644 index 00000000..34a72f67 Binary files /dev/null and b/damus/zh-HK.lproj/Localizable.strings differ diff --git a/damus/zh-HK.lproj/Localizable.stringsdict b/damus/zh-HK.lproj/Localizable.stringsdict new file mode 100644 index 00000000..6339886b --- /dev/null +++ b/damus/zh-HK.lproj/Localizable.stringsdict @@ -0,0 +1,132 @@ + + + + + collapsed_event_view_other_notes + + NSStringLocalizedFormatKey + %#@NOTES@ + NOTES + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + ...還有%d 条便條... + + + followers_count + + NSStringLocalizedFormatKey + %#@FOLLOWERS@ + FOLLOWERS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 粉絲 + + + reactions_count + + NSStringLocalizedFormatKey + %#@REACTIONS@ + REACTIONS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 回應 + + + relays_count + + NSStringLocalizedFormatKey + %#@RELAYS@ + RELAYS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 中繼器 + + + replying_to_one_and_others + + NSStringLocalizedFormatKey + %#@OTHERS@ + OTHERS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 正在回覆%2$@ & %1$d 個其他用戶 + + + replying_to_two_and_others + + NSStringLocalizedFormatKey + %#@OTHERS@ + OTHERS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 正在回覆%2$@, %3$@ & %1$d 個其他用戶 + + + reposts_count + + NSStringLocalizedFormatKey + %#@REPOSTS@ + REPOSTS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 轉發 + + + sats_count + + NSStringLocalizedFormatKey + %1$#@SATS@ + SATS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + @ + other + %2$@ 聰 + + + zaps_count + + NSStringLocalizedFormatKey + %#@ZAPS@ + ZAPS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 電擊 + + + + diff --git a/damus/zh-TW.lproj/InfoPlist.strings b/damus/zh-TW.lproj/InfoPlist.strings new file mode 100644 index 00000000..79907ec3 Binary files /dev/null and b/damus/zh-TW.lproj/InfoPlist.strings differ diff --git a/damus/zh-TW.lproj/Localizable.strings b/damus/zh-TW.lproj/Localizable.strings new file mode 100644 index 00000000..8e304b45 Binary files /dev/null and b/damus/zh-TW.lproj/Localizable.strings differ diff --git a/damus/zh-TW.lproj/Localizable.stringsdict b/damus/zh-TW.lproj/Localizable.stringsdict new file mode 100644 index 00000000..6339886b --- /dev/null +++ b/damus/zh-TW.lproj/Localizable.stringsdict @@ -0,0 +1,132 @@ + + + + + collapsed_event_view_other_notes + + NSStringLocalizedFormatKey + %#@NOTES@ + NOTES + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + ...還有%d 条便條... + + + followers_count + + NSStringLocalizedFormatKey + %#@FOLLOWERS@ + FOLLOWERS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 粉絲 + + + reactions_count + + NSStringLocalizedFormatKey + %#@REACTIONS@ + REACTIONS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 回應 + + + relays_count + + NSStringLocalizedFormatKey + %#@RELAYS@ + RELAYS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 中繼器 + + + replying_to_one_and_others + + NSStringLocalizedFormatKey + %#@OTHERS@ + OTHERS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 正在回覆%2$@ & %1$d 個其他用戶 + + + replying_to_two_and_others + + NSStringLocalizedFormatKey + %#@OTHERS@ + OTHERS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 正在回覆%2$@, %3$@ & %1$d 個其他用戶 + + + reposts_count + + NSStringLocalizedFormatKey + %#@REPOSTS@ + REPOSTS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 轉發 + + + sats_count + + NSStringLocalizedFormatKey + %1$#@SATS@ + SATS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + @ + other + %2$@ 聰 + + + zaps_count + + NSStringLocalizedFormatKey + %#@ZAPS@ + ZAPS + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 電擊 + + + + diff --git a/damusTests/EventDetailBarTests.swift b/damusTests/EventDetailBarTests.swift new file mode 100644 index 00000000..0b9a08a0 --- /dev/null +++ b/damusTests/EventDetailBarTests.swift @@ -0,0 +1,56 @@ +// +// EventDetailBarTests.swift +// damusTests +// +// Created by Terry Yiu on 2/24/23. +// + +import XCTest +@testable import damus + +final class EventDetailBarTests: XCTestCase { + + let enUsLocale = Locale(identifier: "en-US") + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testRepostsCountString() throws { + XCTAssertEqual(repostsCountString(0, locale: enUsLocale), "Reposts") + XCTAssertEqual(repostsCountString(1, locale: enUsLocale), "Repost") + XCTAssertEqual(repostsCountString(2, locale: enUsLocale), "Reposts") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + for count in 1...10 { + XCTAssertNoThrow(repostsCountString(count, locale: $0)) + } + } + } + + func testReactionsCountString() throws { + XCTAssertEqual(reactionsCountString(0, locale: enUsLocale), "Reactions") + XCTAssertEqual(reactionsCountString(1, locale: enUsLocale), "Reaction") + XCTAssertEqual(reactionsCountString(2, locale: enUsLocale), "Reactions") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + for count in 1...10 { + XCTAssertNoThrow(reactionsCountString(count, locale: $0)) + } + } + } + + func testZapssCountString() throws { + XCTAssertEqual(zapsCountString(0, locale: enUsLocale), "Zaps") + XCTAssertEqual(zapsCountString(1, locale: enUsLocale), "Zap") + XCTAssertEqual(zapsCountString(2, locale: enUsLocale), "Zaps") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + for count in 1...10 { + XCTAssertNoThrow(zapsCountString(count, locale: $0)) + } + } + } + +} diff --git a/damusTests/FormatTests.swift b/damusTests/FormatTests.swift index 148878f6..35fa79e6 100644 --- a/damusTests/FormatTests.swift +++ b/damusTests/FormatTests.swift @@ -34,4 +34,23 @@ final class FormatTests: XCTestCase { XCTAssertEqual(format_msats_abbrev(1000), "1") } + func testFormatMsats() throws { + let enUsLocale = Locale(identifier: "en-US") + XCTAssertEqual(format_msats(0, locale: enUsLocale), "0 sats") + XCTAssertEqual(format_msats(1, locale: enUsLocale), "0.001 sats") + XCTAssertEqual(format_msats(1000, locale: enUsLocale), "1 sat") + XCTAssertEqual(format_msats(1001, locale: enUsLocale), "1.001 sats") + XCTAssertEqual(format_msats(2000, locale: enUsLocale), "2 sats") + XCTAssertEqual(format_msats(123456789, locale: enUsLocale), "123,456.789 sats") + // Sanity check that function call does not throw in any supported locale as the string format accepts arguments, and a mismatched format in any one of the locales could break the app. + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + XCTAssertNoThrow(format_msats(0, locale: $0)) + XCTAssertNoThrow(format_msats(1, locale: $0)) + XCTAssertNoThrow(format_msats(1000, locale: $0)) + XCTAssertNoThrow(format_msats(1001, locale: $0)) + XCTAssertNoThrow(format_msats(2000, locale: $0)) + XCTAssertNoThrow(format_msats(123456789, locale: $0)) + } + } + } diff --git a/damusTests/ProfileViewTests.swift b/damusTests/ProfileViewTests.swift new file mode 100644 index 00000000..637d8041 --- /dev/null +++ b/damusTests/ProfileViewTests.swift @@ -0,0 +1,45 @@ +// +// ProfileViewTests.swift +// damusTests +// +// Created by Terry Yiu on 2/24/23. +// + +import XCTest +@testable import damus + +final class ProfileViewTests: XCTestCase { + + let enUsLocale = Locale(identifier: "en-US") + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testFollowersCountString() throws { + XCTAssertEqual(followersCountString(0, locale: enUsLocale), "Followers") + XCTAssertEqual(followersCountString(1, locale: enUsLocale), "Follower") + XCTAssertEqual(followersCountString(2, locale: enUsLocale), "Followers") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + for count in 1...10 { + XCTAssertNoThrow(followersCountString(count, locale: $0)) + } + } + } + + func testRelaysCountString() throws { + XCTAssertEqual(relaysCountString(0, locale: enUsLocale), "Relays") + XCTAssertEqual(relaysCountString(1, locale: enUsLocale), "Relay") + XCTAssertEqual(relaysCountString(2, locale: enUsLocale), "Relays") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + for count in 1...10 { + XCTAssertNoThrow(relaysCountString(count, locale: $0)) + } + } + } + +} diff --git a/damusTests/ReplyDescriptionTests.swift b/damusTests/ReplyDescriptionTests.swift new file mode 100644 index 00000000..4dbf226d --- /dev/null +++ b/damusTests/ReplyDescriptionTests.swift @@ -0,0 +1,87 @@ +// +// ReplyDescriptionTests.swift +// damusTests +// +// Created by Terry Yiu on 2/21/23. +// + +import XCTest +@testable import damus + +final class ReplyDescriptionTests: XCTestCase { + + let enUsLocale = Locale(identifier: "en-US") + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + // Test that English strings work properly with argument substitution and pluralization, and that other locales don't crash. + func testReplyDesc() throws { + let profiles = test_damus_state().profiles + + let replyingToSelfEvent = test_event + XCTAssertEqual(reply_desc(profiles: profiles, event: replyingToSelfEvent, locale: enUsLocale), "Replying to self") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + XCTAssertNoThrow(reply_desc(profiles: profiles, event: replyingToSelfEvent, locale: $0)) + } + + let replyingToOne = NostrEvent( + content: "hello there https://jb55.com/s/Oct12-150217.png https://jb55.com/red-me.jpg cool", + pubkey: "pk", + tags: [["e", "123"], ["p", "123"]], + createdAt: Int64(Date().timeIntervalSince1970 - 100) + ) + XCTAssertEqual(reply_desc(profiles: profiles, event: replyingToOne, locale: enUsLocale), "Replying to \(Profile.displayName(profile: nil, pubkey: "123"))") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + XCTAssertNoThrow(reply_desc(profiles: profiles, event: replyingToOne, locale: $0)) + } + + let replyingToTwo = NostrEvent( + content: "hello there https://jb55.com/s/Oct12-150217.png https://jb55.com/red-me.jpg cool", + pubkey: "pk", + tags: [["e", "123"], ["p", "123"], ["p", "456"]], + createdAt: Int64(Date().timeIntervalSince1970 - 100) + ) + XCTAssertEqual(reply_desc(profiles: profiles, event: replyingToTwo, locale: enUsLocale), "Replying to \(Profile.displayName(profile: nil, pubkey: "456")) & \(Profile.displayName(profile: nil, pubkey: "123"))") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + XCTAssertNoThrow(reply_desc(profiles: profiles, event: replyingToTwo, locale: $0)) + } + + let replyingToTwoAndOneOther = NostrEvent( + content: "hello there https://jb55.com/s/Oct12-150217.png https://jb55.com/red-me.jpg cool", + pubkey: "pk", + tags: [["e", "123"], ["p", "123"], ["p", "456"], ["p", "789"]], + createdAt: Int64(Date().timeIntervalSince1970 - 100) + ) + XCTAssertEqual(reply_desc(profiles: profiles, event: replyingToTwoAndOneOther, locale: enUsLocale), "Replying to \(Profile.displayName(profile: nil, pubkey: "789")), \(Profile.displayName(profile: nil, pubkey: "456")) & 1 other") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + XCTAssertNoThrow(reply_desc(profiles: profiles, event: replyingToTwoAndOneOther, locale: $0)) + } + + for othersCount in 2...10 { + var tags: [[String]] = [["e", "123"]] + for i in 1...othersCount { + tags.append(["p", "\(i)"]) + } + tags.append(["p", "456"]) + tags.append(["p", "789"]) + + let replyingToTwoAndMultipleOthers = NostrEvent( + content: "hello there https://jb55.com/s/Oct12-150217.png https://jb55.com/red-me.jpg cool", + pubkey: "pk", + tags: tags, + createdAt: Int64(Date().timeIntervalSince1970 - 100) + ) + XCTAssertEqual(reply_desc(profiles: profiles, event: replyingToTwoAndMultipleOthers, locale: enUsLocale), "Replying to \(Profile.displayName(profile: nil, pubkey: "789")), \(Profile.displayName(profile: nil, pubkey: "456")) & \(othersCount) others") + Bundle.main.localizations.map { Locale(identifier: $0) }.forEach { + XCTAssertNoThrow(reply_desc(profiles: profiles, event: replyingToTwoAndMultipleOthers, locale: $0)) + } + } + } + +} diff --git a/damusTests/TimeAgoTests.swift b/damusTests/TimeAgoTests.swift index 0b1af3a3..f11c92a8 100644 --- a/damusTests/TimeAgoTests.swift +++ b/damusTests/TimeAgoTests.swift @@ -11,7 +11,7 @@ import XCTest final class TimeAgoTests: XCTestCase { func testTimeAgoSince() { - let locale = Locale(identifier: "en_US") + let locale = Locale(identifier: "en-US") let calendar = locale.calendar XCTAssertEqual(time_ago_since(Date.now, calendar), "now")