Wrap non-translatable strings so that they do not get exported

This commit is contained in:
2023-02-15 10:44:44 -05:00
parent 59211bb4fd
commit 355cd1283c
17 changed files with 31 additions and 61 deletions

View File

@@ -110,7 +110,7 @@ struct ZapButton: View {
} }
.accessibilityLabel(NSLocalizedString("Zap", comment: "Accessibility label for zap button")) .accessibilityLabel(NSLocalizedString("Zap", comment: "Accessibility label for zap button"))
Text("\(bar.zap_total > 0 ? "\(format_msats_abbrev(bar.zap_total))" : "")") Text(String("\(bar.zap_total > 0 ? "\(format_msats_abbrev(bar.zap_total))" : "")"))
.offset(x: 22) .offset(x: 22)
.font(.footnote) .font(.footnote)
.foregroundColor(bar.zapped ? Color.orange : Color.gray) .foregroundColor(bar.zapped ? Color.orange : Color.gray)

View File

@@ -61,7 +61,7 @@ struct EventActionBar: View {
} }
} }
.accessibilityLabel(NSLocalizedString("Boosts", comment: "Accessibility label for boosts button")) .accessibilityLabel(NSLocalizedString("Boosts", comment: "Accessibility label for boosts button"))
Text("\(bar.boosts > 0 ? "\(bar.boosts)" : "")") Text(String("\(bar.boosts > 0 ? "\(bar.boosts)" : "")"))
.offset(x: 18) .offset(x: 18)
.font(.footnote.weight(.medium)) .font(.footnote.weight(.medium))
.foregroundColor(bar.boosted ? Color.green : Color.gray) .foregroundColor(bar.boosted ? Color.green : Color.gray)
@@ -76,7 +76,7 @@ struct EventActionBar: View {
send_like() send_like()
} }
} }
Text("\(bar.likes > 0 ? "\(bar.likes)" : "")") Text(String("\(bar.likes > 0 ? "\(bar.likes)" : "")"))
.offset(x: 22) .offset(x: 22)
.font(.footnote.weight(.medium)) .font(.footnote.weight(.medium))
.foregroundColor(bar.liked ? Color.accentColor : Color.gray) .foregroundColor(bar.liked ? Color.accentColor : Color.gray)
@@ -158,7 +158,7 @@ struct EventActionBar: View {
func EventActionButton(img: String, col: Color?, action: @escaping () -> ()) -> some View { func EventActionButton(img: String, col: Color?, action: @escaping () -> ()) -> some View {
Button(action: action) { Button(action: action) {
Label(NSLocalizedString("\u{00A0}", comment: "Non-breaking space character to fill in blank space next to event action button icons."), systemImage: img) Label(String("\u{00A0}"), systemImage: img)
.font(.footnote.weight(.medium)) .font(.footnote.weight(.medium))
.foregroundColor(col == nil ? Color.gray : col!) .foregroundColor(col == nil ? Color.gray : col!)
} }

View File

@@ -26,14 +26,14 @@ struct EventDetailBar: View {
HStack { HStack {
if bar.boosts > 0 { if bar.boosts > 0 {
NavigationLink(destination: RepostsView(damus_state: state, model: RepostsModel(state: state, target: target))) { NavigationLink(destination: RepostsView(damus_state: state, model: RepostsModel(state: state, target: target))) {
Text("\(Text("\(bar.boosts)", comment: "Number of reposts.").font(.body.bold())) \(Text(String(format: NSLocalizedString("reposts_count", comment: "Part of a larger sentence to describe how many reposts there are."), bar.boosts)).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many reposts. In source English, the first variable is the number of reposts, and the second variable is 'Repost' or 'Reposts'.") Text("\(Text(String("\(bar.boosts)")).font(.body.bold())) \(Text(String(format: NSLocalizedString("reposts_count", comment: "Part of a larger sentence to describe how many reposts there are."), bar.boosts)).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many reposts. In source English, the first variable is the number of reposts, and the second variable is 'Repost' or 'Reposts'.")
} }
.buttonStyle(PlainButtonStyle()) .buttonStyle(PlainButtonStyle())
} }
if bar.likes > 0 { if bar.likes > 0 {
NavigationLink(destination: ReactionsView(damus_state: state, model: ReactionsModel(state: state, target: target))) { NavigationLink(destination: ReactionsView(damus_state: state, model: ReactionsModel(state: state, target: target))) {
Text("\(Text("\(bar.likes)", comment: "Number of reactions on a post.").font(.body.bold())) \(Text(String(format: NSLocalizedString("reactions_count", comment: "Part of a larger sentence to describe how many reactions there are on a post."), bar.likes)).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many reactions there are on a post. In source English, the first variable is the number of reactions, and the second variable is 'Reaction' or 'Reactions'.") Text("\(Text(String("\(bar.likes)")).font(.body.bold())) \(Text(String(format: NSLocalizedString("reactions_count", comment: "Part of a larger sentence to describe how many reactions there are on a post."), bar.likes)).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many reactions there are on a post. In source English, the first variable is the number of reactions, and the second variable is 'Reaction' or 'Reactions'.")
} }
.buttonStyle(PlainButtonStyle()) .buttonStyle(PlainButtonStyle())
} }
@@ -41,7 +41,7 @@ struct EventDetailBar: View {
if bar.zaps > 0 { if bar.zaps > 0 {
let dst = ZapsView(state: state, target: .note(id: target, author: target_pk)) let dst = ZapsView(state: state, target: .note(id: target, author: target_pk))
NavigationLink(destination: dst) { NavigationLink(destination: dst) {
Text("\(Text("\(bar.zaps)", comment: "Number of zap payments on a post.").font(.body.bold())) \(Text(String(format: NSLocalizedString("zaps_count", comment: "Part of a larger sentence to describe how many zap payments there are on a post."), bar.boosts)).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many zap payments there are on a post. In source English, the first variable is the number of zap payments, and the second variable is 'Zap' or 'Zaps'.") Text("\(Text(String("\(bar.zaps)")).font(.body.bold())) \(Text(String(format: NSLocalizedString("zaps_count", comment: "Part of a larger sentence to describe how many zap payments there are on a post."), bar.boosts)).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many zap payments there are on a post. In source English, the first variable is the number of zap payments, and the second variable is 'Zap' or 'Zaps'.")
} }
.buttonStyle(PlainButtonStyle()) .buttonStyle(PlainButtonStyle())
} }

View File

@@ -63,7 +63,7 @@ struct ChatView: View {
} }
var ReplyDescription: some View { var ReplyDescription: some View {
Text("\(reply_desc(profiles: damus_state.profiles, event: event))") Text(String("\(reply_desc(profiles: damus_state.profiles, event: event))"))
.font(.footnote) .font(.footnote)
.foregroundColor(.gray) .foregroundColor(.gray)
.frame(alignment: .leading) .frame(alignment: .leading)
@@ -89,7 +89,7 @@ struct ChatView: View {
ProfileName(pubkey: event.pubkey, profile: damus_state.profiles.lookup(id: event.pubkey), damus: damus_state, show_friend_confirmed: true) ProfileName(pubkey: event.pubkey, profile: damus_state.profiles.lookup(id: event.pubkey), damus: damus_state, show_friend_confirmed: true)
.foregroundColor(colorScheme == .dark ? id_to_color(event.pubkey) : Color.black) .foregroundColor(colorScheme == .dark ? id_to_color(event.pubkey) : Color.black)
//.shadow(color: Color.black, radius: 2) //.shadow(color: Color.black, radius: 2)
Text("\(format_relative_time(event.created_at))") Text(String("\(format_relative_time(event.created_at))"))
.foregroundColor(.gray) .foregroundColor(.gray)
} }
} }

View File

@@ -130,7 +130,7 @@ struct ConfigView: View {
Section(NSLocalizedString("Default Zap Amount in sats", comment: "Section title for zap configuration")) { Section(NSLocalizedString("Default Zap Amount in sats", comment: "Section title for zap configuration")) {
TextField("1000", text: $default_zap_amount) TextField(String("1000"), text: $default_zap_amount)
} }
Section(NSLocalizedString("Translations", comment: "Section title for selecting the translation service.")) { Section(NSLocalizedString("Translations", comment: "Section title for selecting the translation service.")) {
@@ -204,7 +204,7 @@ struct ConfigView: View {
let bundleShortVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String let bundleShortVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String
let bundleVersion = Bundle.main.infoDictionary?["CFBundleVersion"] as! String let bundleVersion = Bundle.main.infoDictionary?["CFBundleVersion"] as! String
Section(NSLocalizedString("Version", comment: "Section title for displaying the version number of the Damus app.")) { Section(NSLocalizedString("Version", comment: "Section title for displaying the version number of the Damus app.")) {
Text("\(bundleShortVersion) (\(bundleVersion))", comment: "Text indicating which version of the Damus app is running. Should typically not need to be translated.") Text(String("\(bundleShortVersion) (\(bundleVersion))"))
} }
} }
} }

View File

@@ -36,14 +36,14 @@ struct CreateAccountView: View {
HStack(alignment: .top) { HStack(alignment: .top) {
VStack { VStack {
Text(" ", comment: "Blank space to separate profile picture from profile editor form.") Text(String(" "))
.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("@", comment: "Prefix character to username.") Text(String("@"))
.foregroundColor(.white) .foregroundColor(.white)
.padding(.leading, -25.0) .padding(.leading, -25.0)

View File

@@ -10,7 +10,7 @@ import SwiftUI
struct EventDetailView: View { struct EventDetailView: View {
var body: some View { var body: some View {
Text("EventDetailView") Text(String("EventDetailView"))
} }
} }

View File

@@ -13,7 +13,7 @@ struct ReplyDescription: View {
let profiles: Profiles let profiles: Profiles
var body: some View { var body: some View {
Text("\(reply_desc(profiles: profiles, event: event))") Text(String("\(reply_desc(profiles: profiles, event: event))"))
.font(.footnote) .font(.footnote)
.foregroundColor(.gray) .foregroundColor(.gray)
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)

View File

@@ -35,7 +35,7 @@ struct SelectedEventView: View {
BuilderEventView(damus: damus, event_id: mention.ref.id) BuilderEventView(damus: damus, event_id: mention.ref.id)
} }
Text("\(format_date(event.created_at))") Text(String("\(format_date(event.created_at))"))
.padding(.top, 10) .padding(.top, 10)
.font(.footnote) .font(.footnote)
.foregroundColor(.gray) .foregroundColor(.gray)

View File

@@ -33,7 +33,7 @@ struct TextEvent: View {
HStack(alignment: .center) { HStack(alignment: .center) {
EventProfileName(pubkey: pubkey, profile: profile, damus: damus, show_friend_confirmed: true, size: .normal) EventProfileName(pubkey: pubkey, profile: profile, damus: damus, show_friend_confirmed: true, size: .normal)
Text("\(format_relative_time(event.created_at))") Text(String("\(format_relative_time(event.created_at))"))
.foregroundColor(.gray) .foregroundColor(.gray)
Spacer() Spacer()

View File

@@ -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 >", comment: "Placeholder for event mention.") Text(String("< e >"))
//EventBlockView(pubkey: mention.ref.ref_id, relay: mention.ref.relay_id) //EventBlockView(pubkey: mention.ref.ref_id, relay: mention.ref.relay_id)
} }
} }

View File

@@ -11,7 +11,7 @@ import SwiftUI
func PowView(_ mpow: Int?) -> some View func PowView(_ mpow: Int?) -> some View
{ {
let pow = mpow ?? 0 let pow = mpow ?? 0
return Text("\(pow)") return Text(String("\(pow)"))
.font(.callout) .font(.callout)
.foregroundColor(calculate_pow_color(pow)) .foregroundColor(calculate_pow_color(pow))
} }

View File

@@ -300,7 +300,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("\(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'.") Text("\(Text(String("\(profile.following)")).font(.subheadline.weight(.medium))) \(Text("Following", comment: "Part of a larger sentence to describe how many profiles a user is following.").font(.subheadline).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many profiles a user is following. In source English, the first variable is the number of profiles being followed, and the second variable is 'Following'.")
} }
} }
.buttonStyle(PlainButtonStyle()) .buttonStyle(PlainButtonStyle())
@@ -323,7 +323,7 @@ struct ProfileView: View {
if let relays = profile.relays { if let relays = profile.relays {
// Only open relay config view if the user is logged in with private key and they are looking at their own profile. // Only open relay config view if the user is logged in with private key and they are looking at their own profile.
let relay_text = Text("\(Text("\(relays.keys.count)", comment: "Number of relay servers a user is connected.").font(.subheadline.weight(.medium))) \(Text(String(format: NSLocalizedString("relays_count", comment: "Part of a larger sentence to describe how many relay servers a user is connected."), relays.keys.count)).font(.subheadline).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many relay servers a user is connected. In source English, the first variable is the number of relay servers, and the second variable is 'Relay' or 'Relays'.") let relay_text = Text("\(Text(String("\(relays.keys.count)")).font(.subheadline.weight(.medium))) \(Text(String(format: NSLocalizedString("relays_count", comment: "Part of a larger sentence to describe how many relay servers a user is connected."), relays.keys.count)).font(.subheadline).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many relay servers a user is connected. In source English, the first variable is the number of relay servers, and the second variable is 'Relay' or 'Relays'.")
if profile.pubkey == damus_state.pubkey && damus_state.is_privkey_user { if profile.pubkey == damus_state.pubkey && damus_state.is_privkey_user {
NavigationLink(destination: RelayConfigView(state: damus_state)) { NavigationLink(destination: RelayConfigView(state: damus_state)) {
relay_text relay_text
@@ -353,7 +353,7 @@ struct ProfileView: View {
.foregroundColor(.gray) .foregroundColor(.gray)
} else { } else {
let followerCount = followers.count! let followerCount = followers.count!
Text("\(Text("\(followerCount)", comment: "Number of people following a user.").font(.subheadline.weight(.medium))) \(Text(String(format: NSLocalizedString("followers_count", comment: "Part of a larger sentence to describe how many people are following a user."), followerCount)).font(.subheadline).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many people are following a user. In source English, the first variable is the number of followers, and the second variable is 'Follower' or 'Followers'.") Text("\(Text(String("\(followerCount)")).font(.subheadline.weight(.medium))) \(Text(String(format: NSLocalizedString("followers_count", comment: "Part of a larger sentence to describe how many people are following a user."), followerCount)).font(.subheadline).foregroundColor(.gray))", comment: "Sentence composed of 2 variables to describe how many people are following a user. In source English, the first variable is the number of followers, and the second variable is 'Follower' or 'Followers'.")
} }
} }
} }

View File

@@ -14,7 +14,7 @@ struct PubkeyView: View {
var body: some View { var body: some View {
let color: Color = id_to_color(pubkey) let color: Color = id_to_color(pubkey)
ZStack { ZStack {
Text("\(abbrev_pubkey(pubkey))", comment: "Abbreviated version of a nostr public key.") Text(String("\(abbrev_pubkey(pubkey))"))
.foregroundColor(color) .foregroundColor(color)
} }
} }

View File

@@ -19,7 +19,7 @@ struct RelayPaidDetail: View {
Button(action: { Button(action: {
openURL(url) openURL(url)
}, label: { }, label: {
Text("\(url)") Text(String("\(url)"))
}) })
} }
} }

View File

@@ -32,16 +32,6 @@
<tool tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="14.2" build-num="14C18"/> <tool tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="14.2" build-num="14C18"/>
</header> </header>
<body> <body>
<trans-unit id=" " xml:space="preserve">
<source> </source>
<target> </target>
<note>Blank space to separate profile picture from profile editor form.</note>
</trans-unit>
<trans-unit id="%@" xml:space="preserve">
<source>%@</source>
<target>%@</target>
<note>Abbreviated version of a nostr public key.</note>
</trans-unit>
<trans-unit id="%@ %@" xml:space="preserve"> <trans-unit id="%@ %@" xml:space="preserve">
<source>%@ %@</source> <source>%@ %@</source>
<target>%@ %@</target> <target>%@ %@</target>
@@ -68,12 +58,6 @@ Sentence composed of 2 variables to describe how many relay servers a user is co
<target>%@. Tip your friend's posts and stack sats with Bitcoin⚡, the native currency of the internet.</target> <target>%@. Tip your friend's posts and stack sats with Bitcoin⚡, the native currency of the internet.</target>
<note>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.</note> <note>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.</note>
</trans-unit> </trans-unit>
<trans-unit id="%lld" xml:space="preserve">
<source>%lld</source>
<target>%lld</target>
<note>Number of reposts.
Number of relay servers a user is connected.</note>
</trans-unit>
<trans-unit id="%lld/%lld" xml:space="preserve"> <trans-unit id="%lld/%lld" xml:space="preserve">
<source>%lld/%lld</source> <source>%lld/%lld</source>
<target>%lld/%lld</target> <target>%lld/%lld</target>
@@ -99,16 +83,6 @@ Number of relay servers a user is connected.</note>
<target>(who) following</target> <target>(who) following</target>
<note>Navigation bar title for view that shows who a user is following.</note> <note>Navigation bar title for view that shows who a user is following.</note>
</trans-unit> </trans-unit>
<trans-unit id="&lt; e &gt;" xml:space="preserve">
<source>&lt; e &gt;</source>
<target>&lt; e &gt;</target>
<note>Placeholder for event mention.</note>
</trans-unit>
<trans-unit id="@" xml:space="preserve">
<source>@</source>
<target>@</target>
<note>Prefix character to username.</note>
</trans-unit>
<trans-unit id="API Key (optional)" xml:space="preserve"> <trans-unit id="API Key (optional)" xml:space="preserve">
<source>API Key (optional)</source> <source>API Key (optional)</source>
<target>API Key (optional)</target> <target>API Key (optional)</target>
@@ -395,6 +369,11 @@ Number of relay servers a user is connected.</note>
<target>Default Wallet</target> <target>Default Wallet</target>
<note>Button to pay a Lightning invoice with the user's default Lightning wallet.</note> <note>Button to pay a Lightning invoice with the user's default Lightning wallet.</note>
</trans-unit> </trans-unit>
<trans-unit id="Default Zap Amount in sats" xml:space="preserve">
<source>Default Zap Amount in sats</source>
<target>Default Zap Amount in sats</target>
<note>Section title for zap configuration</note>
</trans-unit>
<trans-unit id="Delete" xml:space="preserve"> <trans-unit id="Delete" xml:space="preserve">
<source>Delete</source> <source>Delete</source>
<target>Delete</target> <target>Delete</target>
@@ -468,11 +447,6 @@ Number of relay servers a user is connected.</note>
<target>Error: %@</target> <target>Error: %@</target>
<note>Error message indicating why saving keys failed.</note> <note>Error message indicating why saving keys failed.</note>
</trans-unit> </trans-unit>
<trans-unit id="EventDetailView" xml:space="preserve">
<source>EventDetailView</source>
<target>EventDetailView</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Filter" xml:space="preserve"> <trans-unit id="Filter" xml:space="preserve">
<source>Filter</source> <source>Filter</source>
<target>Filter</target> <target>Filter</target>
@@ -1110,7 +1084,8 @@ Part of a larger sentence to describe how many profiles a user is following.</no
<trans-unit id="Version" xml:space="preserve"> <trans-unit id="Version" xml:space="preserve">
<source>Version</source> <source>Version</source>
<target>Version</target> <target>Version</target>
<note>Label to display relay software version.</note> <note>Label to display relay software version.
Section title for displaying the version number of the Damus app.</note>
</trans-unit> </trans-unit>
<trans-unit id="Wallet" xml:space="preserve"> <trans-unit id="Wallet" xml:space="preserve">
<source>Wallet</source> <source>Wallet</source>
@@ -1262,11 +1237,6 @@ Part of a larger sentence to describe how many profiles a user is following.</no
<target>sats_count</target> <target>sats_count</target>
<note>Amount of sats. (Key in .stringsdict)</note> <note>Amount of sats. (Key in .stringsdict)</note>
</trans-unit> </trans-unit>
<trans-unit id="u{00A0}" xml:space="preserve">
<source>u{00A0}</source>
<target>u{00A0}</target>
<note>Non-breaking space character to fill in blank space next to event action button icons.</note>
</trans-unit>
<trans-unit id="wss://some.relay.com" xml:space="preserve"> <trans-unit id="wss://some.relay.com" xml:space="preserve">
<source>wss://some.relay.com</source> <source>wss://some.relay.com</source>
<target>wss://some.relay.com</target> <target>wss://some.relay.com</target>