1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00

Fix localization issues and export strings for translation

This commit is contained in:
Terry Yiu 2023-07-09 15:12:35 -04:00
parent 83ef50586a
commit fcd7d2beab
No known key found for this signature in database
GPG Key ID: 108645AE8A19B71A
10 changed files with 202 additions and 101 deletions

View File

@ -44,7 +44,8 @@ struct TranslateView: View {
func TranslatedView(lang: String?, artifacts: NoteArtifacts) -> some View {
return VStack(alignment: .leading) {
Text(String(format: NSLocalizedString("Translated from %@", comment: "Button to indicate that the note has been translated from a different language."), lang ?? "ja"))
let translatedFromLanguageString = String(format: NSLocalizedString("Translated from %@", comment: "Button to indicate that the note has been translated from a different language."), lang ?? "ja")
Text(translatedFromLanguageString)
.foregroundColor(.gray)
.font(.footnote)
.padding([.top, .bottom], 10)

View File

@ -80,6 +80,11 @@ class ScriptModel: ObservableObject {
}
}
func imports_string(_ count: Int, locale: Locale = Locale.current) -> String {
let format = localizedStringFormat(key: "imports_count", locale: locale)
return String(format: format, locale: locale, count)
}
struct LoadScript: View {
let pool: RelayPool
@ -89,10 +94,9 @@ struct LoadScript: View {
ScrollView {
VStack {
let imports = script.script.imports()
(Text(verbatim: "\(imports.count)") +
Text(" Imports"))
.font(.title)
let nounText = Text(verbatim: imports_string(imports.count)).font(.title)
Text("\(Text(verbatim: imports.count.formatted())) \(nounText)", comment: "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'.")
ForEach(imports.indices, id: \.self) { ind in
Text(imports[ind])
@ -100,25 +104,25 @@ struct LoadScript: View {
switch script.state {
case .loaded:
BigButton("Run") {
BigButton(NSLocalizedString("Run", comment: "Button that runs a NostrScript.")) {
Task {
await model.run()
}
}
case .running:
Text("Running...")
Text("Running...", comment: "Indication that the execution of a NostrScript is running.")
case .ran(let result):
switch result {
case .runtime_err(let errs):
Text("Runtime error")
Text("Runtime error", comment: "Indication that a runtime error occurred when running a NostrScript.")
.font(.title2)
ForEach(errs.indices, id: \.self) { ind in
Text(verbatim: errs[ind])
}
case .suspend:
Text("Ran to suspension.")
Text("Ran to suspension.", comment: "Indication that a NostrScript was run until it reached a suspended state.")
case .finished(let code):
Text("Executed successfuly, returned with code \(code)")
Text("Executed successfully, returned with code \(code.description)", comment: "Indication that the execution of running a NostrScript finished successfully, while providing a numeric return code.")
}
}
}
@ -138,13 +142,13 @@ struct LoadScript: View {
ScriptView(loaded)
case .failed(let load_err):
VStack(spacing: 20) {
Text("NostrScript Error")
Text("NostrScript Error", comment: "Text indicating that there was an error with loading NostrScript. There is a more descriptive error message shown separately underneath.")
.font(.title)
switch load_err {
case .parse:
Text("Failed to parse")
Text("Failed to parse", comment: "NostrScript error message when it fails to parse a script.")
case .module_init:
Text("Failed to initialize")
Text("Failed to initialize", comment: "NostrScript error message when it fails to initialize a module.")
}
}
}
@ -152,7 +156,7 @@ struct LoadScript: View {
.task {
await model.load(pool: self.pool)
}
.navigationTitle("NostrScript")
.navigationTitle(NSLocalizedString("NostrScript", comment: "Navigation title for the view showing NostrScript."))
}
}

View File

@ -452,7 +452,8 @@ struct ProfileView: View {
NavigationLink(value: Route.FollowersYouKnow(friendedFollowers: friended_followers, followers: followers)) {
HStack {
CondensedProfilePicturesView(state: damus_state, pubkeys: friended_followers, maxPictures: 3)
Text(followedByString(friended_followers, profiles: damus_state.profiles))
let followedByString = followedByString(friended_followers, profiles: damus_state.profiles)
Text(followedByString)
.font(.subheadline).foregroundColor(.gray)
.multilineTextAlignment(.leading)
}

View File

@ -126,7 +126,7 @@ struct RelayDetailView: View {
}
if state.settings.developer_mode, let log_contents = log.contents {
Section("Log") {
Section(NSLocalizedString("Log", comment: "Label to display developer mode logs.")) {
Text(log_contents)
.font(.system(size: 13))
.lineLimit(nil)

View File

@ -61,15 +61,15 @@ struct ZapTypePicker: View {
}
}
}
ZapTypeSelection(text: "Public", comment: "Picker option to indicate that a zap should be sent publicly and identify the user as who sent it.", img: "globe", action: {zap_type = ZapType.pub}, type: ZapType.pub)
ZapTypeSelection(text: "Private", comment: "Picker option to indicate that a zap should be sent privately and not identify the user to the public.", img: "lock", action: {zap_type = ZapType.priv}, type: ZapType.priv)
ZapTypeSelection(text: "Anonymous", comment: "Picker option to indicate that a zap should be sent anonymously and not identify the user as who sent it.", img: "question", action: {zap_type = ZapType.anon}, type: ZapType.anon)
ZapTypeSelection(text: "None", comment: "Picker option to indicate that sats should be sent to the user's wallet as a regular Lightning payment, not as a zap.", img: "zap", action: {zap_type = ZapType.non_zap}, type: ZapType.non_zap)
ZapTypeSelection(text: NSLocalizedString("Public", comment: "Picker option to indicate that a zap should be sent publicly and identify the user as who sent it."), img: "globe", action: {zap_type = ZapType.pub}, type: ZapType.pub)
ZapTypeSelection(text: NSLocalizedString("Private", comment: "Picker option to indicate that a zap should be sent privately and not identify the user to the public."), img: "lock", action: {zap_type = ZapType.priv}, type: ZapType.priv)
ZapTypeSelection(text: NSLocalizedString("Anonymous", comment: "Picker option to indicate that a zap should be sent anonymously and not identify the user as who sent it."), img: "question", action: {zap_type = ZapType.anon}, type: ZapType.anon)
ZapTypeSelection(text: NSLocalizedString("None", comment: "Picker option to indicate that sats should be sent to the user's wallet as a regular Lightning payment, not as a zap."), img: "zap", action: {zap_type = ZapType.non_zap}, type: ZapType.non_zap)
}
.padding(.horizontal)
}
func ZapTypeSelection(text: LocalizedStringKey, comment: StaticString, img: String, action: @escaping () -> (), type: ZapType) -> some View {
func ZapTypeSelection(text: String, img: String, action: @escaping () -> (), type: ZapType) -> some View {
Button(action: action) {
VStack(alignment: .leading, spacing: 5) {
HStack {
@ -79,14 +79,15 @@ struct ZapTypePicker: View {
.frame(width: 20, height: 20)
.foregroundColor(.gray)
Text(text, comment: comment)
Text(text)
.font(.system(size: 20, weight: .semibold))
Spacer()
}
.padding(.horizontal)
Text(zap_type_desc(type: type, profiles: profiles, pubkey: pubkey))
let zapTypeDescription = zap_type_desc(type: type, profiles: profiles, pubkey: pubkey)
Text(zapTypeDescription)
.padding(.horizontal)
.foregroundColor(.gray)
.font(.system(size: 16))

View File

@ -2,22 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>collapsed_event_view_other_notes</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@NOTES@</string>
<key>NOTES</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>one</key>
<string>... %d other note ...</string>
<key>other</key>
<string>... %d other notes ...</string>
</dict>
</dict>
<key>followed_by_three_and_others</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
@ -66,6 +50,22 @@
<string>Following</string>
</dict>
</dict>
<key>imports_count</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@IMPORTS@</string>
<key>IMPORTS</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>one</key>
<string>Import</string>
<key>other</key>
<string>Imports</string>
</dict>
</dict>
<key>reacted_tagged_in_3</key>
<dict>
<key>NSStringLocalizedFormatKey</key>

View File

@ -45,7 +45,8 @@
<trans-unit id="%@ %@" xml:space="preserve">
<source>%@ %@</source>
<target>%@ %@</target>
<note>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'.
<note>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'.</note>
</trans-unit>
<trans-unit id="%@ has been muted" xml:space="preserve">
@ -158,6 +159,11 @@ Sentence composed of 2 variables to describe how many people are following a use
<target>Add bookmark</target>
<note>Context menu option for adding a note bookmark.</note>
</trans-unit>
<trans-unit id="Additional information" xml:space="preserve">
<source>Additional information</source>
<target>Additional information</target>
<note>Header text to prompt user to optionally provide additional information when reporting a user or note.</note>
</trans-unit>
<trans-unit id="Admin" xml:space="preserve">
<source>Admin</source>
<target>Admin</target>
@ -191,7 +197,7 @@ Sentence composed of 2 variables to describe how many people are following a use
<trans-unit id="Anonymous" xml:space="preserve">
<source>Anonymous</source>
<target>Anonymous</target>
<note>Placeholder author name of the anonymous person who zapped an event.
<note>Picker option to indicate that a zap should be sent anonymously and not identify the user as who sent it.
Placeholder display name of anonymous user.</note>
</trans-unit>
<trans-unit id="Any" xml:space="preserve">
@ -486,6 +492,22 @@ Sentence composed of 2 variables to describe how many people are following a use
<target>Description</target>
<note>Label to display relay description.</note>
</trans-unit>
<trans-unit id="Developer" xml:space="preserve">
<source>Developer</source>
<target>Developer</target>
<note>Navigation title for developer settings
Section header for developer settings</note>
</trans-unit>
<trans-unit id="Developer Mode" xml:space="preserve">
<source>Developer Mode</source>
<target>Developer Mode</target>
<note>Setting to enable developer mode</note>
</trans-unit>
<trans-unit id="Developer Mode enables features and options that may help developers diagnose issues and improve this app. Most users will not need Developer Mode." xml:space="preserve">
<source>Developer Mode enables features and options that may help developers diagnose issues and improve this app. Most users will not need Developer Mode.</source>
<target>Developer Mode enables features and options that may help developers diagnose issues and improve this app. Most users will not need Developer Mode.</target>
<note>Section header for Developer Settings view</note>
</trans-unit>
<trans-unit id="Disconnect" xml:space="preserve">
<source>Disconnect</source>
<target>Disconnect</target>
@ -551,6 +573,21 @@ Sentence composed of 2 variables to describe how many people are following a use
<target>Everyone will see that you zapped</target>
<note>Description of public zap type where the zap is sent publicly and identifies the user who sent it.</note>
</trans-unit>
<trans-unit id="Executed successfully, returned with code %@" xml:space="preserve">
<source>Executed successfully, returned with code %@</source>
<target>Executed successfully, returned with code %@</target>
<note>Indication that the execution of running a NostrScript finished successfully, while providing a numeric return code.</note>
</trans-unit>
<trans-unit id="Failed to initialize" xml:space="preserve">
<source>Failed to initialize</source>
<target>Failed to initialize</target>
<note>NostrScript error message when it fails to initialize a module.</note>
</trans-unit>
<trans-unit id="Failed to parse" xml:space="preserve">
<source>Failed to parse</source>
<target>Failed to parse</target>
<note>NostrScript error message when it fails to parse a script.</note>
</trans-unit>
<trans-unit id="Filter" xml:space="preserve">
<source>Filter</source>
<target>Filter</target>
@ -646,10 +683,10 @@ Sentence composed of 2 variables to describe how many people are following a use
<target>Home</target>
<note>Navigation bar title for Home view where notes and replies appear from those who the user is following.</note>
</trans-unit>
<trans-unit id="Illegal content" xml:space="preserve">
<source>Illegal content</source>
<target>Illegal content</target>
<note>Button for user to report that the account or content has illegal content.</note>
<trans-unit id="Illegal Content" xml:space="preserve">
<source>Illegal Content</source>
<target>Illegal Content</target>
<note>Description of report type for illegal content.</note>
</trans-unit>
<trans-unit id="Image uploader" xml:space="preserve">
<source>Image uploader</source>
@ -661,16 +698,16 @@ Sentence composed of 2 variables to describe how many people are following a use
<target>Images</target>
<note>Section title for images configuration.</note>
</trans-unit>
<trans-unit id="Impersonation" xml:space="preserve">
<source>Impersonation</source>
<target>Impersonation</target>
<note>Description of report type for impersonation.</note>
</trans-unit>
<trans-unit id="Invalid Tip Address" xml:space="preserve">
<source>Invalid Tip Address</source>
<target>Invalid Tip Address</target>
<note>Title of alerting as invalid tip address.</note>
</trans-unit>
<trans-unit id="Invalid Zap" xml:space="preserve">
<source>Invalid Zap</source>
<target>Invalid Zap</target>
<note>Text indicating that a zap event is malformed and could not be displayed.</note>
</trans-unit>
<trans-unit id="Invalid key" xml:space="preserve">
<source>Invalid key</source>
<target>Invalid key</target>
@ -681,11 +718,6 @@ Sentence composed of 2 variables to describe how many people are following a use
<target>Invalid lightning address</target>
<note>Message to display when there was an error attempting to zap due to an invalid lightning address.</note>
</trans-unit>
<trans-unit id="It's spam" xml:space="preserve">
<source>It's spam</source>
<target>It's spam</target>
<note>Button for user to report that the account or content has spam.</note>
</trans-unit>
<trans-unit id="Keys" xml:space="preserve">
<source>Keys</source>
<target>Keys</target>
@ -757,6 +789,11 @@ Sentence composed of 2 variables to describe how many people are following a use
<target>Local default</target>
<note>Dropdown option label for system default for Lightning wallet.</note>
</trans-unit>
<trans-unit id="Log" xml:space="preserve">
<source>Log</source>
<target>Log</target>
<note>Label to display developer mode logs.</note>
</trans-unit>
<trans-unit id="Login" xml:space="preserve">
<source>Login</source>
<target>Login</target>
@ -878,13 +915,23 @@ Sentence composed of 2 variables to describe how many people are following a use
<trans-unit id="None" xml:space="preserve">
<source>None</source>
<target>None</target>
<note>Button text to indicate that the zap type is a private zap.</note>
<note>Picker option to indicate that sats should be sent to the user's wallet as a regular Lightning payment, not as a zap.</note>
</trans-unit>
<trans-unit id="Nostr is a protocol, designed for simplicity, that aims to create a censorship-resistant global social network" xml:space="preserve">
<source>Nostr is a protocol, designed for simplicity, that aims to create a censorship-resistant global social network</source>
<target>Nostr is a protocol, designed for simplicity, that aims to create a censorship-resistant global social network</target>
<note>Description about what is Nostr.</note>
</trans-unit>
<trans-unit id="NostrScript" xml:space="preserve">
<source>NostrScript</source>
<target>NostrScript</target>
<note>Navigation title for the view showing NostrScript.</note>
</trans-unit>
<trans-unit id="NostrScript Error" xml:space="preserve">
<source>NostrScript Error</source>
<target>NostrScript Error</target>
<note>Text indicating that there was an error with loading NostrScript. There is a more descriptive error message shown separately underneath.</note>
</trans-unit>
<trans-unit id="Note contains &quot;nsec1&quot; private key. Are you sure?" xml:space="preserve">
<source>Note contains "nsec1" private key. Are you sure?</source>
<target>Note contains "nsec1" private key. Are you sure?</target>
@ -928,10 +975,10 @@ Label for filter for seeing your notes and replies (instead of only your notes).
<note>Section header for Damus notifications
Toolbar label for Notifications view.</note>
</trans-unit>
<trans-unit id="Nudity or explicit content" xml:space="preserve">
<source>Nudity or explicit content</source>
<target>Nudity or explicit content</target>
<note>Button for user to report that the account or content has nudity or explicit content.</note>
<trans-unit id="Nudity" xml:space="preserve">
<source>Nudity</source>
<target>Nudity</target>
<note>Description of report type for nudity.</note>
</trans-unit>
<trans-unit id="Ok" xml:space="preserve">
<source>Ok</source>
@ -958,6 +1005,11 @@ Label for filter for seeing your notes and replies (instead of only your notes).
<target>OnlyZaps mode</target>
<note>Setting toggle to hide reactions.</note>
</trans-unit>
<trans-unit id="Optional" xml:space="preserve">
<source>Optional</source>
<target>Optional</target>
<note>Prompt to enter optional additional information when reporting an account or content.</note>
</trans-unit>
<trans-unit id="Paid Relay" xml:space="preserve">
<source>Paid Relay</source>
<target>Paid Relay</target>
@ -1002,8 +1054,7 @@ Label for filter for seeing your notes and replies (instead of only your notes).
<trans-unit id="Private" xml:space="preserve">
<source>Private</source>
<target>Private</target>
<note>Heading indicating that this application keeps personally identifiable information private. A sentence describing what is done to keep data private comes after this heading.
Button text to indicate that the zap type is a private zap.</note>
<note>Picker option to indicate that a zap should be sent privately and not identify the user to the public.</note>
</trans-unit>
<trans-unit id="Private Key" xml:space="preserve">
<source>Private Key</source>
@ -1020,6 +1071,11 @@ Button text to indicate that the zap type is a private zap.</note>
<target>Pro</target>
<note>Dropdown option for selecting Pro plan for DeepL translation service.</note>
</trans-unit>
<trans-unit id="Profanity" xml:space="preserve">
<source>Profanity</source>
<target>Profanity</target>
<note>Description of report type for profanity.</note>
</trans-unit>
<trans-unit id="Profile" xml:space="preserve">
<source>Profile</source>
<target>Profile</target>
@ -1033,7 +1089,7 @@ Button text to indicate that the zap type is a private zap.</note>
<trans-unit id="Public" xml:space="preserve">
<source>Public</source>
<target>Public</target>
<note>Button text to indicate that the zap type is a public zap.</note>
<note>Picker option to indicate that a zap should be sent publicly and identify the user as who sent it.</note>
</trans-unit>
<trans-unit id="Public Account ID" xml:space="preserve">
<source>Public Account ID</source>
@ -1060,6 +1116,11 @@ Button text to indicate that the zap type is a private zap.</note>
<target>Quote</target>
<note>Button to compose a quoted note</note>
</trans-unit>
<trans-unit id="Ran to suspension." xml:space="preserve">
<source>Ran to suspension.</source>
<target>Ran to suspension.</target>
<note>Indication that a NostrScript was run until it reached a suspended state.</note>
</trans-unit>
<trans-unit id="Reactions" xml:space="preserve">
<source>Reactions</source>
<target>Reactions</target>
@ -1143,6 +1204,16 @@ Button text to indicate that the zap type is a private zap.</note>
<target>Report ID:</target>
<note>Label indicating that the text underneath is the identifier of the report that was sent to relay servers.</note>
</trans-unit>
<trans-unit id="Report Note" xml:space="preserve">
<source>Report Note</source>
<target>Report Note</target>
<note>Button to report a note.</note>
</trans-unit>
<trans-unit id="Report User" xml:space="preserve">
<source>Report User</source>
<target>Report User</target>
<note>Button to report a user.</note>
</trans-unit>
<trans-unit id="Report sent!" xml:space="preserve">
<source>Report sent!</source>
<target>Report sent!</target>
@ -1180,6 +1251,21 @@ Button text to indicate that the zap type is a private zap.</note>
<target>Retry</target>
<note>Button to retry completing account creation after an error occurred.</note>
</trans-unit>
<trans-unit id="Run" xml:space="preserve">
<source>Run</source>
<target>Run</target>
<note>Button that runs a NostrScript.</note>
</trans-unit>
<trans-unit id="Running..." xml:space="preserve">
<source>Running...</source>
<target>Running...</target>
<note>Indication that the execution of a NostrScript is running.</note>
</trans-unit>
<trans-unit id="Runtime error" xml:space="preserve">
<source>Runtime error</source>
<target>Runtime error</target>
<note>Indication that a runtime error occurred when running a NostrScript.</note>
</trans-unit>
<trans-unit id="Satoshi Nakamoto" xml:space="preserve">
<source>Satoshi Nakamoto</source>
<target>Satoshi Nakamoto</target>
@ -1349,7 +1435,8 @@ Button text to indicate that the zap type is a private zap.</note>
<trans-unit id="Spam" xml:space="preserve">
<source>Spam</source>
<target>Spam</target>
<note>Section header for Universe/Search spam</note>
<note>Description of report type for spam.
Section header for Universe/Search spam</note>
</trans-unit>
<trans-unit id="Support Damus" xml:space="preserve">
<source>Support Damus</source>
@ -1386,11 +1473,6 @@ Button text to indicate that the zap type is a private zap.</note>
<target>The go-to iOS Nostr client</target>
<note>Quick description of what Damus is</note>
</trans-unit>
<trans-unit id="They are impersonating someone" xml:space="preserve">
<source>They are impersonating someone</source>
<target>They are impersonating someone</target>
<note>Button for user to report that the account is impersonating someone.</note>
</trans-unit>
<trans-unit id="This is a paid relay, you must pay for notes to be accepted." xml:space="preserve">
<source>This is a paid relay, you must pay for notes to be accepted.</source>
<target>This is a paid relay, you must pay for notes to be accepted.</target>
@ -1839,21 +1921,6 @@ YOU WILL NO LONGER BE ABLE TO LOG INTO DAMUS USING THIS ACCOUNT KEY.
<tool tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="14.3.1" build-num="14E300c"/>
</header>
<body>
<trans-unit id="/collapsed_event_view_other_notes:dict/NOTES:dict/one:dict/:string" xml:space="preserve">
<source>... %d other note ...</source>
<target>... %d other note ...</target>
<note/>
</trans-unit>
<trans-unit id="/collapsed_event_view_other_notes:dict/NOTES:dict/other:dict/:string" xml:space="preserve">
<source>... %d other notes ...</source>
<target>... %d other notes ...</target>
<note/>
</trans-unit>
<trans-unit id="/collapsed_event_view_other_notes:dict/NSStringLocalizedFormatKey:dict/:string" xml:space="preserve">
<source>%#@NOTES@</source>
<target>%#@NOTES@</target>
<note/>
</trans-unit>
<trans-unit id="/followed_by_three_and_others:dict/NSStringLocalizedFormatKey:dict/:string" xml:space="preserve">
<source>%#@OTHERS@</source>
<target>%#@OTHERS@</target>
@ -1899,6 +1966,21 @@ YOU WILL NO LONGER BE ABLE TO LOG INTO DAMUS USING THIS ACCOUNT KEY.
<target>%#@FOLLOWING@</target>
<note/>
</trans-unit>
<trans-unit id="/imports_count:dict/IMPORTS:dict/one:dict/:string" xml:space="preserve">
<source>Import</source>
<target>Import</target>
<note/>
</trans-unit>
<trans-unit id="/imports_count:dict/IMPORTS:dict/other:dict/:string" xml:space="preserve">
<source>Imports</source>
<target>Imports</target>
<note/>
</trans-unit>
<trans-unit id="/imports_count:dict/NSStringLocalizedFormatKey:dict/:string" xml:space="preserve">
<source>%#@IMPORTS@</source>
<target>%#@IMPORTS@</target>
<note/>
</trans-unit>
<trans-unit id="/reacted_tagged_in_3:dict/NSStringLocalizedFormatKey:dict/:string" xml:space="preserve">
<source>%#@REACTED@</source>
<target>%#@REACTED@</target>

View File

@ -2,22 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>collapsed_event_view_other_notes</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@NOTES@</string>
<key>NOTES</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>one</key>
<string>... %d other note ...</string>
<key>other</key>
<string>... %d other notes ...</string>
</dict>
</dict>
<key>followed_by_three_and_others</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
@ -66,6 +50,22 @@
<string>Following</string>
</dict>
</dict>
<key>imports_count</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@IMPORTS@</string>
<key>IMPORTS</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>one</key>
<string>Import</string>
<key>other</key>
<string>Imports</string>
</dict>
</dict>
<key>reacted_tagged_in_3</key>
<dict>
<key>NSStringLocalizedFormatKey</key>

View File

@ -105,6 +105,18 @@ final class NostrScriptTests: XCTestCase {
self.wait(for: [resume_expected], timeout: 10.0)
}
func test_imports_string() throws {
let enUsLocale = Locale(identifier: "en-US")
XCTAssertEqual(imports_string(0, locale: enUsLocale), "Imports")
XCTAssertEqual(imports_string(1, locale: enUsLocale), "Import")
XCTAssertEqual(imports_string(2, locale: enUsLocale), "Imports")
Bundle.main.localizations.map { Locale(identifier: $0) }.forEach {
for count in 1...10 {
XCTAssertNoThrow(imports_string(count, locale: $0))
}
}
}
func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {