diff --git a/damus/Components/Status/UserStatusSheet.swift b/damus/Components/Status/UserStatusSheet.swift index 8ed36a9b..dec71135 100644 --- a/damus/Components/Status/UserStatusSheet.swift +++ b/damus/Components/Status/UserStatusSheet.swift @@ -7,30 +7,49 @@ import SwiftUI -enum StatusDuration: String, CaseIterable { - case never = "Never" - case thirty_mins = "30 Minutes" - case hour = "1 Hour" - case four_hours = "4 Hours" - case day = "1 Day" - case week = "1 Week" +enum StatusDuration: CustomStringConvertible, CaseIterable { + case never + case thirty_mins + case hour + case four_hours + case day + case week - var expiration: Date? { + var timeInterval: TimeInterval? { switch self { case .never: return nil case .thirty_mins: - return Date.now.addingTimeInterval(60 * 30) + return 60 * 30 case .hour: - return Date.now.addingTimeInterval(60 * 60) + return 60 * 60 case .four_hours: - return Date.now.addingTimeInterval(60 * 60 * 4) + return 60 * 60 * 4 case .day: - return Date.now.addingTimeInterval(60 * 60 * 24) + return 60 * 60 * 24 case .week: - return Date.now.addingTimeInterval(60 * 60 * 24 * 7) + return 60 * 60 * 24 * 7 } } + + var expiration: Date? { + guard let timeInterval else { + return nil + } + + return Date.now.addingTimeInterval(timeInterval) + } + + var description: String { + guard let timeInterval else { + return NSLocalizedString("Never", comment: "Profile status duration setting of never expiring.") + } + + let formatter = DateComponentsFormatter() + formatter.unitsStyle = .full + formatter.allowedUnits = [.minute, .hour, .day, .weekOfMonth] + return formatter.string(from: timeInterval) ?? "\(timeInterval) seconds" + } } struct UserStatusSheet: View { @@ -68,43 +87,43 @@ struct UserStatusSheet: View { var body: some View { VStack(alignment: .leading, spacing: 20) { - Text("Set Status") + Text("Set Status", comment: "Title of view that allows the user to set their profile status (e.g. working, studying, coding)") .font(.largeTitle) TextField(text: status_binding, label: { - Text("📋 Working") + Text("📋 Working", comment: "Placeholder as an example of what the user could set as their profile status.") }) HStack { Image("link") TextField(text: url_binding, label: { - Text("https://example.com") + Text("https://example.com", comment: "Placeholder as an example of what the user could set so that the link is opened when the status is tapped.") }) } HStack { - Text("Clear status") + Text("Clear status", comment: "Label to prompt user to select an expiration time for the profile status to clear.") Spacer() - Picker("Duration", selection: $duration) { + Picker(NSLocalizedString("Duration", comment: "Label for profile status expiration duration picker."), selection: $duration) { ForEach(StatusDuration.allCases, id: \.self) { d in - Text("\(d.rawValue)") + Text(verbatim: d.description) .tag(d) } } } Toggle(isOn: $status.playing_enabled, label: { - Text("Broadcast music playing on Apple Music") + Text("Broadcast music playing on Apple Music", comment: "Toggle to enable or disable broadcasting what music is being played on Apple Music in their profile status.") }) HStack(alignment: .center) { Button(action: { dismiss() }, label: { - Text("Cancel") + Text("Cancel", comment: "Cancel button text for dismissing profile status settings view.") }) Spacer() @@ -121,7 +140,7 @@ struct UserStatusSheet: View { dismiss() }, label: { - Text("Save") + Text("Save", comment: "Save button text for saving profile status settings.") }) .buttonStyle(GradientButtonStyle()) } diff --git a/damus/Views/Buttons/GradientFollowButton.swift b/damus/Views/Buttons/GradientFollowButton.swift index cd16c5e4..ed799405 100644 --- a/damus/Views/Buttons/GradientFollowButton.swift +++ b/damus/Views/Buttons/GradientFollowButton.swift @@ -22,7 +22,7 @@ struct GradientFollowButton: View { Button(action: { follow_state = perform_follow_btn_action(follow_state, target: target) }) { - Text("\(follow_btn_txt(follow_state, follows_you: follows_you))") + Text(follow_btn_txt(follow_state, follows_you: follows_you)) .foregroundColor(follow_state == .unfollows ? .white : grayTextColor) .font(.callout) .fontWeight(.medium) diff --git a/damus/Views/FollowingView.swift b/damus/Views/FollowingView.swift index 6cb911c7..045daa0c 100644 --- a/damus/Views/FollowingView.swift +++ b/damus/Views/FollowingView.swift @@ -40,7 +40,7 @@ struct FollowHashtagView: View { HStack { SingleCharacterAvatar(character: "#") - Text("#\(hashtag.hashtag)") + Text(verbatim: "#\(hashtag.hashtag)") .bold() } .onTapGesture { diff --git a/damus/Views/Relays/RelayConfigView.swift b/damus/Views/Relays/RelayConfigView.swift index bfa407a1..9f01d411 100644 --- a/damus/Views/Relays/RelayConfigView.swift +++ b/damus/Views/Relays/RelayConfigView.swift @@ -45,7 +45,7 @@ struct RelayConfigView: View { if recommended.count > 0 { VStack { - Text("Recommended relays") + Text("Recommended relays", comment: "Title for view of recommended relays.") .foregroundStyle(DamusLightGradient.gradient) .padding(10) .background { diff --git a/damus/Views/Relays/RelayPicView.swift b/damus/Views/Relays/RelayPicView.swift index 39beb462..a2875c46 100644 --- a/damus/Views/Relays/RelayPicView.swift +++ b/damus/Views/Relays/RelayPicView.swift @@ -13,7 +13,7 @@ struct FailedRelayImage: View { var body: some View { let abbrv = String(url?.host()?.first?.uppercased() ?? "R") - Text("\(abbrv)") + Text(abbrv) .font(.system(size: 40, weight: .bold)) } } diff --git a/damus/Views/Relays/RelayStatusView.swift b/damus/Views/Relays/RelayStatusView.swift index 88eda533..74a72f25 100644 --- a/damus/Views/Relays/RelayStatusView.swift +++ b/damus/Views/Relays/RelayStatusView.swift @@ -13,7 +13,7 @@ struct RelayStatusView: View { var body: some View { Group { if connection.isConnecting { - Text("Connecting") + Text("Connecting", comment: "Relay status label that indicates a relay is connecting.") .font(.caption) .frame(height: 20) .padding(.horizontal, 10) @@ -25,7 +25,7 @@ struct RelayStatusView: View { .stroke(DamusColors.warningBorder, lineWidth: 1) ) } else if connection.isConnected { - Text("Online") + Text("Online", comment: "Relay status label that indicates a relay is connected.") .font(.caption) .frame(height: 20) .padding(.horizontal, 10) @@ -37,7 +37,7 @@ struct RelayStatusView: View { .stroke(DamusColors.successBorder, lineWidth: 1) ) } else { - Text("Error") + Text("Error", comment: "Relay status label that indicates a relay had an error when connecting") .font(.caption) .frame(height: 20) .padding(.horizontal, 10) diff --git a/damus/Views/Settings/AppearanceSettingsView.swift b/damus/Views/Settings/AppearanceSettingsView.swift index 9e0c2d05..70f073b2 100644 --- a/damus/Views/Settings/AppearanceSettingsView.swift +++ b/damus/Views/Settings/AppearanceSettingsView.swift @@ -24,10 +24,8 @@ struct AppearanceSettingsView: View { var FontSize: some View { VStack(alignment: .leading) { - Slider(value: $settings.font_size, in: 0.5...2.0, step: 0.1) { - Text("Font Size") - } - .padding() + Slider(value: $settings.font_size, in: 0.5...2.0, step: 0.1) + .padding() // Sample text to show how the font size would look ResizedEventPreview(damus_state: damus_state, settings: settings) @@ -37,7 +35,7 @@ struct AppearanceSettingsView: View { var body: some View { Form { - Section("Font Size") { + Section(NSLocalizedString("Font Size", comment: "Section label for font size settings.")) { FontSize } @@ -49,7 +47,7 @@ struct AppearanceSettingsView: View { .toggleStyle(.switch) } - Section(header: Text("User Statuses")) { + Section(header: Text("User Statuses", comment: "Section header for user profile status settings.")) { Toggle(NSLocalizedString("Show general statuses", comment: "Settings toggle for enabling general user statuses"), isOn: $settings.show_general_statuses) .toggleStyle(.switch) diff --git a/damus/en-US.xcloc/Localized Contents/en-US.xliff b/damus/en-US.xcloc/Localized Contents/en-US.xliff index 852106c3..4953a76b 100644 --- a/damus/en-US.xcloc/Localized Contents/en-US.xliff +++ b/damus/en-US.xcloc/Localized Contents/en-US.xliff @@ -2,7 +2,7 @@
- +
@@ -15,6 +15,11 @@ damus Bundle name + + Damus needs access to your media library for playback statuses + Damus needs access to your media library for playback statuses + Privacy - Media Library Usage Description + Damus needs access to your camera if you want to upload photos from it Damus needs access to your camera if you want to upload photos from it @@ -39,15 +44,15 @@
- +
%@ %@ %@ %@ - Sentence composed of 2 variables to describe how many imports were performed from loading a NostrScript. In source English, the first variable is the number of imports, and the second variable is 'Import' or 'Imports'. -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 people are following a user. In source English, the first variable is the number of followers, and the second variable is 'Follower' or 'Followers'. + 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'. +Sentence composed of 2 variables to describe how many imports were performed from loading a NostrScript. In source English, the first variable is the number of imports, and the second variable is 'Import' or 'Imports'. +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'. %@ has been muted @@ -137,13 +142,19 @@ Sentence composed of 2 variables to describe how many people are following a use Add Add - Button to confirm adding user inputted relay. + Button to add relay server to list. + Button to confirm adding user inputted emoji. Add Bookmark Add Bookmark Button text to add bookmark to a note. + + Add Emoji + Add Emoji + Label for section for adding an emoji to the reactions list. + Add all Add all @@ -154,6 +165,11 @@ Sentence composed of 2 variables to describe how many people are following a use Add bookmark Context menu option for adding a note bookmark. + + Add relay + Add relay + Title text to indicate user to an add a relay. + Additional information Additional information @@ -206,6 +222,11 @@ Sentence composed of 2 variables to describe how many people are following a use Navigation title for text and appearance settings. Section header for text and appearance settings + + Appearance and filters + Appearance and filters + Section header for text, appearance, and content filter settings + Are you lost? Are you lost? @@ -283,6 +304,11 @@ Sentence composed of 2 variables to describe how many people are following a use Button to broadcast note to all your relays Context menu option for broadcasting the user's note to all of the user's connected relay servers. + + Broadcast music playing on Apple Music + Broadcast music playing on Apple Music + Toggle to enable or disable broadcasting what music is being played on Apple Music in their profile status. + Cancel Cancel @@ -290,7 +316,7 @@ Sentence composed of 2 variables to describe how many people are following a use Button to cancel a repost. Button to cancel out of alert that creates a new mutelist. Button to cancel out of posting a note. - Button to cancel out of view adding user inputted relay. + Button to cancel out of view adding user inputted emoji. Button to cancel the upload. Cancel deleting bookmarks. Cancel deleting the user. @@ -312,30 +338,36 @@ Sentence composed of 2 variables to describe how many people are following a use Clear Cache Button to clear image cache. - - Connect - Connect - Button to connect to recommended relay server. + + Clear status + Clear status + Label to prompt user to select an expiration time for the profile status to clear. Connect To Relay Connect To Relay - Label for section for adding a relay server. + Button to connect to the relay. - - Connected Relays - Connected Relays - Section title for relay servers that are connected. + + Connecting + Connecting + Relay status label that indicates a relay is connecting. Contact Contact Label to display relay contact information. + + Content filters + Content filters + Section title for content filtering/moderation configuration. + Continue Continue - Continue with bookmarks. + Button to dismiss suggested users view and continue to the main app + Continue with bookmarks. Continue with deleting the user. @@ -346,7 +378,9 @@ Sentence composed of 2 variables to describe how many people are following a use Copy Copy - Button to copy a relay server address. + Button to copy a relay server address. + Button to copy an emoji reaction + Context menu option for copying the version of damus. Copy Account ID @@ -521,7 +555,17 @@ Sentence composed of 2 variables to describe how many people are following a use Done Done - Button that, when tapped, will finish adding a different user's relays to your relay by hiding the + buttons next to the relays. + Button to dismiss wallet selection view for paying Lightning invoice. + + + Duplicate relay + Duplicate relay + Title of the duplicate relay error message. + + + Duration + Duration + Label for profile status expiration duration picker. EULA @@ -538,6 +582,11 @@ Sentence composed of 2 variables to describe how many people are following a use Edit Button to edit user's profile. + + Emoji Reactions + Emoji Reactions + Section title for emoji reactions that are currently added. + Encrypted Encrypted @@ -548,6 +597,11 @@ Sentence composed of 2 variables to describe how many people are following a use Enter your account key Prompt for user to enter an account key to login. + + Error + Error + Relay status label that indicates a relay had an error when connecting + Error fetching lightning invoice Error fetching lightning invoice @@ -588,6 +642,11 @@ Sentence composed of 2 variables to describe how many people are following a use Follow Button to follow a user. + + Follow All + Follow All + Button to follow all users in this section + Follow Back Follow Back @@ -643,6 +702,11 @@ Sentence composed of 2 variables to describe how many people are following a use Follows you Text to indicate that a user is following your profile. + + Font Size + Font Size + Section label for font size settings. + Free Free @@ -658,6 +722,11 @@ Sentence composed of 2 variables to describe how many people are following a use Get API Key with BTC/Lightning Button to navigate to nokyctranslate website to get a translation API key. + + Hashtags + Hashtags + Label for filter for seeing only hashtag follows. + Help build the future of decentralized communication on the web. Help build the future of decentralized communication on the web. @@ -673,6 +742,11 @@ Sentence composed of 2 variables to describe how many people are following a use Hide all 🤙's Section footer describing OnlyZaps mode + + Hide notes with #nsfw tags + Hide notes with #nsfw tags + Setting to hide notes with the #nsfw (not safe for work) tags + Home Home @@ -861,6 +935,16 @@ Sentence composed of 2 variables to describe how many people are following a use Muted Users Navigation title of view to see list of muted users. + + My Relays + My Relays + Section title for relay servers that the user is connected to. + + + Never + Never + Profile status duration setting of never expiring. + New encrypted direct message New encrypted direct message @@ -881,6 +965,11 @@ Sentence composed of 2 variables to describe how many people are following a use No data available Text indicating that there is no data available to show for specific metadata about a relay server. + + No logs to display + No logs to display + Label to indicate that there are no developer mode logs available to be displayed on the screen + No mute list found, create a new one? This will overwrite any previous mute lists. No mute list found, create a new one? This will overwrite any previous mute lists. @@ -939,14 +1028,19 @@ Sentence composed of 2 variables to describe how many people are following a use Notes Notes - Label for filter for seeing only notes (instead of notes and replies). -Label for filter for seeing only your notes (instead of notes and replies). + Label for filter for seeing only your notes (instead of notes and replies). +Label for filter for seeing only notes (instead of notes and replies). Notes & Replies Notes & Replies - Label for filter for seeing notes and replies (instead of only notes). -Label for filter for seeing your notes and replies (instead of only your notes). + Label for filter for seeing your notes and replies (instead of only your notes). +Label for filter for seeing notes and replies (instead of only notes). + + + Notes with the #nsfw tag usually contains adult content or other "Not safe for work" content + Notes with the #nsfw tag usually contains adult content or other "Not safe for work" content + Section footer clarifying what #nsfw (not safe for work) tags mean Nothing to see here. Check back later! @@ -979,6 +1073,11 @@ Label for filter for seeing your notes and replies (instead of only your notes). Ok Button to dismiss the alert. + + Online + Online + Relay status label that indicates a relay is connected. + Only you can see this message and who sent it. Only you can see this message and who sent it. @@ -1024,6 +1123,11 @@ Label for filter for seeing your notes and replies (instead of only your notes). Pay the Lightning invoice Navigation bar title for view to pay Lightning invoice. + + People + People + Label for filter for seeing only people follows. + Permanently Delete Account Permanently Delete Account @@ -1118,12 +1222,19 @@ Label for filter for seeing your notes and replies (instead of only your notes). Reactions Reactions - Navigation bar title for Reactions view. + Navigation bar title for Reactions view. + Section header for reactions settings + Title of emoji reactions view - - Recommended Relays - Recommended Relays - Section title for recommend relay servers that could be added as part of configuration + + Recommended Emojis + Recommended Emojis + Section title for recommend emojis + + + Recommended relays + Recommended relays + Title for view of recommended relays. Reject @@ -1316,6 +1427,11 @@ Label for filter for seeing your notes and replies (instead of only your notes). Select a Lightning wallet Title of section for selecting a Lightning wallet to pay a Lightning invoice. + + Select default emoji + Select default emoji + Prompt selection of user's default emoji reaction + Select default wallet Select default wallet @@ -1341,6 +1457,11 @@ Label for filter for seeing your notes and replies (instead of only your notes). Service Prompt selection of translation service provider. + + Set Status + Set Status + Sidebar menu label to set user status + Settings Settings @@ -1370,10 +1491,10 @@ Label for filter for seeing your notes and replies (instead of only your notes). Button to show a note from a user who has been muted. Toggle to show or hide user's secret account login key. - - Show + - Show + - Button that, when tapped, will show + buttons next to a user's relays. + + Show general statuses + Show general statuses + Settings toggle for enabling general user statuses Show less @@ -1386,6 +1507,11 @@ Label for filter for seeing your notes and replies (instead of only your notes). Button to show entire note. Button to show more of a long profile description. + + Show music statuses + Show music statuses + Settings toggle for enabling now playing music statuses + Show only from users you follow Show only from users you follow @@ -1416,6 +1542,11 @@ Label for filter for seeing your notes and replies (instead of only your notes). Sign out Sidebar menu label to sign out of the account. + + Skip + Skip + Button to dismiss the suggested users screen + Social media has developed into a key way information flows around the world. Unfortunately, our current social media systems are broken Social media has developed into a key way information flows around the world. Unfortunately, our current social media systems are broken @@ -1467,6 +1598,13 @@ Label for filter for seeing your notes and replies (instead of only your notes). The go-to iOS Nostr client Quick description of what Damus is + + The relay you are trying to add is already added. +You're all set! + The relay you are trying to add is already added. +You're all set! + An error message that appears when the user attempts to add a relay that has already been added. + - - This relay is already in your list - This relay is already in your list - An error message that appears when the user attempts to add a relay that has already been added. - Thread Thread @@ -1593,10 +1726,15 @@ Label for filter for seeing your notes and replies (instead of only your notes). Upload Button to proceed with uploading. + + User Statuses + User Statuses + Section header for user profile status settings. + User has been muted User has been muted - Alert message that informs a user was d. + Alert message that informs a user was muted. User muted @@ -1688,6 +1826,11 @@ YOU WILL NO LONGER BE ABLE TO LOG INTO DAMUS USING THIS ACCOUNT KEY. What is Nostr? Heading text for section describing what is Nostr. + + Who to Follow + Who to Follow + Title for a screen displaying suggestions of who to follow + Why we need Nostr? Why we need Nostr? @@ -1768,6 +1911,11 @@ YOU WILL NO LONGER BE ABLE TO LOG INTO DAMUS USING THIS ACCOUNT KEY. Setting to enable Zap Local Notification Title for section in zap settings that controls general zap preferences. + + https://example.com + https://example.com + Placeholder as an example of what the user could set so that the link is opened when the status is tapped. + https://example.com/pic.jpg https://example.com/pic.jpg @@ -1923,11 +2071,21 @@ YOU WILL NO LONGER BE ABLE TO LOG INTO DAMUS USING THIS ACCOUNT KEY. %@ and %@ zapped you Notification that 2 users zapped the current user's profile + + ⚡ + ⚡ + Placeholder example for an emoji reaction + + + 📋 Working + 📋 Working + Placeholder as an example of what the user could set as their profile status. +
- +
diff --git a/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/InfoPlist.strings b/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/InfoPlist.strings index 2f58dbfa..a2d5814b 100644 --- a/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/InfoPlist.strings +++ b/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/InfoPlist.strings @@ -2,6 +2,8 @@ "CFBundleDisplayName" = "Damus"; /* Bundle name */ "CFBundleName" = "damus"; +/* Privacy - Media Library Usage Description */ +"NSAppleMusicUsageDescription" = "Damus needs access to your media library for playback statuses"; /* Privacy - Camera Usage Description */ "NSCameraUsageDescription" = "Damus needs access to your camera if you want to upload photos from it"; /* Privacy - Face ID Usage Description */ diff --git a/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings b/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings index 3a67a16d..3550a55a 100644 Binary files a/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings and b/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings differ diff --git a/damus/en-US.xcloc/contents.json b/damus/en-US.xcloc/contents.json index cb06d8fd..cbdca296 100644 --- a/damus/en-US.xcloc/contents.json +++ b/damus/en-US.xcloc/contents.json @@ -3,10 +3,10 @@ "project" : "damus.xcodeproj", "targetLocale" : "en-US", "toolInfo" : { - "toolBuildNumber" : "14E300c", + "toolBuildNumber" : "15A240d", "toolID" : "com.apple.dt.xcode", "toolName" : "Xcode", - "toolVersion" : "14.3.1" + "toolVersion" : "15.0" }, "version" : "1.0" } \ No newline at end of file