Make NostrClientView toggle strings localizable

This commit is contained in:
2025-01-22 00:27:57 -05:00
parent 7ac3f8be35
commit 7d63bd5ce4
2 changed files with 43 additions and 16 deletions

View File

@@ -14,25 +14,25 @@
"comment" : "Button to create a key." "comment" : "Button to create a key."
}, },
"Decrypt DMs" : { "Decrypt DMs" : {
"comment" : "Permission toggle to allow Nostr client to decrypt direct messages."
}, },
"Decrypt legacy DMs" : { "Decrypt legacy DMs" : {
"comment" : "Permission toggle to allow Nostr client to decrypt legacy direct messages."
}, },
"Decrypt zap events" : { "Decrypt zap events" : {
"comment" : "Permission toggle to allow Nostr client to decrypt zap events."
}, },
"Done" : { "Done" : {
"comment" : "Button to go to the next view that adds the users entered private key." "comment" : "Button to go to the next view that adds the users entered private key."
}, },
"Encrypt DMs" : { "Encrypt DMs" : {
"comment" : "Permission toggle to allow Nostr client to encrypt direct messages."
}, },
"Encrypt legacy DMs" : { "Encrypt legacy DMs" : {
"comment" : "Permission toggle to allow Nostr client to encrypt legacy direct messages."
}, },
"Get relays" : { "Get relays" : {
"comment" : "Permission toggle to allow Nostr client to get relays."
}, },
"History" : { "History" : {
"comment" : "Title for History tab" "comment" : "Title for History tab"
@@ -56,7 +56,7 @@
"comment" : "Title for Permissions tab" "comment" : "Title for Permissions tab"
}, },
"Read your profile" : { "Read your profile" : {
"comment" : "Permission toggle to allow Nostr client to read your profile."
}, },
"Recommended for most people. This policy will minimize the number of interruptions during your app usage." : { "Recommended for most people. This policy will minimize the number of interruptions during your app usage." : {
"comment" : "Description of event signing policy that approves basic actions." "comment" : "Description of event signing policy that approves basic actions."
@@ -74,7 +74,7 @@
"comment" : "Prompt asking user which signing policy to use." "comment" : "Prompt asking user which signing policy to use."
}, },
"Sign kind %@ events" : { "Sign kind %@ events" : {
"comment" : "Permission toggle to allow Nostr client to sign events of a specific kind.."
}, },
"Yeti: Nostr Helper" : { "Yeti: Nostr Helper" : {
"comment" : "Application title." "comment" : "Application title."

View File

@@ -29,16 +29,43 @@ struct NostrClientView: View {
.font(.headline) .font(.headline)
List { List {
Toggle("Read your profile", isOn: bindableNostrClientModel.readPublicKeyPermission) Toggle(
Toggle("Get relays", isOn: bindableNostrClientModel.getRelaysPermission) String(localized: "Read your profile", comment: "Permission toggle to allow Nostr client to read your profile."),
Toggle("Encrypt DMs", isOn: bindableNostrClientModel.nip44EncryptPermission) isOn: bindableNostrClientModel.readPublicKeyPermission
Toggle("Decrypt DMs", isOn: bindableNostrClientModel.nip44DecryptPermission) )
Toggle("Encrypt legacy DMs", isOn: bindableNostrClientModel.nip04EncryptPermission) Toggle(
Toggle("Decrypt legacy DMs", isOn: bindableNostrClientModel.nip04DecryptPermission) String(localized: "Get relays", comment: "Permission toggle to allow Nostr client to get relays."),
Toggle("Decrypt zap events", isOn: bindableNostrClientModel.decryptZapEventPermission) isOn: bindableNostrClientModel.getRelaysPermission
)
Toggle(
String(localized: "Encrypt DMs", comment: "Permission toggle to allow Nostr client to encrypt direct messages."),
isOn: bindableNostrClientModel.nip44EncryptPermission
)
Toggle(
String(localized: "Decrypt DMs", comment: "Permission toggle to allow Nostr client to decrypt direct messages."),
isOn: bindableNostrClientModel.nip44DecryptPermission
)
Toggle(
String(localized: "Encrypt legacy DMs", comment: "Permission toggle to allow Nostr client to encrypt legacy direct messages."),
isOn: bindableNostrClientModel.nip04EncryptPermission
)
Toggle(
String(localized: "Decrypt legacy DMs", comment: "Permission toggle to allow Nostr client to decrypt legacy direct messages."),
isOn: bindableNostrClientModel.nip04DecryptPermission
)
Toggle(
String(localized: "Decrypt zap events", comment: "Permission toggle to allow Nostr client to decrypt zap events."),
isOn: bindableNostrClientModel.decryptZapEventPermission
)
ForEach(bindableNostrClientModel.signEventPermissions, id: \.self) { signEventPermissionModel in ForEach(bindableNostrClientModel.signEventPermissions, id: \.self) { signEventPermissionModel in
Toggle("Sign kind \(signEventPermissionModel.kind.wrappedValue.description) events", isOn: signEventPermissionModel.allowed) Toggle(
String(
localized: "Sign kind \(signEventPermissionModel.kind.wrappedValue.description) events",
comment: "Permission toggle to allow Nostr client to sign events of a specific kind.."
),
isOn: signEventPermissionModel.allowed
)
} }
} }
} }