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."
},
"Decrypt DMs" : {
"comment" : "Permission toggle to allow Nostr client to decrypt direct messages."
},
"Decrypt legacy DMs" : {
"comment" : "Permission toggle to allow Nostr client to decrypt legacy direct messages."
},
"Decrypt zap events" : {
"comment" : "Permission toggle to allow Nostr client to decrypt zap events."
},
"Done" : {
"comment" : "Button to go to the next view that adds the users entered private key."
},
"Encrypt DMs" : {
"comment" : "Permission toggle to allow Nostr client to encrypt direct messages."
},
"Encrypt legacy DMs" : {
"comment" : "Permission toggle to allow Nostr client to encrypt legacy direct messages."
},
"Get relays" : {
"comment" : "Permission toggle to allow Nostr client to get relays."
},
"History" : {
"comment" : "Title for History tab"
@@ -56,7 +56,7 @@
"comment" : "Title for Permissions tab"
},
"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." : {
"comment" : "Description of event signing policy that approves basic actions."
@@ -74,7 +74,7 @@
"comment" : "Prompt asking user which signing policy to use."
},
"Sign kind %@ events" : {
"comment" : "Permission toggle to allow Nostr client to sign events of a specific kind.."
},
"Yeti: Nostr Helper" : {
"comment" : "Application title."

View File

@@ -29,16 +29,43 @@ struct NostrClientView: View {
.font(.headline)
List {
Toggle("Read your profile", isOn: bindableNostrClientModel.readPublicKeyPermission)
Toggle("Get relays", isOn: bindableNostrClientModel.getRelaysPermission)
Toggle("Encrypt DMs", isOn: bindableNostrClientModel.nip44EncryptPermission)
Toggle("Decrypt DMs", isOn: bindableNostrClientModel.nip44DecryptPermission)
Toggle("Encrypt legacy DMs", isOn: bindableNostrClientModel.nip04EncryptPermission)
Toggle("Decrypt legacy DMs", isOn: bindableNostrClientModel.nip04DecryptPermission)
Toggle("Decrypt zap events", isOn: bindableNostrClientModel.decryptZapEventPermission)
Toggle(
String(localized: "Read your profile", comment: "Permission toggle to allow Nostr client to read your profile."),
isOn: bindableNostrClientModel.readPublicKeyPermission
)
Toggle(
String(localized: "Get relays", comment: "Permission toggle to allow Nostr client to get relays."),
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
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
)
}
}
}