Add comments to localized strings
This commit is contained in:
@@ -41,24 +41,24 @@ struct ImageContextMenuModifier: ViewModifier {
|
|||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.url = url
|
UIPasteboard.general.url = url
|
||||||
} label: {
|
} label: {
|
||||||
Label("Copy Image URL", systemImage: "doc.on.doc")
|
Label(NSLocalizedString("Copy Image URL", comment: "Context menu option to copy the URL of an image into clipboard."), systemImage: "doc.on.doc")
|
||||||
}
|
}
|
||||||
if let someImage = image {
|
if let someImage = image {
|
||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.image = someImage
|
UIPasteboard.general.image = someImage
|
||||||
} label: {
|
} label: {
|
||||||
Label("Copy Image", systemImage: "photo.on.rectangle")
|
Label(NSLocalizedString("Copy Image", comment: "Context menu option to copy an image into clipboard."), systemImage: "photo.on.rectangle")
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
UIImageWriteToSavedPhotosAlbum(someImage, nil, nil, nil)
|
UIImageWriteToSavedPhotosAlbum(someImage, nil, nil, nil)
|
||||||
} label: {
|
} label: {
|
||||||
Label("Save Image", systemImage: "square.and.arrow.down")
|
Label(NSLocalizedString("Save Image", comment: "Context menu option to save an image."), systemImage: "square.and.arrow.down")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
showShareSheet = true
|
showShareSheet = true
|
||||||
} label: {
|
} label: {
|
||||||
Label("Share", systemImage: "square.and.arrow.up")
|
Label(NSLocalizedString("Share", comment: "Button to share an image."), systemImage: "square.and.arrow.up")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ struct ImageCarousel: View {
|
|||||||
}
|
}
|
||||||
.id(url.absoluteString)
|
.id(url.absoluteString)
|
||||||
.contextMenu {
|
.contextMenu {
|
||||||
Button("Copy Image") {
|
Button(NSLocalizedString("Copy Image", comment: "Context menu option to copy an image to clipboard.")) {
|
||||||
UIPasteboard.general.string = url.absoluteString
|
UIPasteboard.general.string = url.absoluteString
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ struct InvoiceView: View {
|
|||||||
RoundedRectangle(cornerRadius: 20)
|
RoundedRectangle(cornerRadius: 20)
|
||||||
.foregroundColor(colorScheme == .light ? .black : .white)
|
.foregroundColor(colorScheme == .light ? .black : .white)
|
||||||
.overlay {
|
.overlay {
|
||||||
Text("Pay")
|
Text("Pay", comment: "Button to pay a Lightning invoice.")
|
||||||
.fontWeight(.medium)
|
.fontWeight(.medium)
|
||||||
.foregroundColor(colorScheme == .light ? .white : .black)
|
.foregroundColor(colorScheme == .light ? .white : .black)
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ struct InvoiceView: View {
|
|||||||
HStack {
|
HStack {
|
||||||
Label("", systemImage: "bolt.fill")
|
Label("", systemImage: "bolt.fill")
|
||||||
.foregroundColor(.orange)
|
.foregroundColor(.orange)
|
||||||
Text("Lightning Invoice")
|
Text("Lightning Invoice", comment: "Indicates that the view is for paying a Lightning invoice.")
|
||||||
}
|
}
|
||||||
Divider()
|
Divider()
|
||||||
Text(invoice.description)
|
Text(invoice.description)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ struct TextFieldAlert<Presenting>: View where Presenting: View {
|
|||||||
.disabled(isShowing)
|
.disabled(isShowing)
|
||||||
VStack {
|
VStack {
|
||||||
Text(self.title)
|
Text(self.title)
|
||||||
TextField("Relay", text: self.$text)
|
TextField(NSLocalizedString("Relay", comment: "Text field for relay server. Used for testing purposes."), text: self.$text)
|
||||||
Divider()
|
Divider()
|
||||||
HStack {
|
HStack {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
@@ -28,7 +28,7 @@ struct TextFieldAlert<Presenting>: View where Presenting: View {
|
|||||||
self.isShowing.toggle()
|
self.isShowing.toggle()
|
||||||
}
|
}
|
||||||
}) {
|
}) {
|
||||||
Text("Dismiss")
|
Text("Dismiss", comment: "Button to dismiss a text field alert.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,9 +130,9 @@ struct ContentView: View {
|
|||||||
|
|
||||||
var FiltersView: some View {
|
var FiltersView: some View {
|
||||||
VStack{
|
VStack{
|
||||||
Picker("Filter State", selection: $filter_state) {
|
Picker(NSLocalizedString("Filter State", comment: "Filter state for seeing either only posts, or posts & replies."), selection: $filter_state) {
|
||||||
Text("Posts").tag(FilterState.posts)
|
Text("Posts", comment: "Label for filter for seeing only posts (instead of posts and replies).").tag(FilterState.posts)
|
||||||
Text("Posts & Replies").tag(FilterState.posts_and_replies)
|
Text("Posts & Replies", comment: "Label for filter for seeing posts and replies (instead of only posts).").tag(FilterState.posts_and_replies)
|
||||||
}
|
}
|
||||||
.pickerStyle(.segmented)
|
.pickerStyle(.segmented)
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ struct ContentView: View {
|
|||||||
|
|
||||||
case .notifications:
|
case .notifications:
|
||||||
TimelineView(events: $home.notifications, loading: $home.loading, damus: damus, show_friend_icon: true, filter: { _ in true })
|
TimelineView(events: $home.notifications, loading: $home.loading, damus: damus, show_friend_icon: true, filter: { _ in true })
|
||||||
.navigationTitle("Notifications")
|
.navigationTitle(NSLocalizedString("Notifications", comment: "Navigation title for notifications."))
|
||||||
|
|
||||||
case .dms:
|
case .dms:
|
||||||
DirectMessagesView(damus_state: damus_state!)
|
DirectMessagesView(damus_state: damus_state!)
|
||||||
@@ -168,7 +168,7 @@ struct ContentView: View {
|
|||||||
EmptyView()
|
EmptyView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationBarTitle(selected_timeline == .home ? "Home" : "Global", displayMode: .inline)
|
.navigationBarTitle(selected_timeline == .home ? NSLocalizedString("Home", comment: "Navigation bar title for Home view where posts and replies appear from those who the user is following.") : NSLocalizedString("Global", comment: "Navigation bar title for Global view where posts from all connected relay servers appear."), displayMode: .inline)
|
||||||
}
|
}
|
||||||
|
|
||||||
var MaybeSearchView: some View {
|
var MaybeSearchView: some View {
|
||||||
@@ -229,7 +229,7 @@ struct ContentView: View {
|
|||||||
ToolbarItem(placement: .navigationBarTrailing) {
|
ToolbarItem(placement: .navigationBarTrailing) {
|
||||||
HStack(alignment: .center) {
|
HStack(alignment: .center) {
|
||||||
if home.signal.signal != home.signal.max_signal {
|
if home.signal.signal != home.signal.max_signal {
|
||||||
Text("\(home.signal.signal)/\(home.signal.max_signal)")
|
Text("\(home.signal.signal)/\(home.signal.max_signal)", comment: "Fraction of how many of the user's relay servers that are operational.")
|
||||||
.font(.callout)
|
.font(.callout)
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ struct AddRelayView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Form {
|
Form {
|
||||||
Section("Add Relay") {
|
Section(NSLocalizedString("Add Relay", comment: "Label for section for adding a relay server.")) {
|
||||||
ZStack(alignment: .leading) {
|
ZStack(alignment: .leading) {
|
||||||
HStack{
|
HStack{
|
||||||
TextField("wss://some.relay.com", text: $relay)
|
TextField(NSLocalizedString("wss://some.relay.com", comment: "Placeholder example for relay server address."), text: $relay)
|
||||||
.padding(2)
|
.padding(2)
|
||||||
.padding(.leading, 25)
|
.padding(.leading, 25)
|
||||||
.autocorrectionDisabled(true)
|
.autocorrectionDisabled(true)
|
||||||
@@ -47,7 +47,7 @@ struct AddRelayView: View {
|
|||||||
|
|
||||||
VStack {
|
VStack {
|
||||||
HStack {
|
HStack {
|
||||||
Button("Cancel") {
|
Button(NSLocalizedString("Cancel", comment: "Button to cancel out of view adding user inputted relay.")) {
|
||||||
show_add_relay = false
|
show_add_relay = false
|
||||||
action(nil)
|
action(nil)
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ struct AddRelayView: View {
|
|||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Button("Add") {
|
Button(NSLocalizedString("Add", comment: "Button to confirm adding user inputted relay.")) {
|
||||||
show_add_relay = false
|
show_add_relay = false
|
||||||
action(relay)
|
action(relay)
|
||||||
relay = ""
|
relay = ""
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ struct CarouselItem: Identifiable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let carousel_items = [
|
let carousel_items = [
|
||||||
CarouselItem(image: Image("digital-nomad"), text: Text("Welcome to the social network \(Text("you").italic()) control.")),
|
CarouselItem(image: Image("digital-nomad"), text: Text("Welcome to the social network \(Text("you", comment: "You, in this context, is the person who controls their own social network. You is used in the context of a larger sentence that welcomes the reader to the social network that they control themself.").italic()) control.", comment: "Welcoming message to the reader. The variable is 'you', the reader.")),
|
||||||
CarouselItem(image: Image("encrypted-message"),
|
CarouselItem(image: Image("encrypted-message"),
|
||||||
text: Text("\(Text("Encrypted").bold()). End-to-End encrypted private messaging. Keep Big Tech out of your DMs")),
|
text: Text("\(Text("Encrypted", comment: "Heading indicating that this application keeps private messaging end-to-end encrypted.").bold()). End-to-End encrypted private messaging. Keep Big Tech out of your DMs", comment: "Explanation of what is done to keep private data encrypted. There is a heading that precedes this explanation which is a variable to this string.")),
|
||||||
CarouselItem(image: Image("undercover"),
|
CarouselItem(image: Image("undercover"),
|
||||||
text: Text("\(Text("Private").bold()). Creating an account doesn't require a phone number, email or name. Get started right away with zero friction.")),
|
text: Text("\(Text("Private", comment: "Heading indicating that this application keeps personally identifiable information private. A sentence describing what is done to keep data private comes after this heading.").bold()). Creating an account doesn't require a phone number, email or name. Get started right away with zero friction.", comment: "Explanation of what is done to keep personally identifiable information private. There is a heading that precedes this explanation which is a variable to this string.")),
|
||||||
CarouselItem(image: Image("bitcoin-p2p"),
|
CarouselItem(image: Image("bitcoin-p2p"),
|
||||||
text: Text("\(Text("Earn Money").bold()). Tip your friend's posts and stack sats with Bitcoin⚡️, the native currency of the internet."))
|
text: Text("\(Text("Earn Money", comment: "Heading indicating that this application allows users to earn money.").bold()). Tip your friend's posts and stack sats with Bitcoin⚡️, the native currency of the internet.", comment: "Explanation of what can be done by users to earn money. There is a heading that precedes this explanation which is a variable to this string."))
|
||||||
]
|
]
|
||||||
|
|
||||||
struct CarouselView: View {
|
struct CarouselView: View {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ struct ConfigView: View {
|
|||||||
}
|
}
|
||||||
} header: {
|
} header: {
|
||||||
HStack {
|
HStack {
|
||||||
Text("Relays")
|
Text("Relays", comment: "Header text for relay server list for configuration.")
|
||||||
Spacer()
|
Spacer()
|
||||||
Button(action: { show_add_relay = true }) {
|
Button(action: { show_add_relay = true }) {
|
||||||
Image(systemName: "plus")
|
Image(systemName: "plus")
|
||||||
@@ -70,13 +70,13 @@ struct ConfigView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Recommended Relays") {
|
Section(NSLocalizedString("Recommended Relays", comment: "Section title for recommend relay servers that could be added as part of configuration")) {
|
||||||
List(recommended, id: \.url) { r in
|
List(recommended, id: \.url) { r in
|
||||||
RecommendedRelayView(damus: state, relay: r.url.absoluteString)
|
RecommendedRelayView(damus: state, relay: r.url.absoluteString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Public Account ID") {
|
Section(NSLocalizedString("Public Account ID", comment: "Section title for the user's public account ID.")) {
|
||||||
HStack {
|
HStack {
|
||||||
Text(state.keypair.pubkey_bech32)
|
Text(state.keypair.pubkey_bech32)
|
||||||
|
|
||||||
@@ -86,10 +86,10 @@ struct ConfigView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let sec = state.keypair.privkey_bech32 {
|
if let sec = state.keypair.privkey_bech32 {
|
||||||
Section("Secret Account Login Key") {
|
Section(NSLocalizedString("Secret Account Login Key", comment: "Section title for user's secret account login key.")) {
|
||||||
HStack {
|
HStack {
|
||||||
if show_privkey == false {
|
if show_privkey == false {
|
||||||
SecureField("PrivateKey", text: $privkey)
|
SecureField(NSLocalizedString("PrivateKey", comment: "Title of the secure field that holds the user's private key."), text: $privkey)
|
||||||
.disabled(true)
|
.disabled(true)
|
||||||
} else {
|
} else {
|
||||||
Text(sec)
|
Text(sec)
|
||||||
@@ -99,13 +99,13 @@ struct ConfigView: View {
|
|||||||
CopyButton(is_pk: false)
|
CopyButton(is_pk: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
Toggle("Show", isOn: $show_privkey)
|
Toggle(NSLocalizedString("Show", comment: "Toggle to show or hide user's secret account login key."), isOn: $show_privkey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Wallet Selector") {
|
Section(NSLocalizedString("Wallet Selector", comment: "Section title for selection of wallet.")) {
|
||||||
Toggle("Show wallet selector", isOn: $user_settings.show_wallet_selector).toggleStyle(.switch)
|
Toggle(NSLocalizedString("Show wallet selector", comment: "Toggle to show or hide selection of wallet."), isOn: $user_settings.show_wallet_selector).toggleStyle(.switch)
|
||||||
Picker("Select default wallet",
|
Picker(NSLocalizedString("Select default wallet", comment: "Prompt selection of user's default wallet"),
|
||||||
selection: $user_settings.default_wallet) {
|
selection: $user_settings.default_wallet) {
|
||||||
ForEach(Wallet.allCases, id: \.self) { wallet in
|
ForEach(Wallet.allCases, id: \.self) { wallet in
|
||||||
Text(wallet.model.displayName)
|
Text(wallet.model.displayName)
|
||||||
@@ -114,32 +114,32 @@ struct ConfigView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Clear Cache") {
|
Section(NSLocalizedString("Clear Cache", comment: "Section title for clearing cached data.")) {
|
||||||
Button("Clear") {
|
Button(NSLocalizedString("Clear", comment: "Button for clearing cached data.")) {
|
||||||
KingfisherManager.shared.cache.clearMemoryCache()
|
KingfisherManager.shared.cache.clearMemoryCache()
|
||||||
KingfisherManager.shared.cache.clearDiskCache()
|
KingfisherManager.shared.cache.clearDiskCache()
|
||||||
KingfisherManager.shared.cache.cleanExpiredDiskCache()
|
KingfisherManager.shared.cache.cleanExpiredDiskCache()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Reset") {
|
Section(NSLocalizedString("Reset", comment: "Section title for resetting the user")) {
|
||||||
Button("Logout") {
|
Button(NSLocalizedString("Logout", comment: "Button to logout the user.")) {
|
||||||
confirm_logout = true
|
confirm_logout = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("Settings")
|
.navigationTitle(NSLocalizedString("Settings", comment: "Navigation title for Settings view."))
|
||||||
.navigationBarTitleDisplayMode(.large)
|
.navigationBarTitleDisplayMode(.large)
|
||||||
.alert("Logout", isPresented: $confirm_logout) {
|
.alert(NSLocalizedString("Logout", comment: "Alert for logging out the user."), isPresented: $confirm_logout) {
|
||||||
Button("Cancel") {
|
Button(NSLocalizedString("Cancel", comment: "Cancel out of logging out the user.")) {
|
||||||
confirm_logout = false
|
confirm_logout = false
|
||||||
}
|
}
|
||||||
Button("Logout") {
|
Button(NSLocalizedString("Logout", comment: "Button for logging out the user.")) {
|
||||||
notify(.logout, ())
|
notify(.logout, ())
|
||||||
}
|
}
|
||||||
} message: {
|
} message: {
|
||||||
Text("Make sure your nsec account key is saved before you logout or you will lose access to this account")
|
Text("Make sure your nsec account key is saved before you logout or you will lose access to this account", comment: "Reminder message in alert to get customer to verify that their private security account key is saved saved before logging out.")
|
||||||
}
|
}
|
||||||
.sheet(isPresented: $show_add_relay) {
|
.sheet(isPresented: $show_add_relay) {
|
||||||
AddRelayView(show_add_relay: $show_add_relay, relay: $new_relay) { m_relay in
|
AddRelayView(show_add_relay: $show_add_relay, relay: $new_relay) { m_relay in
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ struct CreateAccountView: View {
|
|||||||
|
|
||||||
HStack(alignment: .top) {
|
HStack(alignment: .top) {
|
||||||
VStack {
|
VStack {
|
||||||
Text(" ")
|
Text(" ", comment: "Blank space to separate profile picture from profile editor form.")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}
|
}
|
||||||
VStack {
|
VStack {
|
||||||
SignupForm {
|
SignupForm {
|
||||||
FormLabel(NSLocalizedString("Username", comment: "Label to prompt username entry."))
|
FormLabel(NSLocalizedString("Username", comment: "Label to prompt username entry."))
|
||||||
HStack(spacing: 0.0) {
|
HStack(spacing: 0.0) {
|
||||||
Text("@")
|
Text("@", comment: "Prefix character to username.")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.padding(.leading, -25.0)
|
.padding(.leading, -25.0)
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ func FormLabel(_ title: String, optional: Bool = false) -> some View {
|
|||||||
.bold()
|
.bold()
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
if optional {
|
if optional {
|
||||||
Text("optional")
|
Text("optional", comment: "Label indicating that a form input is optional.")
|
||||||
.font(.callout)
|
.font(.callout)
|
||||||
.foregroundColor(.white.opacity(0.5))
|
.foregroundColor(.white.opacity(0.5))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,14 +142,14 @@ struct DMChatView: View {
|
|||||||
|
|
||||||
Footer
|
Footer
|
||||||
}
|
}
|
||||||
Text("Send a message to start the conversation...")
|
Text("Send a message to start the conversation...", comment: "Text prompt for user to send a message to the other user.")
|
||||||
.lineLimit(nil)
|
.lineLimit(nil)
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
.padding(.horizontal, 40)
|
.padding(.horizontal, 40)
|
||||||
.opacity(((dms.events.count == 0) ? 1.0 : 0.0))
|
.opacity(((dms.events.count == 0) ? 1.0 : 0.0))
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
}
|
}
|
||||||
.navigationTitle("DM")
|
.navigationTitle(NSLocalizedString("DM", comment: "Navigation title for DM view, which is the English abbreviation for Direct Message."))
|
||||||
.toolbar { Header }
|
.toolbar { Header }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ struct DirectMessagesView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
MainContent
|
MainContent
|
||||||
.navigationTitle("Encrypted DMs")
|
.navigationTitle(NSLocalizedString("Encrypted DMs", comment: "Navigation title for view of encrypted DMs, where DM is an English abbreviation for Direct Message."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,32 +107,32 @@ struct EditMetadataView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
Form {
|
Form {
|
||||||
Section("Your Name") {
|
Section(NSLocalizedString("Your Name", comment: "Label for Your Name section of user profile form.")) {
|
||||||
TextField("Satoshi Nakamoto", text: $display_name)
|
TextField("Satoshi Nakamoto", text: $display_name)
|
||||||
.autocorrectionDisabled(true)
|
.autocorrectionDisabled(true)
|
||||||
.textInputAutocapitalization(.never)
|
.textInputAutocapitalization(.never)
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Username") {
|
Section(NSLocalizedString("Username", comment: "Label for Username section of user profile form.")) {
|
||||||
TextField("satoshi", text: $name)
|
TextField("satoshi", text: $name)
|
||||||
.autocorrectionDisabled(true)
|
.autocorrectionDisabled(true)
|
||||||
.textInputAutocapitalization(.never)
|
.textInputAutocapitalization(.never)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Section ("Profile Picture") {
|
Section (NSLocalizedString("Profile Picture", comment: "Label for Profile Picture section of user profile form.")) {
|
||||||
TextField("https://example.com/pic.jpg", text: $picture)
|
TextField(NSLocalizedString("https://example.com/pic.jpg", comment: "Placeholder example text for profile picture URL."), text: $picture)
|
||||||
.autocorrectionDisabled(true)
|
.autocorrectionDisabled(true)
|
||||||
.textInputAutocapitalization(.never)
|
.textInputAutocapitalization(.never)
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Website") {
|
Section(NSLocalizedString("Website", comment: "Label for Website section of user profile form.")) {
|
||||||
TextField("https://jb55.com", text: $website)
|
TextField(NSLocalizedString("https://jb55.com", comment: "Placeholder example text for website URL for user profile."), text: $website)
|
||||||
.autocorrectionDisabled(true)
|
.autocorrectionDisabled(true)
|
||||||
.textInputAutocapitalization(.never)
|
.textInputAutocapitalization(.never)
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("About Me") {
|
Section(NSLocalizedString("About Me", comment: "Label for About Me section of user profile form.")) {
|
||||||
let placeholder = NSLocalizedString("Absolute Boss", comment: "Placeholder text for About Me description.")
|
let placeholder = NSLocalizedString("Absolute Boss", comment: "Placeholder text for About Me description.")
|
||||||
ZStack(alignment: .topLeading) {
|
ZStack(alignment: .topLeading) {
|
||||||
TextEditor(text: $about)
|
TextEditor(text: $about)
|
||||||
@@ -146,18 +146,18 @@ struct EditMetadataView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Bitcoin Lightning Tips") {
|
Section(NSLocalizedString("Bitcoin Lightning Tips", comment: "Label for Bitcoin Lightning Tips section of user profile form.")) {
|
||||||
TextField("Lightning Address or LNURL", text: $ln)
|
TextField(NSLocalizedString("Lightning Address or LNURL", comment: "Placeholder text for entry of Lightning Address or LNURL."), text: $ln)
|
||||||
.autocorrectionDisabled(true)
|
.autocorrectionDisabled(true)
|
||||||
.textInputAutocapitalization(.never)
|
.textInputAutocapitalization(.never)
|
||||||
}
|
}
|
||||||
|
|
||||||
Section(content: {
|
Section(content: {
|
||||||
TextField("jb55@jb55.com", text: $nip05)
|
TextField(NSLocalizedString("jb55@jb55.com", comment: "Placeholder example text for identifier used for NIP-05 verification."), text: $nip05)
|
||||||
.autocorrectionDisabled(true)
|
.autocorrectionDisabled(true)
|
||||||
.textInputAutocapitalization(.never)
|
.textInputAutocapitalization(.never)
|
||||||
}, header: {
|
}, header: {
|
||||||
Text("NIP-05 Verification")
|
Text("NIP-05 Verification", comment: "Label for NIP-05 Verification section of user profile form.")
|
||||||
}, footer: {
|
}, footer: {
|
||||||
if let parts = nip05_parts {
|
if let parts = nip05_parts {
|
||||||
Text("'\(parts.username)' at '\(parts.host)' will be used for verification", comment: "Description of how the nip05 identifier would be used for verification.")
|
Text("'\(parts.username)' at '\(parts.host)' will be used for verification", comment: "Description of how the nip05 identifier would be used for verification.")
|
||||||
@@ -166,13 +166,13 @@ struct EditMetadataView: View {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
Button("Save") {
|
Button(NSLocalizedString("Save", comment: "Button for saving profile.")) {
|
||||||
save()
|
save()
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("Edit Profile")
|
.navigationTitle(NSLocalizedString("Edit Profile", comment: "Title of navigation view for Edit Profile."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ struct EmptyTimelineView: View {
|
|||||||
Image(systemName: "tray.fill")
|
Image(systemName: "tray.fill")
|
||||||
.font(.system(size: 35))
|
.font(.system(size: 35))
|
||||||
.padding()
|
.padding()
|
||||||
Text("Nothing to see here. Check back later!")
|
Text("Nothing to see here. Check back later!", comment: "Indicates that there are no notes in the timeline to view.")
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
.font(.callout.weight(.medium))
|
.font(.callout.weight(.medium))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,15 +102,15 @@ struct EventActionBar: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.alert("Boost", isPresented: $confirm_boost) {
|
.alert(NSLocalizedString("Boost", comment: "Title of alert for confirming to boost a post."), isPresented: $confirm_boost) {
|
||||||
Button("Cancel") {
|
Button("Cancel") {
|
||||||
confirm_boost = false
|
confirm_boost = false
|
||||||
}
|
}
|
||||||
Button("Boost") {
|
Button(NSLocalizedString("Boost", comment: "Button to confirm boosting a post.")) {
|
||||||
send_boost()
|
send_boost()
|
||||||
}
|
}
|
||||||
} message: {
|
} message: {
|
||||||
Text("Are you sure you want to boost this post?")
|
Text("Are you sure you want to boost this post?", comment: "Alert message to ask if user wants to boost a post.")
|
||||||
}
|
}
|
||||||
.onReceive(handle_notify(.liked)) { n in
|
.onReceive(handle_notify(.liked)) { n in
|
||||||
let liked = n.object as! Counted
|
let liked = n.object as! Counted
|
||||||
@@ -169,7 +169,7 @@ struct LikeButton: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
Button(action: action) {
|
Button(action: action) {
|
||||||
if liked {
|
if liked {
|
||||||
Text("🤙")
|
Text("🤙", comment: "Button with emoji to like an event.")
|
||||||
} else {
|
} else {
|
||||||
Image("shaka")
|
Image("shaka")
|
||||||
.renderingMode(.template)
|
.renderingMode(.template)
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ struct EventDetailView: View {
|
|||||||
Group {
|
Group {
|
||||||
switch cev {
|
switch cev {
|
||||||
case .collapsed(let c):
|
case .collapsed(let c):
|
||||||
Text("··· \(c.count) other notes ···")
|
Text(String(format: NSLocalizedString("collapsed_event_view_other_notes", comment: "Text to indicate that the thread was collapsed and that there are other notes to view if tapped."), c.count))
|
||||||
.padding([.top,.bottom], 8)
|
.padding([.top,.bottom], 8)
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
@@ -114,7 +114,7 @@ struct EventDetailView: View {
|
|||||||
scroll_after_load(thread: thread, proxy: proxy)
|
scroll_after_load(thread: thread, proxy: proxy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationBarTitle("Thread")
|
.navigationBarTitle(NSLocalizedString("Thread", comment: "Navigation bar title for note thread."))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ struct EventView: View {
|
|||||||
ProfileName(pubkey: event.pubkey, profile: prof, damus: damus, show_friend_confirmed: true)
|
ProfileName(pubkey: event.pubkey, profile: prof, damus: damus, show_friend_confirmed: true)
|
||||||
.font(.footnote.weight(.bold))
|
.font(.footnote.weight(.bold))
|
||||||
.foregroundColor(Color.gray)
|
.foregroundColor(Color.gray)
|
||||||
Text("Boosted")
|
Text("Boosted", comment: "Text indicating that the post was boosted (i.e. re-shared).")
|
||||||
.font(.footnote.weight(.bold))
|
.font(.footnote.weight(.bold))
|
||||||
.foregroundColor(Color.gray)
|
.foregroundColor(Color.gray)
|
||||||
}
|
}
|
||||||
@@ -308,7 +308,7 @@ extension View {
|
|||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.string = bech32_pubkey
|
UIPasteboard.general.string = bech32_pubkey
|
||||||
} label: {
|
} label: {
|
||||||
Label("Copy Account ID", systemImage: "doc.on.doc")
|
Label(NSLocalizedString("Copy Account ID", comment: "Context menu option for copying the ID of the account that created the note."), systemImage: "doc.on.doc")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -318,31 +318,31 @@ extension View {
|
|||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.string = event.get_content(privkey)
|
UIPasteboard.general.string = event.get_content(privkey)
|
||||||
} label: {
|
} label: {
|
||||||
Label("Copy Text", systemImage: "doc.on.doc")
|
Label(NSLocalizedString("Copy Text", comment: "Context menu option for copying the text from an note."), systemImage: "doc.on.doc")
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.string = bech32_pubkey(pubkey) ?? pubkey
|
UIPasteboard.general.string = bech32_pubkey(pubkey) ?? pubkey
|
||||||
} label: {
|
} label: {
|
||||||
Label("Copy User ID", systemImage: "tag")
|
Label(NSLocalizedString("Copy User ID", comment: "Context menu option for copying the ID of the user who created the note."), systemImage: "tag")
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.string = bech32_note_id(event.id) ?? event.id
|
UIPasteboard.general.string = bech32_note_id(event.id) ?? event.id
|
||||||
} label: {
|
} label: {
|
||||||
Label("Copy Note ID", systemImage: "tag")
|
Label(NSLocalizedString("Copy Note ID", comment: "Context menu option for copying the ID of the note."), systemImage: "tag")
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.string = event_to_json(ev: event)
|
UIPasteboard.general.string = event_to_json(ev: event)
|
||||||
} label: {
|
} label: {
|
||||||
Label("Copy Note JSON", systemImage: "note")
|
Label(NSLocalizedString("Copy Note JSON", comment: "Context menu option for copying the JSON text from the note."), systemImage: "note")
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
NotificationCenter.default.post(name: .broadcast_event, object: event)
|
NotificationCenter.default.post(name: .broadcast_event, object: event)
|
||||||
} label: {
|
} label: {
|
||||||
Label("Broadcast", systemImage: "globe")
|
Label(NSLocalizedString("Broadcast", comment: "Context menu option for broadcasting the user's note to all of the user's connected relay servers."), systemImage: "globe")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,16 +70,16 @@ struct FollowButtonPreviews: View {
|
|||||||
let target: FollowTarget = .pubkey("")
|
let target: FollowTarget = .pubkey("")
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
Text("Unfollows")
|
Text("Unfollows", comment: "Text to indicate that the button next to it is in a state that will unfollow a profile when tapped.")
|
||||||
FollowButtonView(target: target, follow_state: .unfollows)
|
FollowButtonView(target: target, follow_state: .unfollows)
|
||||||
|
|
||||||
Text("Following")
|
Text("Following", comment: "Text to indicate that the button next to it is in a state that indicates that it is in the process of following a profile.")
|
||||||
FollowButtonView(target: target, follow_state: .following)
|
FollowButtonView(target: target, follow_state: .following)
|
||||||
|
|
||||||
Text("Follows")
|
Text("Follows", comment: "Text to indicate that button next to it is in a state that will follow a profile when tapped.")
|
||||||
FollowButtonView(target: target, follow_state: .follows)
|
FollowButtonView(target: target, follow_state: .follows)
|
||||||
|
|
||||||
Text("Unfollowing")
|
Text("Unfollowing", comment: "Text to indicate that the button next to it is in a state that indicates that it is in the process of unfollowing a profile.")
|
||||||
FollowButtonView(target: target, follow_state: .unfollowing)
|
FollowButtonView(target: target, follow_state: .unfollowing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ struct FollowersView: View {
|
|||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
.navigationBarTitle("\(Profile.displayName(profile: profile, pubkey: whos))'s Followers")
|
.navigationBarTitle(NSLocalizedString("\(Profile.displayName(profile: profile, pubkey: whos))'s Followers", comment: "Navigation bar title for view that shows who is following a user."))
|
||||||
.onAppear {
|
.onAppear {
|
||||||
followers.subscribe()
|
followers.subscribe()
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ struct FollowingView: View {
|
|||||||
.onDisappear {
|
.onDisappear {
|
||||||
following.unsubscribe()
|
following.unsubscribe()
|
||||||
}
|
}
|
||||||
.navigationBarTitle("\(who) following")
|
.navigationBarTitle(NSLocalizedString("\(who) following", comment: "Navigation bar title for view that shows who a user is following."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,21 +122,21 @@ struct LoginView: View {
|
|||||||
ZStack(alignment: .top) {
|
ZStack(alignment: .top) {
|
||||||
DamusGradient()
|
DamusGradient()
|
||||||
VStack {
|
VStack {
|
||||||
Text("Login")
|
Text("Login", comment: "Title of view to log into an account.")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.font(.title)
|
.font(.title)
|
||||||
.padding()
|
.padding()
|
||||||
|
|
||||||
Text("Enter your account key to login:")
|
Text("Enter your account key to login:", comment: "Prompt for user to enter an account key to login.")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.padding()
|
.padding()
|
||||||
|
|
||||||
KeyInput("nsec1...", key: $key)
|
KeyInput(NSLocalizedString("nsec1...", comment: "Prompt for user to enter in an account key to login. This text shows the characters the key could start with if it was a private key."), key: $key)
|
||||||
|
|
||||||
let parsed = parse_key(key)
|
let parsed = parse_key(key)
|
||||||
|
|
||||||
if parsed?.is_hex ?? false {
|
if parsed?.is_hex ?? false {
|
||||||
Text("This is an old-style nostr key. We're not sure if it's a pubkey or private key. Please toggle the button below if this a public key.")
|
Text("This is an old-style nostr key. We're not sure if it's a pubkey or private key. Please toggle the button below if this a public key.", comment: "Warning that the inputted account key for login is an old-style and asking user to verify if it is a public key.")
|
||||||
.font(.subheadline.bold())
|
.font(.subheadline.bold())
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
PubkeySwitch(isOn: $is_pubkey)
|
PubkeySwitch(isOn: $is_pubkey)
|
||||||
@@ -150,15 +150,15 @@ struct LoginView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if parsed?.is_pub ?? false {
|
if parsed?.is_pub ?? false {
|
||||||
Text("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.")
|
Text("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.", comment: "Warning that the inputted account key is a public key and the result of what happens because of it.")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
|
|
||||||
if let p = parsed {
|
if let p = parsed {
|
||||||
DamusWhiteButton("Login") {
|
DamusWhiteButton(NSLocalizedString("Login", comment: "Button to log into account.")) {
|
||||||
if !process_login(p, is_pubkey: self.is_pubkey) {
|
if !process_login(p, is_pubkey: self.is_pubkey) {
|
||||||
self.error = "Invalid key"
|
self.error = NSLocalizedString("Invalid key", comment: "Error message indicating that an invalid account key was entered for login.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ struct PubkeySwitch: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
HStack {
|
HStack {
|
||||||
Toggle(isOn: $isOn) {
|
Toggle(isOn: $isOn) {
|
||||||
Text("Public Key?")
|
Text("Public Key?", comment: "Prompt to ask user if the key they entered is a public key.")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ struct MentionView: View {
|
|||||||
let pk = bech32_pubkey(mention.ref.ref_id) ?? mention.ref.ref_id
|
let pk = bech32_pubkey(mention.ref.ref_id) ?? mention.ref.ref_id
|
||||||
PubkeyView(pubkey: pk, relay: mention.ref.relay_id)
|
PubkeyView(pubkey: pk, relay: mention.ref.relay_id)
|
||||||
case .event:
|
case .event:
|
||||||
Text("< e >")
|
Text("< e >", comment: "Placeholder for event mention.")
|
||||||
//EventBlockView(pubkey: mention.ref.ref_id, relay: mention.ref.relay_id)
|
//EventBlockView(pubkey: mention.ref.ref_id, relay: mention.ref.relay_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ struct PostView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
HStack {
|
HStack {
|
||||||
Button("Cancel") {
|
Button(NSLocalizedString("Cancel", comment: "Button to cancel out of posting a note.")) {
|
||||||
self.cancel()
|
self.cancel()
|
||||||
}
|
}
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
@@ -63,7 +63,7 @@ struct PostView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
if !is_post_empty {
|
if !is_post_empty {
|
||||||
Button("Post") {
|
Button(NSLocalizedString("Post", comment: "Button to post a note.")) {
|
||||||
self.send_post()
|
self.send_post()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ struct EditButton: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationLink(destination: EditMetadataView(damus_state: damus_state)) {
|
NavigationLink(destination: EditMetadataView(damus_state: damus_state)) {
|
||||||
Text("Edit")
|
Text("Edit", comment: "Button to edit user's profile.")
|
||||||
.frame(height: 30)
|
.frame(height: 30)
|
||||||
.padding(.horizontal,25)
|
.padding(.horizontal,25)
|
||||||
.font(.caption.weight(.bold))
|
.font(.caption.weight(.bold))
|
||||||
@@ -153,7 +153,7 @@ struct ProfileView: View {
|
|||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.string = profile.lnurl ?? ""
|
UIPasteboard.general.string = profile.lnurl ?? ""
|
||||||
} label: {
|
} label: {
|
||||||
Label("Copy LNUrl", systemImage: "doc.on.doc")
|
Label(NSLocalizedString("Copy LNURL", comment: "Context menu option for copying a user's Lightning URL."), systemImage: "doc.on.doc")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,11 +260,7 @@ struct ProfileView: View {
|
|||||||
let following_model = FollowingModel(damus_state: damus_state, contacts: contacts)
|
let following_model = FollowingModel(damus_state: damus_state, contacts: contacts)
|
||||||
NavigationLink(destination: FollowingView(damus_state: damus_state, following: following_model, whos: profile.pubkey)) {
|
NavigationLink(destination: FollowingView(damus_state: damus_state, following: following_model, whos: profile.pubkey)) {
|
||||||
HStack {
|
HStack {
|
||||||
Text("\(profile.following)")
|
Text("\(Text("\(profile.following)", comment: "Number of profiles a user is 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'.")
|
||||||
.font(.subheadline.weight(.medium))
|
|
||||||
Text("Following")
|
|
||||||
.font(.subheadline)
|
|
||||||
.foregroundColor(.gray)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.buttonStyle(PlainButtonStyle())
|
.buttonStyle(PlainButtonStyle())
|
||||||
@@ -287,11 +283,7 @@ struct ProfileView: View {
|
|||||||
|
|
||||||
if let relays = profile.relays {
|
if let relays = profile.relays {
|
||||||
NavigationLink(destination: UserRelaysView(state: damus_state, pubkey: profile.pubkey, relays: Array(relays.keys).sorted())) {
|
NavigationLink(destination: UserRelaysView(state: damus_state, pubkey: profile.pubkey, relays: Array(relays.keys).sorted())) {
|
||||||
Text("\(relays.keys.count)")
|
Text("\(Text("\(relays.keys.count)", comment: "Number of relay servers a user is connected.").font(.subheadline.weight(.medium))) \(Text("Relays", comment: "Part of a larger sentence to describe how many relay servers a user is connected.").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 'Relays'.")
|
||||||
.font(.subheadline.weight(.medium))
|
|
||||||
Text("Relays")
|
|
||||||
.font(.subheadline)
|
|
||||||
.foregroundColor(.gray)
|
|
||||||
}
|
}
|
||||||
.buttonStyle(PlainButtonStyle())
|
.buttonStyle(PlainButtonStyle())
|
||||||
}
|
}
|
||||||
@@ -307,13 +299,12 @@ struct ProfileView: View {
|
|||||||
HStack {
|
HStack {
|
||||||
if followers.count_display == "?" {
|
if followers.count_display == "?" {
|
||||||
Image(systemName: "square.and.arrow.down")
|
Image(systemName: "square.and.arrow.down")
|
||||||
} else {
|
Text("Followers", comment: "Label describing followers of a user.")
|
||||||
Text("\(followers.count_display)")
|
|
||||||
.font(.subheadline.weight(.medium))
|
|
||||||
}
|
|
||||||
Text("Followers")
|
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
|
} else {
|
||||||
|
Text("\(Text("\(followers.count_display)", comment: "Number of people following a user.").font(.subheadline.weight(.medium))) \(Text("Followers", comment: "Part of a larger sentence to describe how many people are following a user.").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 'Followers'.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,7 +396,7 @@ struct KeyView: View {
|
|||||||
isCopied = false
|
isCopied = false
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
Label("Public Key", systemImage: "key.fill")
|
Label(NSLocalizedString("Public Key", comment: "Label indicating that the text is a user's public account key."), systemImage: "key.fill")
|
||||||
.font(.custom("key", size: 12.0))
|
.font(.custom("key", size: 12.0))
|
||||||
.labelStyle(IconOnlyLabelStyle())
|
.labelStyle(IconOnlyLabelStyle())
|
||||||
.foregroundStyle(hex_to_rgb(pubkey))
|
.foregroundStyle(hex_to_rgb(pubkey))
|
||||||
@@ -428,7 +419,7 @@ struct KeyView: View {
|
|||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
Label {
|
Label {
|
||||||
Text("Public key")
|
Text("Public key", comment: "Label indicating that the text is a user's public account key.")
|
||||||
} icon: {
|
} icon: {
|
||||||
Image("ic-copy")
|
Image("ic-copy")
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
@@ -441,7 +432,7 @@ struct KeyView: View {
|
|||||||
HStack {
|
HStack {
|
||||||
Image("ic-tick")
|
Image("ic-tick")
|
||||||
.frame(width: 20, height: 20)
|
.frame(width: 20, height: 20)
|
||||||
Text("Copied")
|
Text(NSLocalizedString("Copied", comment: "Label indicating that a user's key was copied."))
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.foregroundColor(Color("DamusGreen"))
|
.foregroundColor(Color("DamusGreen"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ struct RecommendedRelayView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
if let ev = damus.contacts.event, add_button {
|
if let ev = damus.contacts.event, add_button {
|
||||||
if let privkey = damus.keypair.privkey {
|
if let privkey = damus.keypair.privkey {
|
||||||
Button("Add") {
|
Button(NSLocalizedString("Add", comment: "Button to add recommended relay server.")) {
|
||||||
guard let ev = add_relay(ev: ev, privkey: privkey, current_relays: damus.pool.descriptors, relay: relay, info: .rw) else {
|
guard let ev = add_relay(ev: ev, privkey: privkey, current_relays: damus.pool.descriptors, relay: relay, info: .rw) else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ struct RelayView: View {
|
|||||||
Button {
|
Button {
|
||||||
UIPasteboard.general.setValue(relay, forPasteboardType: "public.plain-text")
|
UIPasteboard.general.setValue(relay, forPasteboardType: "public.plain-text")
|
||||||
} label: {
|
} label: {
|
||||||
Label("Copy", systemImage: "doc.on.doc")
|
Label(NSLocalizedString("Copy", comment: "Button to copy a relay server address."), systemImage: "doc.on.doc")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ struct RelayView: View {
|
|||||||
process_contact_event(pool: state.pool, contacts: state.contacts, pubkey: state.pubkey, ev: new_ev)
|
process_contact_event(pool: state.pool, contacts: state.contacts, pubkey: state.pubkey, ev: new_ev)
|
||||||
state.pool.send(.event(new_ev))
|
state.pool.send(.event(new_ev))
|
||||||
} label: {
|
} label: {
|
||||||
Label("Delete", systemImage: "trash")
|
Label(NSLocalizedString("Delete", comment: "Button to delete a relay server that the user connects to."), systemImage: "trash")
|
||||||
}
|
}
|
||||||
.tint(.red)
|
.tint(.red)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ struct ReplyView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
Text("Replying to:")
|
Text("Replying to:", comment: "Indicating that the user is replying to the following listed people.")
|
||||||
HStack(alignment: .top) {
|
HStack(alignment: .top) {
|
||||||
let names = all_referenced_pubkeys(replying_to)
|
let names = all_referenced_pubkeys(replying_to)
|
||||||
.map { pubkey in
|
.map { pubkey in
|
||||||
|
|||||||
@@ -21,21 +21,21 @@ struct SaveKeysView: View {
|
|||||||
DamusGradient()
|
DamusGradient()
|
||||||
|
|
||||||
VStack(alignment: .center) {
|
VStack(alignment: .center) {
|
||||||
Text("Welcome, \(account.rendered_name)!")
|
Text("Welcome, \(account.rendered_name)!", comment: "Text to welcome user.")
|
||||||
.font(.title.bold())
|
.font(.title.bold())
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
|
|
||||||
Text("Before we get started, you'll need to save your account info, otherwise you won't be able to login in the future if you ever uninstall Damus.")
|
Text("Before we get started, you'll need to save your account info, otherwise you won't be able to login in the future if you ever uninstall Damus.", comment: "Reminder to user that they should save their account information.")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
|
|
||||||
Text("Public Key")
|
Text("Public Key", comment: "Label to indicate that text below is the user's public key used by others to uniquely refer to the user.")
|
||||||
.font(.title2.bold())
|
.font(.title2.bold())
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
|
|
||||||
Text("This is your account ID, you can give this to your friends so that they can follow you. Click to copy.")
|
Text("This is your account ID, you can give this to your friends so that they can follow you. Click to copy.", comment: "Label to describe that a public key is the user's account ID and what they can do with it.")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
|
|
||||||
@@ -43,12 +43,12 @@ struct SaveKeysView: View {
|
|||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
|
|
||||||
if pub_copied {
|
if pub_copied {
|
||||||
Text("Private Key")
|
Text("Private Key", comment: "Label to indicate that the text below is the user's private key used by only the user themself as a secret to login to access their account.")
|
||||||
.font(.title2.bold())
|
.font(.title2.bold())
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
|
|
||||||
Text("This is your secret account key. You need this to access your account. Don't share this with anyone! Save it in a password manager and keep it safe!")
|
Text("This is your secret account key. You need this to access your account. Don't share this with anyone! Save it in a password manager and keep it safe!", comment: "Label to describe that a private key is the user's secret account key and what they should do with it.")
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.padding(.bottom, 10)
|
.padding(.bottom, 10)
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ struct SaveKeysView: View {
|
|||||||
ProgressView()
|
ProgressView()
|
||||||
.progressViewStyle(.circular)
|
.progressViewStyle(.circular)
|
||||||
} else if let err = error {
|
} else if let err = error {
|
||||||
Text("Error: \(err)")
|
Text("Error: \(err)", comment: "Error message indicating why saving keys failed.")
|
||||||
.foregroundColor(.red)
|
.foregroundColor(.red)
|
||||||
DamusWhiteButton("Retry") {
|
DamusWhiteButton("Retry") {
|
||||||
complete_account_creation(account)
|
complete_account_creation(account)
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ struct SearchHomeView: View {
|
|||||||
var SearchInput: some View {
|
var SearchInput: some View {
|
||||||
ZStack(alignment: .leading) {
|
ZStack(alignment: .leading) {
|
||||||
HStack{
|
HStack{
|
||||||
TextField("Search...", text: $search)
|
TextField(NSLocalizedString("Search...", comment: "Placeholder text to prompt entry of search query."), text: $search)
|
||||||
.padding(8)
|
.padding(8)
|
||||||
.padding(.leading, 35)
|
.padding(.leading, 35)
|
||||||
.autocorrectionDisabled(true)
|
.autocorrectionDisabled(true)
|
||||||
.textInputAutocapitalization(.never)
|
.textInputAutocapitalization(.never)
|
||||||
Text("Cancel")
|
Text("Cancel", comment: "Cancel out of search view.")
|
||||||
.foregroundColor(.blue)
|
.foregroundColor(.blue)
|
||||||
.padding(EdgeInsets(top: 0.0, leading: 0.0, bottom: 0.0, trailing: 10.0))
|
.padding(EdgeInsets(top: 0.0, leading: 0.0, bottom: 0.0, trailing: 10.0))
|
||||||
.opacity((search == "") ? 0.0 : 1.0)
|
.opacity((search == "") ? 0.0 : 1.0)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ struct SearchResultsView: View {
|
|||||||
let search_model = SearchModel(pool: damus_state.pool, search: .filter_hashtag([ht]))
|
let search_model = SearchModel(pool: damus_state.pool, search: .filter_hashtag([ht]))
|
||||||
let dst = SearchView(appstate: damus_state, search: search_model)
|
let dst = SearchView(appstate: damus_state, search: search_model)
|
||||||
NavigationLink(destination: dst) {
|
NavigationLink(destination: dst) {
|
||||||
Text("Search hashtag: #\(ht)")
|
Text("Search hashtag: #\(ht)", comment: "Navigation link to search hashtag.")
|
||||||
}
|
}
|
||||||
case .profile(let prof):
|
case .profile(let prof):
|
||||||
let decoded = try? bech32_decode(prof)
|
let decoded = try? bech32_decode(prof)
|
||||||
@@ -47,7 +47,7 @@ struct SearchResultsView: View {
|
|||||||
let f = FollowersModel(damus_state: damus_state, target: prof)
|
let f = FollowersModel(damus_state: damus_state, target: prof)
|
||||||
let dst = ProfileView(damus_state: damus_state, profile: prof_model, followers: f)
|
let dst = ProfileView(damus_state: damus_state, profile: prof_model, followers: f)
|
||||||
NavigationLink(destination: dst) {
|
NavigationLink(destination: dst) {
|
||||||
Text("Goto profile \(prof)")
|
Text("Goto profile \(prof)", comment: "Navigation link to go to profile.")
|
||||||
}
|
}
|
||||||
case .hex(let h):
|
case .hex(let h):
|
||||||
let prof_model = ProfileModel(pubkey: h, damus: damus_state)
|
let prof_model = ProfileModel(pubkey: h, damus: damus_state)
|
||||||
@@ -60,10 +60,10 @@ struct SearchResultsView: View {
|
|||||||
|
|
||||||
VStack(spacing: 50) {
|
VStack(spacing: 50) {
|
||||||
NavigationLink(destination: prof_view) {
|
NavigationLink(destination: prof_view) {
|
||||||
Text("Goto profile \(h)")
|
Text("Goto profile \(h)", comment: "Navigation link to go to profile referenced by hex code.")
|
||||||
}
|
}
|
||||||
NavigationLink(destination: ev_view) {
|
NavigationLink(destination: ev_view) {
|
||||||
Text("Goto post \(h)")
|
Text("Goto post \(h)", comment: "Navigation link to go to post referenced by hex code.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case .note(let nid):
|
case .note(let nid):
|
||||||
@@ -74,10 +74,10 @@ struct SearchResultsView: View {
|
|||||||
event_id: hex
|
event_id: hex
|
||||||
)
|
)
|
||||||
NavigationLink(destination: ev_view) {
|
NavigationLink(destination: ev_view) {
|
||||||
Text("Goto post \(nid)")
|
Text("Goto post \(nid)", comment: "Navigation link to go to post referenced by note ID.")
|
||||||
}
|
}
|
||||||
case .none:
|
case .none:
|
||||||
Text("none")
|
Text("none", comment: "No search results.")
|
||||||
}
|
}
|
||||||
}.padding(.horizontal)
|
}.padding(.horizontal)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ struct SelectWalletView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
Form {
|
Form {
|
||||||
Section("Copy invoice") {
|
Section(NSLocalizedString("Copy invoice", comment: "Title of section for copying a Lightning invoice identifier.")) {
|
||||||
HStack {
|
HStack {
|
||||||
Text(invoice).font(.body)
|
Text(invoice).font(.body)
|
||||||
.lineLimit(2)
|
.lineLimit(2)
|
||||||
@@ -35,14 +35,14 @@ struct SelectWalletView: View {
|
|||||||
generator.impactOccurred()
|
generator.impactOccurred()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Section("Select a lightning wallet"){
|
Section(NSLocalizedString("Select a Lightning wallet", comment: "Title of section for selecting a Lightning wallet to pay a Lightning invoice.")) {
|
||||||
List{
|
List{
|
||||||
Button() {
|
Button() {
|
||||||
let wallet_model = user_settings.default_wallet.model
|
let wallet_model = user_settings.default_wallet.model
|
||||||
open_with_wallet(wallet: wallet_model, invoice: invoice)
|
open_with_wallet(wallet: wallet_model, invoice: invoice)
|
||||||
} label: {
|
} label: {
|
||||||
HStack {
|
HStack {
|
||||||
Text("Default Wallet").font(.body).foregroundColor(.blue)
|
Text("Default Wallet", comment: "Button to pay a Lightning invoice with the user's default Lightning wallet.").font(.body).foregroundColor(.blue)
|
||||||
}
|
}
|
||||||
}.buttonStyle(.plain)
|
}.buttonStyle(.plain)
|
||||||
List($allWalletModels) { $wallet in
|
List($allWalletModels) { $wallet in
|
||||||
@@ -59,10 +59,10 @@ struct SelectWalletView: View {
|
|||||||
}
|
}
|
||||||
}.padding(.vertical, 2.5)
|
}.padding(.vertical, 2.5)
|
||||||
}
|
}
|
||||||
}.navigationBarTitle(Text("Pay the lightning invoice"), displayMode: .inline).navigationBarItems(trailing: Button(action: {
|
}.navigationBarTitle(Text("Pay the Lightning invoice", comment: "Navigation bar title for view to pay Lightning invoice."), displayMode: .inline).navigationBarItems(trailing: Button(action: {
|
||||||
self.showingSelectWallet = false
|
self.showingSelectWallet = false
|
||||||
}) {
|
}) {
|
||||||
Text("Done").bold()
|
Text("Done", comment: "Button to dismiss wallet selection view for paying Lightning invoice.").bold()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ struct SetupView: View {
|
|||||||
.resizable()
|
.resizable()
|
||||||
.frame(width: 128.0, height: 128.0, alignment: .center)
|
.frame(width: 128.0, height: 128.0, alignment: .center)
|
||||||
.padding([.top], 20.0)
|
.padding([.top], 20.0)
|
||||||
Text("Damus")
|
Text("Damus", comment: "Name of the app, shown on the first screen when user is not logged in.")
|
||||||
.font(Font.custom("Nunito", size: 50.0))
|
.font(Font.custom("Nunito", size: 50.0))
|
||||||
.kerning(-2)
|
.kerning(-2)
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ struct ThreadV2View: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.padding()
|
}.padding()
|
||||||
}.navigationBarTitle("Thread")
|
}.navigationBarTitle(NSLocalizedString("Thread", comment: "Navigation bar title for note thread."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ struct ThreadView: View {
|
|||||||
Group {
|
Group {
|
||||||
if is_chatroom {
|
if is_chatroom {
|
||||||
ChatroomView(damus: damus)
|
ChatroomView(damus: damus)
|
||||||
.navigationBarTitle(metadata?.name ?? "Chat")
|
.navigationBarTitle(metadata?.name ?? NSLocalizedString("Chat", comment: "Navigation bar title for Chatroom view."))
|
||||||
.environmentObject(thread)
|
.environmentObject(thread)
|
||||||
} else {
|
} else {
|
||||||
EventDetailView(damus: damus, thread: thread)
|
EventDetailView(damus: damus, thread: thread)
|
||||||
.navigationBarTitle(metadata?.name ?? "Thread")
|
.navigationBarTitle(metadata?.name ?? NSLocalizedString("Thread", comment: "Navigation bar title for threaded event detail view."))
|
||||||
.environmentObject(thread)
|
.environmentObject(thread)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
<key>replying_to_one_and_others</key>
|
<key>replying_to_one_and_others</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSStringLocalizedFormatKey</key>
|
<key>NSStringLocalizedFormatKey</key>
|
||||||
<string>Replying to %@%#@others@</string>
|
<string>Replying to %@%#@OTHERS@</string>
|
||||||
<key>others</key>
|
<key>OTHERS</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSStringFormatSpecTypeKey</key>
|
<key>NSStringFormatSpecTypeKey</key>
|
||||||
<string>NSStringPluralRuleType</string>
|
<string>NSStringPluralRuleType</string>
|
||||||
@@ -23,8 +23,8 @@
|
|||||||
<key>replying_to_two_and_others</key>
|
<key>replying_to_two_and_others</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSStringLocalizedFormatKey</key>
|
<key>NSStringLocalizedFormatKey</key>
|
||||||
<string>Replying to %@, %@%#@others@</string>
|
<string>Replying to %@, %@%#@OTHERS@</string>
|
||||||
<key>others</key>
|
<key>OTHERS</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSStringFormatSpecTypeKey</key>
|
<key>NSStringFormatSpecTypeKey</key>
|
||||||
<string>NSStringPluralRuleType</string>
|
<string>NSStringPluralRuleType</string>
|
||||||
@@ -38,5 +38,23 @@
|
|||||||
<string> & %d others</string>
|
<string> & %d others</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</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>0 other notes</string>
|
||||||
|
<key>one</key>
|
||||||
|
<string>1 other note</string>
|
||||||
|
<key>other</key>
|
||||||
|
<string>%d other notes</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
Reference in New Issue
Block a user