commit 5cd4c2d75eb7123694994e61e3b83a85bcc8a2d6 parent 85e797a0541ad0251a89982487f719cf71123f52 Author: Terry Yiu <963907+tyiu@users.noreply.github.com> Date: Fri, 24 Feb 2023 12:26:43 -0500 Fix localization issues, add tests, import translations, and add zh-CN and zh-TW Closes: #689 Diffstat:
73 files changed, 1041 insertions(+), 580 deletions(-)
diff --git 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 = "<group>"; }; 3A25EF152992DA5D008ABE69 /* el-GR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "el-GR"; path = "el-GR.lproj/Localizable.stringsdict"; sourceTree = "<group>"; }; 3A2B8B0A296A8982009CC16D /* en-US */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "en-US"; path = "en-US.lproj/Localizable.stringsdict"; sourceTree = "<group>"; }; + 3A3040EC29A5CB86008A0F29 /* ReplyDescriptionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplyDescriptionTests.swift; sourceTree = "<group>"; }; + 3A3040EE29A8FEE9008A0F29 /* EventDetailBarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventDetailBarTests.swift; sourceTree = "<group>"; }; + 3A3040F029A8FF97008A0F29 /* LocalizationUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizationUtil.swift; sourceTree = "<group>"; }; + 3A3040F229A91366008A0F29 /* ProfileViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewTests.swift; sourceTree = "<group>"; }; + 3A3040F929A91ED6008A0F29 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = "zh-HK.lproj/InfoPlist.strings"; sourceTree = "<group>"; }; + 3A3040FA29A91EFC008A0F29 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = "zh-HK.lproj/Localizable.strings"; sourceTree = "<group>"; }; + 3A3040FB29A91F03008A0F29 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "zh-HK"; path = "zh-HK.lproj/Localizable.stringsdict"; sourceTree = "<group>"; }; + 3A3040FC29A91F31008A0F29 /* zh-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-TW"; path = "zh-TW.lproj/InfoPlist.strings"; sourceTree = "<group>"; }; + 3A3040FD29A91F31008A0F29 /* zh-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "zh-TW"; path = "zh-TW.lproj/Localizable.stringsdict"; sourceTree = "<group>"; }; + 3A3040FE29A91F31008A0F29 /* zh-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-TW"; path = "zh-TW.lproj/Localizable.strings"; sourceTree = "<group>"; }; 3A41E559299D52BE001FA465 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 3A41E55A299D52BE001FA465 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Localizable.strings; sourceTree = "<group>"; }; 3A41E55B299D52BE001FA465 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = id; path = id.lproj/Localizable.stringsdict; sourceTree = "<group>"; }; @@ -810,6 +824,7 @@ 4C2CDDF6299D4A5E00879FD5 /* Debouncer.swift */, 7C95CAED299DCEF1009DCB67 /* KFOptionSetter+.swift */, 4CE0E2AE29A2E82100DB4CA2 /* EventHolder.swift */, + 3A3040F029A8FF97008A0F29 /* LocalizationUtil.swift */, ); path = Util; sourceTree = "<group>"; @@ -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 = "<group>"; @@ -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 = "<group>"; @@ -1499,6 +1525,8 @@ 3A41E559299D52BE001FA465 /* id */, 3A8624D9299E82BE00BD8BE9 /* cs */, 3A827A18299FC69D00C4D171 /* ru */, + 3A3040F929A91ED6008A0F29 /* zh-HK */, + 3A3040FC29A91F31008A0F29 /* zh-TW */, ); name = InfoPlist.strings; sourceTree = "<group>"; @@ -1522,6 +1550,8 @@ 3A41E55A299D52BE001FA465 /* id */, 3A8624DA299E82BE00BD8BE9 /* cs */, 3A827A19299FC69D00C4D171 /* ru */, + 3A3040FA29A91EFC008A0F29 /* zh-HK */, + 3A3040FE29A91F31008A0F29 /* zh-TW */, ); name = Localizable.strings; sourceTree = "<group>"; diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 Binary files differ. diff --git a/damus/ar.lproj/Localizable.strings b/damus/ar.lproj/Localizable.strings Binary files differ. diff --git a/damus/ar.lproj/Localizable.stringsdict b/damus/ar.lproj/Localizable.stringsdict @@ -4,51 +4,51 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>... %d منشورات أخرى ...</string> + <key>one</key> + <string>... %d منشور اضافي ...</string> + <key>two</key> + <string>... %d منشوران ...</string> <key>few</key> - <string>%d منشورات اضافية</string> + <string>... %d منشورات اضافية ...</string> <key>many</key> - <string>%d منشورات اضافية</string> - <key>one</key> - <string>%d منشور اضافي</string> + <string>... %d منشورات اضافية ...</string> <key>other</key> - <string>%d منشورات اضافية</string> - <key>two</key> - <string>%d منشوران</string> - <key>zero</key> - <string>%d منشورات أخرى</string> + <string>... %d منشورات اضافية ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>المتابعون</string> - <key>many</key> - <string>المتابعون</string> + <key>zero</key> + <string>متابع</string> <key>one</key> <string>متابع</string> - <key>other</key> - <string>المتابعون</string> <key>two</key> <string>متابعان</string> - <key>zero</key> - <string>متابع</string> + <key>few</key> + <string>المتابِعون</string> + <key>many</key> + <string>المتابِعون</string> + <key>other</key> + <string>المتابِعون</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -60,17 +60,17 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>تفاعلات</string> - <key>many</key> + <key>zero</key> <string>تفاعل</string> <key>one</key> <string>تفاعل</string> - <key>other</key> - <string>تفاعل</string> <key>two</key> + <string>تفاعلان</string> + <key>few</key> + <string>تفاعلات</string> + <key>many</key> <string>تفاعل</string> - <key>zero</key> + <key>other</key> <string>تفاعل</string> </dict> </dict> @@ -84,66 +84,66 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>موصّلات</string> - <key>many</key> - <string>موصّلات</string> + <key>zero</key> + <string>موصّل</string> <key>one</key> <string> موصّل</string> - <key>other</key> - <string>موصّلات</string> <key>two</key> <string>موصّلان</string> - <key>zero</key> + <key>few</key> + <string>موصّلات</string> + <key>many</key> + <string>موصّل</string> + <key>other</key> <string>موصّل</string> </dict> </dict> <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>رد على %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>رد على %2$@</string> + <key>one</key> + <string>الرد على %2$@ & %1$d آخر</string> + <key>two</key> + <string>الرد على %2$@ & %1$d آخرين</string> <key>few</key> - <string> & %d آخرون</string> + <string>الرد على %2$@ & %1$d آخرين</string> <key>many</key> - <string> & %d آخرون</string> - <key>one</key> - <string>& %d آخر</string> + <string>الرد على %2$@ & %1$d آخرين</string> <key>other</key> - <string>& %d آخرين</string> - <key>two</key> - <string> & %d آخران</string> - <key>zero</key> - <string></string> + <string>الرد على %2$@ & %1$d آخرين</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>رد على%@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>الرد على %2$@, %3$@ & %1$d others</string> + <key>one</key> + <string>الرد على %2$@, %3$@ & %1$d آخر</string> + <key>two</key> + <string>الرد على %2$@, %3$@ & %1$d آخرين</string> <key>few</key> - <string> & %d آخرون</string> + <string>الرد على %2$@, %3$@ & %1$d آخرين</string> <key>many</key> - <string> & %d آخرون</string> - <key>one</key> - <string>& %d آخر</string> + <string>الرد على %2$@, %3$@ & %1$d آخرين</string> <key>other</key> - <string>& %d آخرين</string> - <key>two</key> - <string> & %d آخران</string> - <key>zero</key> - <string></string> + <string>الرد على %2$@, %3$@ & %1$d آخرين</string> </dict> </dict> <key>reposts_count</key> @@ -156,18 +156,18 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>اعادات نشر</string> - <key>many</key> + <key>zero</key> <string>اعادات نشر</string> <key>one</key> <string>اعادة نشر</string> - <key>other</key> - <string>اعادات نشر</string> <key>two</key> + <string>اعادتا نشر</string> + <key>few</key> <string>اعادات نشر</string> - <key>zero</key> - <string>اعادات نشر</string> + <key>many</key> + <string>اعادة نشر</string> + <key>other</key> + <string>اعادة نشر</string> </dict> </dict> <key>sats_count</key> @@ -180,17 +180,17 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>@</string> - <key>few</key> - <string>%2$@ ساتوشي</string> - <key>many</key> + <key>zero</key> <string>%2$@ ساتوشي</string> <key>one</key> <string>%2$@ ساتوشي</string> - <key>other</key> - <string>%2$@ ساتوشي</string> <key>two</key> <string>%2$@ ساتوشي</string> - <key>zero</key> + <key>few</key> + <string>%2$@ ساتوشي</string> + <key>many</key> + <string>%2$@ ساتوشي</string> + <key>other</key> <string>%2$@ ساتوشي</string> </dict> </dict> @@ -204,18 +204,18 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>وميض</string> - <key>many</key> + <key>zero</key> <string>وميض</string> <key>one</key> <string>ومضة</string> - <key>other</key> - <string>وميض</string> <key>two</key> - <string>وميض</string> - <key>zero</key> - <string>وميض</string> + <string>ومضتان</string> + <key>few</key> + <string>ومضات</string> + <key>many</key> + <string>ومضة</string> + <key>other</key> + <string>ومضة</string> </dict> </dict> </dict> diff --git a/damus/cs.lproj/InfoPlist.strings b/damus/cs.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/cs.lproj/Localizable.strings b/damus/cs.lproj/Localizable.strings Binary files differ. diff --git a/damus/cs.lproj/Localizable.stringsdict b/damus/cs.lproj/Localizable.stringsdict @@ -4,43 +4,43 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>... %d jiná poznámka ...</string> <key>few</key> - <string>%d other notes</string> + <string>... %d other notes ...</string> <key>many</key> - <string>%d other notes</string> - <key>one</key> - <string>%d jiná poznámka</string> + <string>... %d other notes ...</string> <key>other</key> - <string>%d jiné poznámky</string> + <string>... %d jiné poznámky ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Seguidor</string> <key>few</key> <string>Followers</string> <key>many</key> <string>Followers</string> - <key>one</key> - <string>Seguidor</string> <key>other</key> <string>Sledují</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -52,12 +52,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Reakce</string> <key>few</key> <string>Reactions</string> <key>many</key> <string>Reactions</string> - <key>one</key> - <string>Reakce</string> <key>other</key> <string>Reakce</string> </dict> @@ -72,12 +72,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Relé</string> <key>few</key> <string>Relays</string> <key>many</key> <string>Relays</string> - <key>one</key> - <string>Relé</string> <key>other</key> <string>Relé</string> </dict> @@ -85,45 +85,41 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Odpověď na %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Odpověď na %2$@ a %1$d další</string> <key>few</key> - <string> & %d others</string> + <string>Odpověď na %2$@ a %1$d others</string> <key>many</key> - <string> & %d others</string> - <key>one</key> - <string> a %d další</string> + <string>Odpověď na %2$@ a %1$d others</string> <key>other</key> - <string> a %d další</string> - <key>zero</key> - <string></string> + <string>Odpověď na %2$@ a %1$d další</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Odpovědět na %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Odpovědět na %2$@, %3$@ & %1$d další</string> <key>few</key> - <string> & %d others</string> + <string>Odpovědět na %2$@, %3$@ & %1$d others</string> <key>many</key> - <string> & %d others</string> - <key>one</key> - <string> a %d další</string> + <string>Odpovědět na %2$@, %3$@ & %1$d others</string> <key>other</key> - <string> a %d další</string> - <key>zero</key> - <string></string> + <string>Odpovědět na %2$@, %3$@ & %1$d další</string> </dict> </dict> <key>reposts_count</key> @@ -136,12 +132,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Přesdílet</string> <key>few</key> <string>Reposts</string> <key>many</key> <string>Reposts</string> - <key>one</key> - <string>Přesdílet</string> <key>other</key> <string>Přesdílené </string> </dict> @@ -156,12 +152,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>@</string> + <key>one</key> + <string>%2$@ sat</string> <key>few</key> <string>%2$@ sats</string> <key>many</key> <string>%2$@ sats</string> - <key>one</key> - <string>%2$@ sat</string> <key>other</key> <string>%2$@ satů</string> </dict> @@ -176,12 +172,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Zap</string> <key>few</key> <string>Zaps</string> <key>many</key> <string>Zaps</string> - <key>one</key> - <string>Zap</string> <key>other</key> <string>Zapů</string> </dict> diff --git a/damus/de.lproj/InfoPlist.strings b/damus/de.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/de.lproj/Localizable.strings b/damus/de.lproj/Localizable.strings Binary files differ. diff --git a/damus/de.lproj/Localizable.stringsdict b/damus/de.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,15 +13,15 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>%d andere Notiz</string> + <string>... %d andere Notiz ...</string> <key>other</key> - <string>%d andere Notizen</string> + <string>... %d andere Notizen ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -31,8 +33,6 @@ <key>other</key> <string>Follower</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -69,7 +69,7 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Antwort an %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -77,17 +77,15 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d andere</string> + <string>Antwort an %2$@ & %1$d andere</string> <key>other</key> - <string> & %d andere</string> - <key>zero</key> - <string></string> + <string>Antwort an %2$@ & %1$d andere</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Antwort an %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -95,11 +93,9 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d andere</string> + <string>Antwort an %2$@, %3$@ & %1$d andere</string> <key>other</key> - <string> & %d andere</string> - <key>zero</key> - <string></string> + <string>Antwort an %2$@, %3$@ & %1$d andere</string> </dict> </dict> <key>reposts_count</key> diff --git a/damus/el-GR.lproj/InfoPlist.strings b/damus/el-GR.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/el-GR.lproj/Localizable.strings b/damus/el-GR.lproj/Localizable.strings Binary files differ. diff --git a/damus/el-GR.lproj/Localizable.stringsdict b/damus/el-GR.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,15 +13,15 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>%d άλλη σημείωση</string> + <string>... %d άλλη σημείωση ...</string> <key>other</key> - <string>%d άλλες σημειώσεις</string> + <string>... %d άλλες σημειώσεις ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -31,8 +33,6 @@ <key>other</key> <string>Ακόλουθοι</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -69,7 +69,7 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Απάντηση προς %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -77,17 +77,15 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d άλλον</string> + <string>Replying to %2$@ & %1$d other</string> <key>other</key> - <string> & %d άλλους</string> - <key>zero</key> - <string></string> + <string>Replying to %2$@ & %1$d others</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Απάντηση προς %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -95,11 +93,9 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d άλλον</string> + <string>Απάντηση προς %2$@, %3$@ & %1$d άλλον</string> <key>other</key> - <string> & %d άλλους</string> - <key>zero</key> - <string></string> + <string>Απάντηση προς %2$@, %3$@ & %1$d άλλους</string> </dict> </dict> <key>reposts_count</key> diff --git a/damus/en-US.lproj/Localizable.stringsdict b/damus/en-US.lproj/Localizable.stringsdict @@ -66,22 +66,6 @@ <string>Relays</string> </dict> </dict> - <key>replying_to_one_and_others</key> - <dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@OTHERS@</string> - <key>OTHERS</key> - <dict> - <key>NSStringFormatSpecTypeKey</key> - <string>NSStringPluralRuleType</string> - <key>NSStringFormatValueTypeKey</key> - <string>d</string> - <key>one</key> - <string>Replying to %2$@ & %1$d other</string> - <key>other</key> - <string>Replying to %2$@ & %1$d others</string> - </dict> - </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> diff --git 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 <target>'%@' is an invalid NIP-05 identifier. It should look like an email.</target> <note>Description of why the nip05 identifier is invalid.</note> </trans-unit> - <trans-unit id="(Profile.displayName(profile: profile, pubkey: whos))'s Followers" xml:space="preserve"> - <source>(Profile.displayName(profile: profile, pubkey: whos))'s Followers</source> - <target>(Profile.displayName(profile: profile, pubkey: whos))'s Followers</target> - <note>Navigation bar title for view that shows who is following a user.</note> - </trans-unit> - <trans-unit id="(who) following" xml:space="preserve"> - <source>(who) following</source> - <target>(who) following</target> - <note>Navigation bar title for view that shows who a user is following.</note> - </trans-unit> <trans-unit id="API Key (optional)" xml:space="preserve"> <source>API Key (optional)</source> <target>API Key (optional)</target> @@ -211,6 +201,17 @@ Sentence composed of 2 variables to describe how many people are following a use <target>Blue Wallet</target> <note>Dropdown option label for Lightning wallet, Blue Wallet.</note> </trans-unit> + <trans-unit id="Bookmark" xml:space="preserve"> + <source>Bookmark</source> + <target>Bookmark</target> + <note>Context menu option for bookmarking a note</note> + </trans-unit> + <trans-unit id="Bookmarks" xml:space="preserve"> + <source>Bookmarks</source> + <target>Bookmarks</target> + <note>Sidebar menu label for Bookmarks view. + Title of bookmarks view</note> + </trans-unit> <trans-unit id="Boosts" xml:space="preserve"> <source>Boosts</source> <target>Boosts</target> @@ -247,6 +248,11 @@ Sentence composed of 2 variables to describe how many people are following a use <target>Clear</target> <note>Button for clearing cached data.</note> </trans-unit> + <trans-unit id="Clear All" xml:space="preserve"> + <source>Clear All</source> + <target>Clear All</target> + <note>Button for clearing bookmarks data.</note> + </trans-unit> <trans-unit id="Clear Cache" xml:space="preserve"> <source>Clear Cache</source> <target>Clear Cache</target> @@ -470,12 +476,12 @@ Sentence composed of 2 variables to describe how many people are following a use <trans-unit id="Followers" xml:space="preserve"> <source>Followers</source> <target>Followers</target> - <note>Label describing followers of a user.</note> + <note>Navigation bar title for view that shows who is following a user.</note> </trans-unit> <trans-unit id="Following" xml:space="preserve"> <source>Following</source> <target>Following</target> - <note>Part of a larger sentence to describe how many profiles a user is following.</note> + <note>Navigation bar title for view that shows who a user is following.</note> </trans-unit> <trans-unit id="Following..." xml:space="preserve"> <source>Following...</source> @@ -573,6 +579,11 @@ Sentence composed of 2 variables to describe how many people are following a use <target>Like</target> <note>Accessibility Label for Like button</note> </trans-unit> + <trans-unit id="Load %lld more" xml:space="preserve"> + <source>Load %lld more</source> + <target>Load %lld more</target> + <note>Button text for loading more events, where the variable is the number of events.</note> + </trans-unit> <trans-unit id="Local authentication to access private key" xml:space="preserve"> <source>Local authentication to access private key</source> <target>Local authentication to access private key</target> @@ -1041,6 +1052,11 @@ Label for filter for seeing your posts and replies (instead of only your posts). <target>URL</target> <note>Example URL to LibreTranslate server</note> </trans-unit> + <trans-unit id="Un-Bookmark" xml:space="preserve"> + <source>Un-Bookmark</source> + <target>Un-Bookmark</target> + <note>Context menu option for un-bookmarking a note</note> + </trans-unit> <trans-unit id="Unfollow" xml:space="preserve"> <source>Unfollow</source> <target>Unfollow</target> @@ -1123,6 +1139,11 @@ Label for filter for seeing your posts and replies (instead of only your posts). <target>Yes, Post with Private Key</target> <note>Button to proceed with posting a note even though it looks like they might be posting a private key.</note> </trans-unit> + <trans-unit id="You have no bookmarks yet, add them in the context menu" xml:space="preserve"> + <source>You have no bookmarks yet, add them in the context menu</source> + <target>You have no bookmarks yet, add them in the context menu</target> + <note>Text indicating that there are no bookmarks to be viewed</note> + </trans-unit> <trans-unit id="Your Name" xml:space="preserve"> <source>Your Name</source> <target>Your Name</target> @@ -1275,21 +1296,6 @@ Label for filter for seeing your posts and replies (instead of only your posts). <target>Relays</target> <note/> </trans-unit> - <trans-unit id="/replying_to_one_and_others:dict/NSStringLocalizedFormatKey:dict/:string" xml:space="preserve"> - <source>%#@OTHERS@</source> - <target>%#@OTHERS@</target> - <note/> - </trans-unit> - <trans-unit id="/replying_to_one_and_others:dict/OTHERS:dict/one:dict/:string" xml:space="preserve"> - <source>Replying to %2$@ & %1$d other</source> - <target>Replying to %2$@ & %1$d other</target> - <note/> - </trans-unit> - <trans-unit id="/replying_to_one_and_others:dict/OTHERS:dict/other:dict/:string" xml:space="preserve"> - <source>Replying to %2$@ & %1$d others</source> - <target>Replying to %2$@ & %1$d others</target> - <note/> - </trans-unit> <trans-unit id="/replying_to_two_and_others:dict/NSStringLocalizedFormatKey:dict/:string" xml:space="preserve"> <source>%#@OTHERS@</source> <target>%#@OTHERS@</target> 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 Binary files 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 @@ -66,22 +66,6 @@ <string>Relays</string> </dict> </dict> - <key>replying_to_one_and_others</key> - <dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@OTHERS@</string> - <key>OTHERS</key> - <dict> - <key>NSStringFormatSpecTypeKey</key> - <string>NSStringPluralRuleType</string> - <key>NSStringFormatValueTypeKey</key> - <string>d</string> - <key>one</key> - <string>Replying to %2$@ & %1$d other</string> - <key>other</key> - <string>Replying to %2$@ & %1$d others</string> - </dict> - </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> diff --git a/damus/es-419.lproj/InfoPlist.strings b/damus/es-419.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/es-419.lproj/Localizable.strings b/damus/es-419.lproj/Localizable.strings Binary files differ. diff --git a/damus/es-419.lproj/Localizable.stringsdict b/damus/es-419.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,15 +13,17 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>%d otra nota</string> + <string>... %d otra nota ...</string> + <key>many</key> + <string>... %d otras notas ...</string> <key>other</key> - <string>%d otras notas</string> + <string>... %d otras notas...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -28,11 +32,11 @@ <string>d</string> <key>one</key> <string>Seguidor</string> + <key>many</key> + <string>Seguidores</string> <key>other</key> <string>Seguidores</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -46,6 +50,8 @@ <string>d</string> <key>one</key> <string>Reacción</string> + <key>many</key> + <string>Reacciones</string> <key>other</key> <string>Reacciones</string> </dict> @@ -62,6 +68,8 @@ <string>d</string> <key>one</key> <string>Relé</string> + <key>many</key> + <string>Relés</string> <key>other</key> <string>Relés</string> </dict> @@ -69,7 +77,7 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Respondiendo a %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -77,17 +85,17 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> y %d otro</string> + <string>Respondiendo a %2$@ y %1$d otro</string> + <key>many</key> + <string>Respondiendo a %2$@ y %1$d otros</string> <key>other</key> - <string> y %d otros</string> - <key>zero</key> - <string></string> + <string>Respondiendo a %2$@ y %1$d otros</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Respondiendo a %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -95,11 +103,11 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> y %d otro</string> + <string>Respondiendo a %2$@, %3$@ y %1$d otro</string> + <key>many</key> + <string>Respondiendo a %2$@, %3$@ y %1$d otros</string> <key>other</key> - <string> y %d otros</string> - <key>zero</key> - <string></string> + <string>Respondiendo a %2$@, %3$@ y %1$d otros</string> </dict> </dict> <key>reposts_count</key> @@ -114,6 +122,8 @@ <string>d</string> <key>one</key> <string>Republicación</string> + <key>many</key> + <string>Republicaciones</string> <key>other</key> <string>Republicaciones</string> </dict> @@ -130,6 +140,8 @@ <string>@</string> <key>one</key> <string>%2$@ sat</string> + <key>many</key> + <string>%2$@ sats</string> <key>other</key> <string>%2$@ sats</string> </dict> @@ -146,6 +158,8 @@ <string>d</string> <key>one</key> <string>Zap</string> + <key>many</key> + <string>Zaps</string> <key>other</key> <string>Zaps</string> </dict> diff --git a/damus/fr-FR.lproj/InfoPlist.strings b/damus/fr-FR.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/fr-FR.lproj/Localizable.strings b/damus/fr-FR.lproj/Localizable.strings Binary files differ. diff --git a/damus/fr-FR.lproj/Localizable.stringsdict b/damus/fr-FR.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,15 +13,17 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>%d autre note</string> + <string>... %d autre note ...</string> + <key>many</key> + <string>... %d autres notes ...</string> <key>other</key> - <string>%d autres notes</string> + <string>... %d autres notes ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -28,11 +32,11 @@ <string>d</string> <key>one</key> <string>Abonné</string> + <key>many</key> + <string>Abonnés</string> <key>other</key> <string>Abonnés</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -46,6 +50,8 @@ <string>d</string> <key>one</key> <string>Réaction</string> + <key>many</key> + <string>Réactions</string> <key>other</key> <string>Réactions</string> </dict> @@ -62,6 +68,8 @@ <string>d</string> <key>one</key> <string>Relais</string> + <key>many</key> + <string>Relais</string> <key>other</key> <string>Relais</string> </dict> @@ -69,7 +77,7 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Réponse à %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -77,17 +85,17 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d autre</string> + <string>Réponse à %2$@ & %1$d autre</string> + <key>many</key> + <string>Réponse à %2$@ & %1$d autres</string> <key>other</key> - <string> & %d autres</string> - <key>zero</key> - <string></string> + <string>Réponse à %2$@ & %1$d autres</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Réponse à %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -95,11 +103,11 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d autre</string> + <string>Réponse à %2$@, %3$@ & %1$d autre</string> + <key>many</key> + <string>Réponse à %2$@, %3$@ & %1$d autres</string> <key>other</key> - <string> & %d autres</string> - <key>zero</key> - <string></string> + <string>Réponse à %2$@, %3$@ & %1$d autres</string> </dict> </dict> <key>reposts_count</key> @@ -114,6 +122,8 @@ <string>d</string> <key>one</key> <string>Republication</string> + <key>many</key> + <string>Republications</string> <key>other</key> <string>Republications</string> </dict> @@ -130,6 +140,8 @@ <string>@</string> <key>one</key> <string>%2$@ sat</string> + <key>many</key> + <string>%2$@ sats</string> <key>other</key> <string>%2$@ sats</string> </dict> @@ -146,6 +158,8 @@ <string>d</string> <key>one</key> <string>Zap</string> + <key>many</key> + <string>Zaps</string> <key>other</key> <string>Zaps</string> </dict> diff --git a/damus/id.lproj/InfoPlist.strings b/damus/id.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/id.lproj/Localizable.stringsdict b/damus/id.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,13 +13,13 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>other</key> - <string>%d Note Lainnya</string> + <string>... %d Note Lainnya ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -27,8 +29,6 @@ <key>other</key> <string>Pengikut</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -61,7 +61,7 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Membalas ke %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -69,15 +69,13 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>other</key> - <string>& %d lainnya</string> - <key>zero</key> - <string></string> + <string>Membalas ke %2$@ & %1$d lainnya</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Membalas ke %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -85,9 +83,7 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>other</key> - <string>& %d lainnya</string> - <key>zero</key> - <string></string> + <string>Membalas ke %2$@, %3$@ & %1$d lainnya</string> </dict> </dict> <key>reposts_count</key> diff --git a/damus/it-IT.lproj/InfoPlist.strings b/damus/it-IT.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/it-IT.lproj/Localizable.stringsdict b/damus/it-IT.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,15 +13,17 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>%d altra nota</string> + <string>... %d altra nota ...</string> + <key>many</key> + <string>... %d altre note ...</string> <key>other</key> - <string>%d altre note</string> + <string>... %d altre note ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -28,11 +32,11 @@ <string>d</string> <key>one</key> <string>Seguace</string> + <key>many</key> + <string>Seguaci</string> <key>other</key> <string>Seguaci</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -46,6 +50,8 @@ <string>d</string> <key>one</key> <string>Reazione</string> + <key>many</key> + <string>Reazioni</string> <key>other</key> <string>Reazioni</string> </dict> @@ -62,6 +68,8 @@ <string>d</string> <key>one</key> <string>Relè</string> + <key>many</key> + <string>Relè</string> <key>other</key> <string>Relè</string> </dict> @@ -69,7 +77,7 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Rispondendo a %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -77,17 +85,17 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d altro</string> + <string>Rispondendo a %2$@ & %1$d altro</string> + <key>many</key> + <string>Rispondendo a %2$@ & %1$d altri</string> <key>other</key> - <string> & %d altri</string> - <key>zero</key> - <string></string> + <string>Rispondendo a %2$@ & %1$d altri</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Rispondendo a %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -95,11 +103,11 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d altro</string> + <string>Rispondendo a %2$@, %3$@ & %1$d altro</string> + <key>many</key> + <string>Rispondendo a %2$@, %3$@ & %1$d altri</string> <key>other</key> - <string> & %d altri</string> - <key>zero</key> - <string></string> + <string>Rispondendo a %2$@, %3$@ & %1$d altri</string> </dict> </dict> <key>reposts_count</key> @@ -114,6 +122,8 @@ <string>d</string> <key>one</key> <string>Repost</string> + <key>many</key> + <string>I Repost</string> <key>other</key> <string>I Repost</string> </dict> @@ -130,6 +140,8 @@ <string>@</string> <key>one</key> <string>%2$@ sat</string> + <key>many</key> + <string>%2$@ sats</string> <key>other</key> <string>%2$@ sats</string> </dict> @@ -146,6 +158,8 @@ <string>d</string> <key>one</key> <string>Zap</string> + <key>many</key> + <string>Zaps</string> <key>other</key> <string>Zaps</string> </dict> diff --git a/damus/ja.lproj/InfoPlist.strings b/damus/ja.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/ja.lproj/Localizable.strings b/damus/ja.lproj/Localizable.strings Binary files differ. diff --git a/damus/ja.lproj/Localizable.stringsdict b/damus/ja.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,13 +13,13 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>other</key> - <string>%d その他のNote</string> + <string>... %d その他のNote ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -27,8 +29,6 @@ <key>other</key> <string>フォロワー</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -61,7 +61,7 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>%@%#@OTHERS@ にリプライ</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -69,15 +69,13 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>other</key> - <string> & %d その他</string> - <key>zero</key> - <string></string> + <string>%2$@ & %1$d その他にリプライ</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>%@, %@%#@OTHERS@ にリプライ</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -85,9 +83,7 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>other</key> - <string> & %d その他</string> - <key>zero</key> - <string></string> + <string>%2$@, %3$@ & %1$d その他 にリプライ</string> </dict> </dict> <key>reposts_count</key> diff --git a/damus/lv-LV.lproj/Localizable.stringsdict b/damus/lv-LV.lproj/Localizable.stringsdict @@ -4,164 +4,164 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>... %d other notes ...</string> <key>one</key> - <string>%d cita ziņa</string> + <string>... %d cita ziņa ...</string> <key>other</key> - <string>%d citas ziņas</string> - <key>zero</key> - <string>%d other notes</string> + <string>... %d citas ziņas ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· Ziņas ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>Followers</string> <key>one</key> <string>Sekotājs</string> <key>other</key> <string>Sekotāji</string> - <key>zero</key> - <string>Followers</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>Sekotāji</string> </dict> <key>reactions_count</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Reakcijas</string> + <string>%#@REACTIONS@</string> <key>REACTIONS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>Reactions</string> <key>one</key> <string>Reakcija</string> <key>other</key> <string>Reakcijas</string> - <key>zero</key> - <string>Reactions</string> </dict> </dict> <key>relays_count</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Releji</string> + <string>%#@RELAYS@</string> <key>RELAYS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>Relays</string> <key>one</key> <string>Relejs</string> <key>other</key> <string>Releji</string> - <key>zero</key> - <string>Relays</string> </dict> </dict> <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Atbildot %@% #Citam</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>Atbildot %2$@ & %1$d others</string> <key>one</key> - <string> & %d cits</string> + <string>Atbildot %2$@ & %1$d cits</string> <key>other</key> - <string> & %d citiem</string> - <key>zero</key> - <string></string> + <string>Atbildot %2$@ & %1$d citiem</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Atbildot %@, %@%#Citiem</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>Atbildot %2$@, %3$@ & %1$d others</string> <key>one</key> - <string> & %d cits</string> + <string>Atbildot %2$@, %3$@ & %1$d cits</string> <key>other</key> - <string> & %d citiem</string> - <key>zero</key> - <string></string> + <string>Atbildot %2$@, %3$@ & %1$d citiem</string> </dict> </dict> <key>reposts_count</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Pārpublicējumi</string> + <string>%#@REPOSTS@</string> <key>REPOSTS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>Reposts</string> <key>one</key> <string>Pārpublicēt</string> <key>other</key> <string>Pārpublicējumi</string> - <key>zero</key> - <string>Reposts</string> </dict> </dict> <key>sats_count</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>%1$#@Sats@</string> + <string>%1$#@SATS@</string> <key>SATS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>@</string> + <key>zero</key> + <string>%2$@ sats</string> <key>one</key> <string>%2$@ sati</string> <key>other</key> <string>%2$@ sati</string> - <key>zero</key> - <string>%2$@ sats</string> </dict> </dict> <key>zaps_count</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Zapi</string> + <string>%#@ZAPS@</string> <key>ZAPS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>zero</key> + <string>Zaps</string> <key>one</key> <string>Zaps</string> <key>other</key> <string>Zapi</string> - <key>zero</key> - <string>Zaps</string> </dict> </dict> </dict> diff --git a/damus/nl.lproj/InfoPlist.strings b/damus/nl.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/nl.lproj/Localizable.strings b/damus/nl.lproj/Localizable.strings Binary files differ. diff --git a/damus/nl.lproj/Localizable.stringsdict b/damus/nl.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,15 +13,15 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>%d andere notitie</string> + <string>... %d andere notitie ...</string> <key>other</key> - <string>%d andere notities</string> + <string>... %d andere notities ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -31,8 +33,6 @@ <key>other</key> <string>Volgers</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -69,7 +69,7 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Antwoord aan %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -77,17 +77,15 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>en %d andere gebruiker</string> + <string>Antwoord aan %2$@ en %1$d andere gebruiker</string> <key>other</key> - <string>en %d andere gebruikers</string> - <key>zero</key> - <string></string> + <string>Antwoord aan %2$@ en %1$d andere gebruikers</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Antwoord aan %@ en %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -95,11 +93,9 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>en %d andere gebruiker</string> + <string>Antwoord aan %2$@, %3$@ en %1$d andere gebruiker</string> <key>other</key> - <string>en %d andere gebruikers</string> - <key>zero</key> - <string></string> + <string>Antwoord aan %2$@, %3$@ en %1$d andere gebruikers</string> </dict> </dict> <key>reposts_count</key> diff --git a/damus/pl-PL.lproj/InfoPlist.strings b/damus/pl-PL.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/pl-PL.lproj/Localizable.stringsdict b/damus/pl-PL.lproj/Localizable.stringsdict @@ -4,43 +4,43 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>... %d inna notatka ...</string> <key>few</key> - <string>%d other notes</string> + <string>... %d other notes ...</string> <key>many</key> - <string>%d other notes</string> - <key>one</key> - <string>%d inna notatka</string> + <string>... %d other notes ...</string> <key>other</key> - <string>%d inne notatki</string> + <string>... %d inne notatki ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Obserwujący</string> <key>few</key> <string>Followers</string> <key>many</key> <string>Followers</string> - <key>one</key> - <string>Obserwujący</string> <key>other</key> <string>Obserwujący</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -52,12 +52,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Reakcja</string> <key>few</key> <string>Reactions</string> <key>many</key> <string>Reactions</string> - <key>one</key> - <string>Reakcja</string> <key>other</key> <string>Reakcje</string> </dict> @@ -72,12 +72,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Przekaźnik</string> <key>few</key> <string>Relays</string> <key>many</key> <string>Relays</string> - <key>one</key> - <string>Przekaźnik</string> <key>other</key> <string>Przekaźników</string> </dict> @@ -85,45 +85,41 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>W odpowiedzi do %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>W odpowiedzi do %2$@ i %1$d innej osobie</string> <key>few</key> - <string> & %d others</string> + <string>W odpowiedzi do %2$@ i %1$d others</string> <key>many</key> - <string> & %d others</string> - <key>one</key> - <string> i %d innej osobie</string> + <string>W odpowiedzi do %2$@ i %1$d others</string> <key>other</key> - <string> i %d innym osobom</string> - <key>zero</key> - <string></string> + <string>W odpowiedzi do %2$@ i %1$d innym osobom</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>W odpowiedzi do %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Replying to %2$@, %3$@ i %1$d innej osoba</string> <key>few</key> - <string> & %d others</string> + <string>Replying to %2$@, %3$@ i %1$d others</string> <key>many</key> - <string> & %d others</string> - <key>one</key> - <string> i %d innej osoba</string> + <string>Replying to %2$@, %3$@ i %1$d others</string> <key>other</key> - <string> i %d innym osobom</string> - <key>zero</key> - <string></string> + <string>Replying to %2$@, %3$@ i %1$d innym osobom</string> </dict> </dict> <key>reposts_count</key> @@ -136,12 +132,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Podany dalej</string> <key>few</key> <string>Reposts</string> <key>many</key> <string>Reposts</string> - <key>one</key> - <string>Podany dalej</string> <key>other</key> <string>Podane dalej</string> </dict> @@ -156,12 +152,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>@</string> + <key>one</key> + <string>%2$@ sat</string> <key>few</key> <string>%2$@ sats</string> <key>many</key> <string>%2$@ sats</string> - <key>one</key> - <string>%2$@ sat</string> <key>other</key> <string>%2$@ satoszy</string> </dict> @@ -176,12 +172,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Zap</string> <key>few</key> <string>Zaps</string> <key>many</key> <string>Zaps</string> - <key>one</key> - <string>Zap</string> <key>other</key> <string>Zapów</string> </dict> diff --git a/damus/pt-PT.lproj/InfoPlist.strings b/damus/pt-PT.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/pt-PT.lproj/Localizable.strings b/damus/pt-PT.lproj/Localizable.strings Binary files differ. diff --git a/damus/pt-PT.lproj/Localizable.stringsdict b/damus/pt-PT.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,15 +13,17 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>%d outro note</string> + <string>... %d outro note ...</string> + <key>many</key> + <string>... %d outros notes ...</string> <key>other</key> - <string>%d outros notes</string> + <string>... %d outros notes ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -28,11 +32,11 @@ <string>d</string> <key>one</key> <string>Seguidor</string> + <key>many</key> + <string>Seguidores</string> <key>other</key> <string>Seguidores</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -46,6 +50,8 @@ <string>d</string> <key>one</key> <string>Reação</string> + <key>many</key> + <string>Reações</string> <key>other</key> <string>Reações</string> </dict> @@ -62,6 +68,8 @@ <string>d</string> <key>one</key> <string>Relay</string> + <key>many</key> + <string>Relays</string> <key>other</key> <string>Relays</string> </dict> @@ -69,7 +77,7 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Respondendo a %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -77,17 +85,17 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d outros</string> + <string>Respondendo a %2$@ & %1$d outros</string> + <key>many</key> + <string>Respondendo a %2$@ & %1$d outros</string> <key>other</key> - <string> & %d outros</string> - <key>zero</key> - <string></string> + <string>Respondendo a %2$@ & %1$d outros</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Respondendo a %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -95,11 +103,11 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string> & %d outros</string> + <string>Respondendo a %2$@, %3$@ & %1$d outros</string> + <key>many</key> + <string>Respondendo a %2$@, %3$@ & %1$d outros</string> <key>other</key> - <string> & %d outros</string> - <key>zero</key> - <string></string> + <string>Respondendo a %2$@, %3$@ & %1$d outros</string> </dict> </dict> <key>reposts_count</key> @@ -114,6 +122,8 @@ <string>d</string> <key>one</key> <string>Repost</string> + <key>many</key> + <string>Reposts</string> <key>other</key> <string>Reposts</string> </dict> @@ -130,6 +140,8 @@ <string>@</string> <key>one</key> <string>%2$@ sat</string> + <key>many</key> + <string>%2$@ sats</string> <key>other</key> <string>%2$@ sats</string> </dict> @@ -146,6 +158,8 @@ <string>d</string> <key>one</key> <string>Zap</string> + <key>many</key> + <string>Zaps</string> <key>other</key> <string>Zaps</string> </dict> diff --git a/damus/ru.lproj/InfoPlist.strings b/damus/ru.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/ru.lproj/Localizable.stringsdict b/damus/ru.lproj/Localizable.stringsdict @@ -4,43 +4,43 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>... %d другая заметка ...</string> <key>few</key> - <string>%d other notes</string> + <string>... %d other notes ...</string> <key>many</key> - <string>%d other notes</string> - <key>one</key> - <string>%d другая заметка</string> + <string>... %d other notes ...</string> <key>other</key> - <string>%d другие заметки</string> + <string>... %d другие заметки ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Подписчик</string> <key>few</key> <string>Followers</string> <key>many</key> <string>Followers</string> - <key>one</key> - <string>Подписчик</string> <key>other</key> <string>Подписчики</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -52,12 +52,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Реакция</string> <key>few</key> <string>Reactions</string> <key>many</key> <string>Reactions</string> - <key>one</key> - <string>Реакция</string> <key>other</key> <string>Реакции</string> </dict> @@ -72,12 +72,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Релей</string> <key>few</key> <string>Relays</string> <key>many</key> <string>Relays</string> - <key>one</key> - <string>Релей</string> <key>other</key> <string>Релеи</string> </dict> @@ -85,45 +85,41 @@ <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>Replying to %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>В ответ %2$@ и %1$d другим</string> <key>few</key> - <string> & %d others</string> + <string>В ответ %2$@ и %1$d others</string> <key>many</key> - <string> & %d others</string> - <key>one</key> - <string> и %d другим</string> + <string>В ответ %2$@ и %1$d others</string> <key>other</key> - <string> и %d другие</string> - <key>zero</key> - <string></string> + <string>В ответ %2$@ и %1$d другие</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>В ответ %@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>В ответ %2$@, %3$@ и %1$d другим</string> <key>few</key> - <string> & %d others</string> + <string>В ответ %2$@, %3$@ и %1$d others</string> <key>many</key> - <string> & %d others</string> - <key>one</key> - <string> и %d другим</string> + <string>В ответ %2$@, %3$@ и %1$d others</string> <key>other</key> - <string> и %d другие</string> - <key>zero</key> - <string></string> + <string>В ответ %2$@, %3$@ и %1$d другие</string> </dict> </dict> <key>reposts_count</key> @@ -136,12 +132,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Репост</string> <key>few</key> <string>Reposts</string> <key>many</key> <string>Reposts</string> - <key>one</key> - <string>Репост</string> <key>other</key> <string>Репосты</string> </dict> @@ -156,12 +152,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>@</string> + <key>one</key> + <string>%2$@ сат</string> <key>few</key> <string>%2$@ sats</string> <key>many</key> <string>%2$@ sats</string> - <key>one</key> - <string>%2$@ сат</string> <key>other</key> <string>%2$@ сат</string> </dict> @@ -176,12 +172,12 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> + <key>one</key> + <string>Зап</string> <key>few</key> <string>Zaps</string> <key>many</key> <string>Zaps</string> - <key>one</key> - <string>Зап</string> <key>other</key> <string>Запы</string> </dict> diff --git a/damus/tr-TR.lproj/InfoPlist.strings b/damus/tr-TR.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/tr-TR.lproj/Localizable.strings b/damus/tr-TR.lproj/Localizable.strings Binary files differ. diff --git a/damus/tr-TR.lproj/Localizable.stringsdict b/damus/tr-TR.lproj/Localizable.stringsdict @@ -4,6 +4,8 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -11,15 +13,15 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>%d diğer not</string> + <string>... %d diğer not ...</string> <key>other</key> - <string>%d diğer notlar</string> + <string>... %d diğer notlar ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -29,10 +31,8 @@ <key>one</key> <string>Takipçi</string> <key>other</key> - <string>Takipçiler</string> + <string>Takipçi</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -47,7 +47,7 @@ <key>one</key> <string>Tepki</string> <key>other</key> - <string>Tepkiler</string> + <string>Tepki</string> </dict> </dict> <key>relays_count</key> @@ -63,13 +63,13 @@ <key>one</key> <string>Röle</string> <key>other</key> - <string>Röleler</string> + <string>Röle</string> </dict> </dict> <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>%@%#@OTHERS@'lara yanıt</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -77,17 +77,15 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>& %d diğer</string> + <string>%2$@ & %1$d diğer'lara yanıt</string> <key>other</key> - <string>& %d diğerleri</string> - <key>zero</key> - <string></string> + <string>%2$@ & %1$d ve diğerlerine yanıt</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>%@, %@%#@OTHERS@'a yanıt</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> @@ -95,11 +93,9 @@ <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> - <string>& %d diğer</string> + <string>%2$@, %3$@ & %1$d diğer'a yanıt</string> <key>other</key> - <string>& %d diğerleri</string> - <key>zero</key> - <string></string> + <string>%2$@, %3$@ & %1$d ve diğerlerine yanıt</string> </dict> </dict> <key>reposts_count</key> @@ -115,7 +111,7 @@ <key>one</key> <string>Yineleme</string> <key>other</key> - <string>Yinelemeler</string> + <string>Yineleme</string> </dict> </dict> <key>sats_count</key> @@ -131,7 +127,7 @@ <key>one</key> <string>%2$@ sat</string> <key>other</key> - <string>%2$@ sat</string> + <string>%2$@ sats</string> </dict> </dict> <key>zaps_count</key> diff --git a/damus/zh-CN.lproj/InfoPlist.strings b/damus/zh-CN.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/zh-CN.lproj/Localizable.strings b/damus/zh-CN.lproj/Localizable.strings Binary files differ. diff --git a/damus/zh-CN.lproj/Localizable.stringsdict b/damus/zh-CN.lproj/Localizable.stringsdict @@ -4,51 +4,31 @@ <dict> <key>collapsed_event_view_other_notes</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> <key>NOTES</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>%d other notes</string> - <key>many</key> - <string>%d other notes</string> - <key>one</key> - <string>%d 条更多推文</string> <key>other</key> - <string>%d 条更多推文</string> - <key>two</key> - <string>%d other notes</string> - <key>zero</key> - <string>%d other notes</string> + <string>... %d 条更多推 ...</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>··· %#@NOTES@ ···</string> </dict> <key>followers_count</key> <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> <key>FOLLOWERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>Followers</string> - <key>many</key> - <string>Followers</string> - <key>one</key> - <string>粉丝</string> <key>other</key> <string>粉丝</string> - <key>two</key> - <string>Followers</string> - <key>zero</key> - <string>Followers</string> </dict> - <key>NSStringLocalizedFormatKey</key> - <string>%#@FOLLOWERS@</string> </dict> <key>reactions_count</key> <dict> @@ -60,18 +40,8 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>Reactions</string> - <key>many</key> - <string>Reactions</string> - <key>one</key> - <string>回应</string> <key>other</key> <string>回应</string> - <key>two</key> - <string>Reactions</string> - <key>zero</key> - <string>Reactions</string> </dict> </dict> <key>relays_count</key> @@ -84,66 +54,36 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>Relays</string> - <key>many</key> - <string>Relays</string> - <key>one</key> - <string>中继器</string> <key>other</key> <string>中继器</string> - <key>two</key> - <string>Relays</string> - <key>zero</key> - <string>Relays</string> </dict> </dict> <key>replying_to_one_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>正在回复%@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string> & %d others</string> - <key>many</key> - <string> & %d others</string> - <key>one</key> - <string> & %d 个其他用户</string> <key>other</key> - <string> & %d 个其他用户</string> - <key>two</key> - <string> & %d others</string> - <key>zero</key> - <string></string> + <string>正在回复%2$@ & %1$d 个其他用户</string> </dict> </dict> <key>replying_to_two_and_others</key> <dict> <key>NSStringLocalizedFormatKey</key> - <string>正在回复%@, %@%#@OTHERS@</string> + <string>%#@OTHERS@</string> <key>OTHERS</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string> & %d others</string> - <key>many</key> - <string> & %d others</string> - <key>one</key> - <string> & %d 个其他用户</string> <key>other</key> - <string> & %d 个其他用户</string> - <key>two</key> - <string> & %d others</string> - <key>zero</key> - <string></string> + <string>正在回复%2$@, %3$@ & %1$d 个其他用户</string> </dict> </dict> <key>reposts_count</key> @@ -156,18 +96,8 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>Reposts</string> - <key>many</key> - <string>Reposts</string> - <key>one</key> - <string>转发</string> <key>other</key> <string>转发</string> - <key>two</key> - <string>Reposts</string> - <key>zero</key> - <string>Reposts</string> </dict> </dict> <key>sats_count</key> @@ -180,18 +110,8 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>@</string> - <key>few</key> - <string>%2$@ sats</string> - <key>many</key> - <string>%2$@ sats</string> - <key>one</key> - <string>%2$@ 聪</string> <key>other</key> <string>%2$@ 聪</string> - <key>two</key> - <string>%2$@ sats</string> - <key>zero</key> - <string>%2$@ sats</string> </dict> </dict> <key>zaps_count</key> @@ -204,18 +124,8 @@ <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> - <key>few</key> - <string>Zaps</string> - <key>many</key> - <string>Zaps</string> - <key>one</key> - <string>电击</string> <key>other</key> <string>电击</string> - <key>two</key> - <string>Zaps</string> - <key>zero</key> - <string>Zaps</string> </dict> </dict> </dict> diff --git a/damus/zh-HK.lproj/InfoPlist.strings b/damus/zh-HK.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/zh-HK.lproj/Localizable.strings b/damus/zh-HK.lproj/Localizable.strings Binary files differ. diff --git a/damus/zh-HK.lproj/Localizable.stringsdict b/damus/zh-HK.lproj/Localizable.stringsdict @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>collapsed_event_view_other_notes</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> + <key>NOTES</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>...還有%d 条便條...</string> + </dict> + </dict> + <key>followers_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> + <key>FOLLOWERS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>粉絲</string> + </dict> + </dict> + <key>reactions_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@REACTIONS@</string> + <key>REACTIONS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>回應</string> + </dict> + </dict> + <key>relays_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@RELAYS@</string> + <key>RELAYS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>中繼器</string> + </dict> + </dict> + <key>replying_to_one_and_others</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@OTHERS@</string> + <key>OTHERS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>正在回覆%2$@ & %1$d 個其他用戶</string> + </dict> + </dict> + <key>replying_to_two_and_others</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@OTHERS@</string> + <key>OTHERS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>正在回覆%2$@, %3$@ & %1$d 個其他用戶</string> + </dict> + </dict> + <key>reposts_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@REPOSTS@</string> + <key>REPOSTS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>轉發</string> + </dict> + </dict> + <key>sats_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%1$#@SATS@</string> + <key>SATS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>@</string> + <key>other</key> + <string>%2$@ 聰</string> + </dict> + </dict> + <key>zaps_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@ZAPS@</string> + <key>ZAPS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>電擊</string> + </dict> + </dict> +</dict> +</plist> diff --git a/damus/zh-TW.lproj/InfoPlist.strings b/damus/zh-TW.lproj/InfoPlist.strings Binary files differ. diff --git a/damus/zh-TW.lproj/Localizable.strings b/damus/zh-TW.lproj/Localizable.strings Binary files differ. diff --git a/damus/zh-TW.lproj/Localizable.stringsdict b/damus/zh-TW.lproj/Localizable.stringsdict @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>collapsed_event_view_other_notes</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@NOTES@</string> + <key>NOTES</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>...還有%d 条便條...</string> + </dict> + </dict> + <key>followers_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@FOLLOWERS@</string> + <key>FOLLOWERS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>粉絲</string> + </dict> + </dict> + <key>reactions_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@REACTIONS@</string> + <key>REACTIONS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>回應</string> + </dict> + </dict> + <key>relays_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@RELAYS@</string> + <key>RELAYS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>中繼器</string> + </dict> + </dict> + <key>replying_to_one_and_others</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@OTHERS@</string> + <key>OTHERS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>正在回覆%2$@ & %1$d 個其他用戶</string> + </dict> + </dict> + <key>replying_to_two_and_others</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@OTHERS@</string> + <key>OTHERS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>正在回覆%2$@, %3$@ & %1$d 個其他用戶</string> + </dict> + </dict> + <key>reposts_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@REPOSTS@</string> + <key>REPOSTS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>轉發</string> + </dict> + </dict> + <key>sats_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%1$#@SATS@</string> + <key>SATS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>@</string> + <key>other</key> + <string>%2$@ 聰</string> + </dict> + </dict> + <key>zaps_count</key> + <dict> + <key>NSStringLocalizedFormatKey</key> + <string>%#@ZAPS@</string> + <key>ZAPS</key> + <dict> + <key>NSStringFormatSpecTypeKey</key> + <string>NSStringPluralRuleType</string> + <key>NSStringFormatValueTypeKey</key> + <string>d</string> + <key>other</key> + <string>電擊</string> + </dict> + </dict> +</dict> +</plist> diff --git a/damusTests/EventDetailBarTests.swift 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 @@ -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 @@ -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 @@ -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 @@ -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")