From 51f94cf1357c8ab80d8bdc1eb66fcf23cd80018f Mon Sep 17 00:00:00 2001 From: Terry Yiu <963907+tyiu@users.noreply.github.com> Date: Thu, 26 Jan 2023 22:50:45 -0500 Subject: [PATCH] Add missing comments to localized strings, reorder buttons, mark destructive buttons --- .../Localized Contents/en-US.xliff | 168 +++++++++++++++++- .../damus/en-US.lproj/Localizable.strings | Bin 22700 -> 26904 bytes damus/ContentView.swift | 43 +++-- damus/Views/ConfigView.swift | 4 +- damus/Views/EULAView.swift | 8 +- damus/Views/Events/EventMenu.swift | 4 +- damus/Views/Muting/MutelistView.swift | 2 +- damus/Views/ProfileView.swift | 8 +- damus/Views/ReportView.swift | 22 +-- damus/Views/SideMenuView.swift | 4 +- 10 files changed, 207 insertions(+), 56 deletions(-) diff --git a/damus Localizations/en-US.xcloc/Localized Contents/en-US.xliff b/damus Localizations/en-US.xcloc/Localized Contents/en-US.xliff index 7d2167f2..cbe377ed 100644 --- a/damus Localizations/en-US.xcloc/Localized Contents/en-US.xliff +++ b/damus Localizations/en-US.xcloc/Localized Contents/en-US.xliff @@ -41,9 +41,14 @@ Abbreviated version of a nostr public key. %@ %@ %@ %@ - 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'. + Sentence composed of 2 variables to describe how many tip payments there are on a post. In source English, the first variable is the number of tip payments, and the second variable is 'Tip' or 'Tips'. 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'. + + %@ has been blocked + %@ has been blocked + Alert message that informs a user was blocked. + %@. Creating an account doesn't require a phone number, email or name. Get started right away with zero friction. %@. Creating an account doesn't require a phone number, email or name. Get started right away with zero friction. @@ -62,7 +67,7 @@ Sentence composed of 2 variables to describe how many profiles a user is followi %lld %lld - Number of reposts. + Number of tip payments on a post. Number of profiles a user is following. @@ -115,11 +120,21 @@ Number of profiles a user is following. Absolute Boss Placeholder text for About Me description. + + Accept + Accept + Button to accept the end user license agreement before being allowed into the app. + Account ID Account ID Label to indicate the public ID of the account. + + Actions + Actions + Title for confirmation dialog to either share, report, or block a profile. + Add Add @@ -171,6 +186,33 @@ Number of profiles a user is following. Blixt Wallet Dropdown option label for Lightning wallet, Blixt Wallet + + Block + Block + Alert button to block a user. + Button to block a profile. + Context menu option for blocking users. + + + Block %@? + Block %@? + Alert message prompt to ask if a user should be blocked. + + + Block User + Block User + Title of alert for blocking a user. + + + Blocked + Blocked + Sidebar menu label for Profile view. + + + Blocked Users + Blocked Users + Navigation title of view to see list of blocked users. + Blue Wallet Blue Wallet @@ -189,7 +231,9 @@ Number of profiles a user is following. Cancel Cancel - Button to cancel out of posting a note. + Alert button to cancel out of alert for blocking a user. + Button to cancel out of alert that creates a new mutelist. + Button to cancel out of posting a note. Button to cancel out of reposting a post. Button to cancel out of view adding user inputted relay. Cancel out of logging out the user. @@ -255,14 +299,19 @@ Number of profiles a user is following. Copy Note JSON Context menu option for copying the JSON text from the note. + + Copy Report ID + Copy Report ID + Button to copy report ID. + Copy Text Copy Text Context menu option for copying the text from an note. - - Copy User ID - Copy User ID + + Copy User Pubkey + Copy User Pubkey Context menu option for copying the ID of the user who created the note. @@ -270,6 +319,11 @@ Number of profiles a user is following. Copy invoice Title of section for copying a Lightning invoice identifier. + + Could not find user to block... + Could not find user to block... + Alert message to indicate that the blocked user could not be found. + Create Create @@ -280,6 +334,11 @@ Number of profiles a user is following. Create Account Button to create an account. + + Create new mutelist + Create new mutelist + Title of alert prompting the user to create a new mutelist. + Creator(s) of Bitcoin. Absolute legend. Creator(s) of Bitcoin. Absolute legend. @@ -309,7 +368,8 @@ Number of profiles a user is following. Delete Delete - Button to delete a relay server that the user connects to. + Button to delete a relay server that the user connects to. + Button to remove a user from their blocklist. Dismiss @@ -326,6 +386,11 @@ Number of profiles a user is following. Done Button to dismiss wallet selection view for paying Lightning invoice. + + EULA + EULA + Label indicating that the below text is the EULA, an acronym for End User License Agreement. + Earn Money Earn Money @@ -407,11 +472,21 @@ Part of a larger sentence to describe how many profiles a user is following.Home Navigation bar title for Home view where posts and replies appear from those who the user is following. + + Illegal content + Illegal content + Button for user to report that the account or content has illegal content. + Invalid key Invalid key Error message indicating that an invalid account key was entered for login. + + It's spam + It's spam + Button for user to report that the account or content has spam. + LNLink LNLink @@ -470,6 +545,11 @@ Part of a larger sentence to describe how many profiles a user is following.NIP-05 Verification Label for NIP-05 Verification section of user profile form. + + No block list found, create a new one? This will overwrite any previous block lists. + No block list found, create a new one? This will overwrite any previous block lists. + Alert message prompt that asks if the user wants to create a new block list, overwriting previous block lists. + Nothing to see here. Check back later! Nothing to see here. Check back later! @@ -480,6 +560,11 @@ Part of a larger sentence to describe how many profiles a user is following.Notifications Navigation title for notifications. + + Nudity or explicit content + Nudity or explicit content + Button for user to report that the account or content has nudity or explicit content. + Pay Pay @@ -560,6 +645,11 @@ Part of a larger sentence to describe how many profiles a user is following.Recommended Relays Section title for recommend relay servers that could be added as part of configuration + + Reject + Reject + Button to reject the end user license agreement, which disallows the user from being let into the app. + Relay Relay @@ -570,6 +660,11 @@ Part of a larger sentence to describe how many profiles a user is following.Relays Sidebar menu label for Relay servers view + + Relays have been notified and clients will be able to use this information to filter content. Thank you! + Relays have been notified and clients will be able to use this information to filter content. Thank you! + Description of what was done as a result of sending a report to relay servers. + Remove all Remove all @@ -590,6 +685,22 @@ Part of a larger sentence to describe how many profiles a user is following.Replying to: Indicating that the user is replying to the following listed people. + + Report + Report + Button to report a profile. + Context menu option for reporting content. + + + Report ID: + Report ID: + Label indicating that the text underneath is the identifier of the report that was sent to relay servers. + + + Report sent! + Report sent! + Message indicating that a report was successfully sent to relay servers. + Repost Repost @@ -601,6 +712,11 @@ Part of a larger sentence to describe how many profiles a user is following.Reposted Text indicating that the post was reposted (i.e. re-shared). + + Reposts + Reposts + Navigation bar title for Reposts view. + Requests Requests @@ -675,7 +791,8 @@ Part of a larger sentence to describe how many profiles a user is following. Share Share - Button to share an image. + Button to share an image. + Button to share the link to a profile. Show @@ -697,6 +814,16 @@ Part of a larger sentence to describe how many profiles a user is following.Strike Dropdown option label for Lightning wallet, Strike. + + Thanks! + Thanks! + Button to close out of alert that informs that the action to block a user was successful. + + + They are impersonating someone + They are impersonating someone + Button for user to report that the account is impersonating someone. + This is a public key, you will not be able to make posts or interact in any way. This is used for viewing accounts from their perspective. This is a public key, you will not be able to make posts or interact in any way. This is used for viewing accounts from their perspective. @@ -748,6 +875,16 @@ Part of a larger sentence to describe how many profiles a user is following.Unfollows Text to indicate that the button next to it is in a state that will unfollow a profile when tapped. + + User blocked + User blocked + Alert message to indicate + + + User has been blocked + User has been blocked + Alert message that informs a user was blocked. + Username Username @@ -784,11 +921,26 @@ Part of a larger sentence to describe how many profiles a user is following.Welcome, %@! Text to welcome user. + + What do you want to report? + What do you want to report? + Header text to prompt user what issue they want to report. + + + Yes, Overwrite + Yes, Overwrite + Text of button that confirms to overwrite the existing mutelist. + Your Name Your Name Label for Your Name section of user profile form. + + Your report will be sent to the relays you are connected to + Your report will be sent to the relays you are connected to + Footer text to inform user what will happen when the report is submitted. + Zebedee Zebedee diff --git a/damus Localizations/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings b/damus Localizations/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings index 557c9a909968d83b2c294e5d90c990ebcf838633..76720d714094c41b42285053748966d105a1416b 100644 GIT binary patch delta 2872 zcmbtWOK%%h6uvI8lQ@1A+jWz%+i}t;5LK9xM2QH7I5bilXc7ukus~w!I;m;=sK-qR z2!-reA*8dZ*btfL8nO?`Y{#;X~0TZg?DQu35jPQ$Lk#m_g40;w% z3zc@V)AX(PLwb8MKxZR;r94EIVL}lml%TYZ6;pI5ElMLQ(j2K8rW706*+CPo8`AW% z_+r%<8FVlVh#IPG3~!`d70AG3j{lcD4oryQp)D^*G9R_nmT zVTmOBXecz)+u)&_F-R7`SS`NKn{Tw_K;E>a9)PLNaF1olV&eQkt zME_+Rmq|qTVyS`Vm#EW@7N@5NFIbC1Cp`lzkbD(6RS;Wr5RcP)n!km1FEv76Xul)N zA4jkQ{Z)8XL4H?hYd%GL+KIuARx;oeP9+9803EylcyA@OXonp#a#7OHN36Z%u7^JH zC0}I!N>I9iw}Qp#466-u?C!zE=Z3lwdn!?GnZTpb&D} zU1I7sd8s@9k`&!8!13w`_I7R{AC(pT^~6IT7uXHXm3Q#urJet0L~$qIL_YB-yN)%Z zV#;h%!^xzb`MBXEG!HbpQ*h=nPW-K!n{CPA$;G8^TkHVQq*8E2v+g|m&>MD@0Yvji zai+nOnUnr)8u2$`_)^&^Y}xcbn#xo(bA~+@DP{rV?$G z!I$M+RM@a9r>*Ks`^Pwh**sFM0;surRAeLNH%|h0 zn`S_HXe*Fa(=Nd#GzfW5amKk);!KhDp0o)$s>W_1)O^1&@mq!F^_FUUO=@JrO_6p@ zns)jueYcSA(zrN{*lILo=&Iq1Ta&tgs2dPd_@>14!XX>b`Xv?|@qZ&n#`$@$3=1~- zKZ&t2OB3?W5@h=rC%)Si$T*{=oy(YgdvJGlp55tJqrny$g?mS>jmsB$=+ugT+aC8k zJ2_~47jwd_lG(nmF@!3xYS7eBt2Kbi9p1?_?p*3JVV8t!GQ;?~8{B#Eru2yme_2j1 Uw@{}_x}2ipy(8BBD?fVv2IBf%O#lD@ delta 174 zcmbPniE+(F#tpMrCqMAen7n|kVRD1K$YwTw2@!#ZQ0Ro#BDKB8$yhL>a*JL-tCzC(0 zNKBrSDzI71IEE8!;y>F@Y?A}hxHh?cVx7Ft=h9?{xVXs<&Mcd2{Q5XI$3@%$+9ztX Yxi0nt^W+O0BAYpqJXpXCyYyR(0FdHCTmS$7 diff --git a/damus/ContentView.swift b/damus/ContentView.swift index bada26e5..1df96c83 100644 --- a/damus/ContentView.swift +++ b/damus/ContentView.swift @@ -434,21 +434,26 @@ struct ContentView: View { .onReceive(handle_notify(.new_mutes)) { notif in home.filter_muted() } - .alert("User blocked", isPresented: $user_blocked_confirm, actions: { - Button("Thanks!") { + .alert(NSLocalizedString("User blocked", comment: "Alert message to indicate "), isPresented: $user_blocked_confirm, actions: { + Button(NSLocalizedString("Thanks!", comment: "Button to close out of alert that informs that the action to block a user was successful.")) { user_blocked_confirm = false } }, message: { if let pubkey = self.blocking { let profile = damus_state!.profiles.lookup(id: pubkey) let name = Profile.displayName(profile: profile, pubkey: pubkey) - Text("\(name) has been blocked") + Text("\(name) has been blocked", comment: "Alert message that informs a user was blocked.") } else { - Text("User has been blocked") + Text("User has been blocked", comment: "Alert message that informs a user was blocked.") } }) - .alert("Create new mutelist", isPresented: $confirm_overwrite_mutelist, actions: { - Button("Yes, Overwrite") { + .alert(NSLocalizedString("Create new mutelist", comment: "Title of alert prompting the user to create a new mutelist."), isPresented: $confirm_overwrite_mutelist, actions: { + Button(NSLocalizedString("Cancel", comment: "Button to cancel out of alert that creates a new mutelist.")) { + confirm_overwrite_mutelist = false + confirm_block = false + } + + Button(NSLocalizedString("Yes, Overwrite", comment: "Text of button that confirms to overwrite the existing mutelist.")) { guard let ds = damus_state else { return } @@ -472,20 +477,18 @@ struct ContentView: View { confirm_block = false user_blocked_confirm = true } - - Button("Cancel") { - confirm_overwrite_mutelist = false + }, message: { + Text("No block list found, create a new one? This will overwrite any previous block lists.", comment: "Alert message prompt that asks if the user wants to create a new block list, overwriting previous block lists.") + }) + .alert(NSLocalizedString("Block User", comment: "Title of alert for blocking a user."), isPresented: $confirm_block, actions: { + Button(NSLocalizedString("Cancel", comment: "Alert button to cancel out of alert for blocking a user."), role: .cancel) { confirm_block = false } - }, message: { - Text("No block list found, create a new one? This will overwrite any previous block lists.") - }) - .alert("Block User", isPresented: $confirm_block, actions: { - Button("Block") { + Button(NSLocalizedString("Block", comment: "Alert button to block a user."), role: .destructive) { guard let ds = damus_state else { return } - + if ds.contacts.mutelist == nil { confirm_overwrite_mutelist = true } else { @@ -495,7 +498,7 @@ struct ContentView: View { guard let pubkey = blocking else { return } - + guard let ev = create_or_update_mutelist(keypair: keypair, mprev: ds.contacts.mutelist, to_add: pubkey) else { return } @@ -503,17 +506,13 @@ struct ContentView: View { ds.pool.send(.event(ev)) } } - - Button("Cancel") { - confirm_block = false - } }, message: { if let pubkey = blocking { let profile = damus_state?.profiles.lookup(id: pubkey) let name = Profile.displayName(profile: profile, pubkey: pubkey) - Text("Block \(name)?") + Text("Block \(name)?", comment: "Alert message prompt to ask if a user should be blocked.") } else { - Text("Could not find user to block...") + Text("Could not find user to block...", comment: "Alert message to indicate that the blocked user could not be found.") } }) } diff --git a/damus/Views/ConfigView.swift b/damus/Views/ConfigView.swift index 07d4b66b..f5861811 100644 --- a/damus/Views/ConfigView.swift +++ b/damus/Views/ConfigView.swift @@ -139,10 +139,10 @@ struct ConfigView: View { .navigationTitle(NSLocalizedString("Settings", comment: "Navigation title for Settings view.")) .navigationBarTitleDisplayMode(.large) .alert(NSLocalizedString("Logout", comment: "Alert for logging out the user."), isPresented: $confirm_logout) { - Button(NSLocalizedString("Cancel", comment: "Cancel out of logging out the user.")) { + Button(NSLocalizedString("Cancel", comment: "Cancel out of logging out the user."), role: .cancel) { confirm_logout = false } - Button(NSLocalizedString("Logout", comment: "Button for logging out the user.")) { + Button(NSLocalizedString("Logout", comment: "Button for logging out the user."), role: .destructive) { notify(.logout, ()) } } message: { diff --git a/damus/Views/EULAView.swift b/damus/Views/EULAView.swift index 3bdf1c3b..eae670f6 100644 --- a/damus/Views/EULAView.swift +++ b/damus/Views/EULAView.swift @@ -16,7 +16,7 @@ struct EULAView: View { DamusGradient() ScrollView { - Text("EULA") + Text("EULA", comment: "Label indicating that the below text is the EULA, an acronym for End User License Agreement.") .font(.title.bold()) .foregroundColor(.white) @@ -72,11 +72,11 @@ By using our Application, you signify your acceptance of this EULA. If you do no NavigationLink(destination: CreateAccountView(), isActive: $creating_account) { EmptyView() } - DamusWhiteButton("Accept") { + DamusWhiteButton(NSLocalizedString("Accept", comment: "Button to accept the end user license agreement before being allowed into the app.")) { creating_account = true } - - DamusWhiteButton("Reject") { + + DamusWhiteButton(NSLocalizedString("Reject", comment: "Button to reject the end user license agreement, which disallows the user from being let into the app.")) { dismiss() } } diff --git a/damus/Views/Events/EventMenu.swift b/damus/Views/Events/EventMenu.swift index 8ab2ead0..dc8ec18e 100644 --- a/damus/Views/Events/EventMenu.swift +++ b/damus/Views/Events/EventMenu.swift @@ -38,14 +38,14 @@ struct EventMenuContext: View { Label(NSLocalizedString("Copy Note JSON", comment: "Context menu option for copying the JSON text from the note."), systemImage: "square.on.square") } - Button { + Button(role: .destructive) { let target: ReportTarget = .note(ReportNoteTarget(pubkey: event.pubkey, note_id: event.id)) notify(.report, target) } label: { Label(NSLocalizedString("Report", comment: "Context menu option for reporting content."), systemImage: "exclamationmark.bubble") } - Button { + Button(role: .destructive) { notify(.block, event.pubkey) } label: { Label(NSLocalizedString("Block", comment: "Context menu option for blocking users."), systemImage: "exclamationmark.octagon") diff --git a/damus/Views/Muting/MutelistView.swift b/damus/Views/Muting/MutelistView.swift index c847e86c..bbdc157e 100644 --- a/damus/Views/Muting/MutelistView.swift +++ b/damus/Views/Muting/MutelistView.swift @@ -43,7 +43,7 @@ struct MutelistView: View { RemoveAction(pubkey: pubkey) } } - .navigationTitle("Blocked Users") + .navigationTitle(NSLocalizedString("Blocked Users", comment: "Navigation title of view to see list of blocked users.")) } } diff --git a/damus/Views/ProfileView.swift b/damus/Views/ProfileView.swift index 4bcd62c5..a48412ed 100644 --- a/damus/Views/ProfileView.swift +++ b/damus/Views/ProfileView.swift @@ -374,17 +374,17 @@ struct ProfileView: View { } } } - .confirmationDialog("Actions", isPresented: $action_sheet_presented) { - Button("Share") { + .confirmationDialog(NSLocalizedString("Actions", comment: "Title for confirmation dialog to either share, report, or block a profile."), isPresented: $action_sheet_presented) { + Button(NSLocalizedString("Share", comment: "Button to share the link to a profile.")) { show_share_sheet = true } - Button("Report") { + Button(NSLocalizedString("Report", comment: "Button to report a profile."), role: .destructive) { let target: ReportTarget = .user(profile.pubkey) notify(.report, target) } - Button("Block") { + Button(NSLocalizedString("Block", comment: "Button to block a profile."), role: .destructive) { notify(.block, profile.pubkey) } } diff --git a/damus/Views/ReportView.swift b/damus/Views/ReportView.swift index b3286bc5..d69a2873 100644 --- a/damus/Views/ReportView.swift +++ b/damus/Views/ReportView.swift @@ -25,16 +25,16 @@ struct ReportView: View { var Success: some View { VStack(alignment: .center, spacing: 20) { - Text("Report sent!") + Text("Report sent!", comment: "Message indicating that a report was successfully sent to relay servers.") .font(.headline) - Text("Relays have been notified and clients will be able to use this information to filter content. Thank you!") + Text("Relays have been notified and clients will be able to use this information to filter content. Thank you!", comment: "Description of what was done as a result of sending a report to relay servers.") - Text("Report ID:") + Text("Report ID:", comment: "Label indicating that the text underneath is the identifier of the report that was sent to relay servers.") Text(report_id) - Button("Copy Report ID") { + Button(NSLocalizedString("Copy Report ID", comment: "Button to copy report ID.")) { UIPasteboard.general.string = report_id let g = UIImpactFeedbackGenerator(style: .medium) g.impactOccurred() @@ -59,33 +59,33 @@ struct ReportView: View { var MainForm: some View { VStack { - Text("Report") + Text("Report", comment: "Label indicating that the current view is for the user to report content.") .font(.headline) .padding() Form { Section(content: { - Button("It's spam") { + Button(NSLocalizedString("It's spam", comment: "Button for user to report that the account or content has spam.")) { do_send_report(type: .spam) } - Button("Nudity or explicit content") { + Button(NSLocalizedString("Nudity or explicit content", comment: "Button for user to report that the account or content has nudity or explicit content.")) { do_send_report(type: .explicit) } - Button("Illegal content") { + Button(NSLocalizedString("Illegal content", comment: "Button for user to report that the account or content has illegal content.")) { do_send_report(type: .illegal) } if case .user = target { - Button("They are impersonating someone") { + Button(NSLocalizedString("They are impersonating someone", comment: "Button for user to report that the account is impersonating someone.")) { do_send_report(type: .impersonation) } } }, header: { - Text("What do you want to report?") + Text("What do you want to report?", comment: "Header text to prompt user what issue they want to report.") }, footer: { - Text("Your report will be sent to the relays you are connected to") + Text("Your report will be sent to the relays you are connected to", comment: "Footer text to inform user what will happen when the report is submitted.") }) } } diff --git a/damus/Views/SideMenuView.swift b/damus/Views/SideMenuView.swift index 9f9c72d0..6ce48dff 100644 --- a/damus/Views/SideMenuView.swift +++ b/damus/Views/SideMenuView.swift @@ -148,10 +148,10 @@ struct SideMenuView: View { isSidebarVisible.toggle() } .alert("Logout", isPresented: $confirm_logout) { - Button(NSLocalizedString("Cancel", comment: "Cancel out of logging out the user.")) { + Button(NSLocalizedString("Cancel", comment: "Cancel out of logging out the user."), role: .cancel) { confirm_logout = false } - Button(NSLocalizedString("Logout", comment: "Button for logging out the user.")) { + Button(NSLocalizedString("Logout", comment: "Button for logging out the user."), role: .destructive) { notify(.logout, ()) } } message: {