From 57beef89f72b015a2482bb927886a67fb5826926 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Thu, 4 Jan 2024 17:48:58 -0800 Subject: [PATCH] Delete --- Sources/Secretive/Localizable.xcstrings | 51 +++++++++++++++---- .../Secretive/Views/DeleteSecretView.swift | 10 ++-- 2 files changed, 46 insertions(+), 15 deletions(-) diff --git a/Sources/Secretive/Localizable.xcstrings b/Sources/Secretive/Localizable.xcstrings index 808dea8..fbf358b 100644 --- a/Sources/Secretive/Localizable.xcstrings +++ b/Sources/Secretive/Localizable.xcstrings @@ -72,9 +72,6 @@ }, "Cancel" : { - }, - "Confirm Name:" : { - }, "Create a new one by clicking here." : { @@ -197,16 +194,37 @@ "Delete" : { }, - "Delete %@?" : { - + "delete_confirmation_cancel_button" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Don't Delete" + } + } + } }, - "Don't Delete" : { - + "delete_confirmation_confirm_name_label" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Confirm Name:" + } + } + } }, - "Help" : { - + "delete_confirmation_delete_button" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Delete" + } + } + } }, - "If you delete %@, you will not be able to recover it. Type \"%@\" to confirm." : { + "delete_confirmation_description_%@_%@" : { "localizations" : { "en" : { "stringUnit" : { @@ -215,6 +233,19 @@ } } } + }, + "delete_confirmation_title_%@" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Delete %1$@?" + } + } + } + }, + "Help" : { + }, "Ignore" : { diff --git a/Sources/Secretive/Views/DeleteSecretView.swift b/Sources/Secretive/Views/DeleteSecretView.swift index d6b7739..5e3a6f9 100644 --- a/Sources/Secretive/Views/DeleteSecretView.swift +++ b/Sources/Secretive/Views/DeleteSecretView.swift @@ -18,24 +18,24 @@ struct DeleteSecretView: View { .padding() VStack { HStack { - Text("Delete \(secret.name)?").bold() + Text("delete_confirmation_title_\(secret.name)").bold() Spacer() } HStack { - Text("If you delete \(secret.name), you will not be able to recover it. Type \"\(secret.name)\" to confirm.") + Text("delete_confirmation_description_\(secret.name)_\(secret.name)") Spacer() } HStack { - Text("Confirm Name:") + Text("delete_confirmation_confirm_name_label") TextField(secret.name, text: $confirm) } } } HStack { Spacer() - Button("Delete", action: delete) + Button("delete_confirmation_delete_button", action: delete) .disabled(confirm != secret.name) - Button("Don't Delete") { + Button("delete_confirmation_cancel_button") { dismissalBlock(false) } .keyboardShortcut(.cancelAction)