From f583a3c263243bf396c333c796da08defc7e9163 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Thu, 4 Jan 2024 17:26:18 -0800 Subject: [PATCH] Continue --- Sources/Secretive.xcodeproj/project.pbxproj | 3 + Sources/Secretive/Localizable.xcstrings | 157 +++++++++++++++++- Sources/Secretive/Views/ContentView.swift | 4 +- .../Secretive/Views/CreateSecretView.swift | 20 +-- 4 files changed, 163 insertions(+), 21 deletions(-) diff --git a/Sources/Secretive.xcodeproj/project.pbxproj b/Sources/Secretive.xcodeproj/project.pbxproj index 76ec23d..d66c1dd 100644 --- a/Sources/Secretive.xcodeproj/project.pbxproj +++ b/Sources/Secretive.xcodeproj/project.pbxproj @@ -610,6 +610,7 @@ STRIP_INSTALLED_PRODUCT = NO; STRIP_SWIFT_SYMBOLS = NO; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; @@ -668,6 +669,7 @@ STRIP_INSTALLED_PRODUCT = NO; STRIP_SWIFT_SYMBOLS = NO; SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-O"; }; name = Release; @@ -831,6 +833,7 @@ STRIP_INSTALLED_PRODUCT = NO; STRIP_SWIFT_SYMBOLS = NO; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Test; diff --git a/Sources/Secretive/Localizable.xcstrings b/Sources/Secretive/Localizable.xcstrings index 126dbbc..0676a11 100644 --- a/Sources/Secretive/Localizable.xcstrings +++ b/Sources/Secretive/Localizable.xcstrings @@ -1,6 +1,9 @@ { "sourceLanguage" : "en", "strings" : { + "" : { + + }, "\n" : { }, @@ -17,7 +20,10 @@ } } }, - "agent_running_notice_detail_body" : { + "Add it For Me" : { + + }, + "agent_running_notice_detail_description" : { "localizations" : { "en" : { "stringUnit" : { @@ -47,7 +53,7 @@ } } }, - "app_not_in_applications_notice_detail_body" : { + "app_not_in_applications_notice_detail_description" : { "localizations" : { "en" : { "stringUnit" : { @@ -67,7 +73,7 @@ } } }, - "Authentication not required when Mac is unlocked" : { + "Cancel" : { }, "Confirm Name:" : { @@ -76,14 +82,132 @@ "Create a new one by clicking here." : { }, - "Create a New Secret" : { - + "create_secret_cancel_buton" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "create_secret_cancel" + } + } + } + }, + "create_secret_create_button" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Create" + } + } + } + }, + "create_secret_legacy_notify_description" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Authentication not required when Mac is unlocked" + } + } + } + }, + "create_secret_legacy_require_authentication_description" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Requires Authentication (Biometrics or Password) before each use" + } + } + } + }, + "create_secret_name_label" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Name:" + } + } + } + }, + "create_secret_name_placeholder" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Shhhhh" + } + } + } + }, + "create_secret_notify_description" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "No authentication is required while your Mac is unlocked, but you will be notified when a secret is used." + } + } + } + }, + "create_secret_notify_title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Notify" + } + } + } + }, + "create_secret_require_authentication_description" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "You will be required to authenticate using Touch ID, Apple Watch, or password before each use." + } + } + } + }, + "create_secret_require_authentication_title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Require Authentication" + } + } + } + }, + "create_secret_title" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Create a New Secret" + } + } + } }, "Delete" : { }, "Delete %@?" : { + }, + "Don't Delete" : { + + }, + "Help" : { + }, "If you delete %@, you will not be able to recover it. Type \"%@\" to confirm." : { "localizations" : { @@ -95,7 +219,19 @@ } } }, - "Name:" : { + "If you're looking to add one to your Mac, the YubiKey 5 Series are great." : { + + }, + "If you're trying to set up a third party app, check out the FAQ." : { + + }, + "Ignore" : { + + }, + "Key" : { + "extractionState" : "manual" + }, + "New Secret" : { }, "No Secrets" : { @@ -103,15 +239,15 @@ }, "No Secure Storage Available" : { + }, + "Read more about this here." : { + }, "Release Notes" : { }, "Rename" : { - }, - "Requires Authentication (Biometrics or Password) before each use" : { - }, "Secret Agent Is Not Running" : { @@ -142,6 +278,9 @@ }, "Type your new name for \"%@\" below." : { + }, + "Update" : { + }, "Use your Smart Card's management tool to create a secret." : { diff --git a/Sources/Secretive/Views/ContentView.swift b/Sources/Secretive/Views/ContentView.swift index e3153c0..f0db277 100644 --- a/Sources/Secretive/Views/ContentView.swift +++ b/Sources/Secretive/Views/ContentView.swift @@ -152,7 +152,7 @@ extension ContentView { Text("agent_running_notice_detail_title") .font(.title) .padding(5) - Text("agent_running_notice_detail_body") + Text("agent_running_notice_detail_description") .frame(width: 300) } .padding() @@ -178,7 +178,7 @@ extension ContentView { .resizable() .aspectRatio(contentMode: .fit) .frame(width: 64) - Text("app_not_in_applications_notice_detail_body") + Text("app_not_in_applications_notice_detail_description") .frame(maxWidth: 300) } .padding() diff --git a/Sources/Secretive/Views/CreateSecretView.swift b/Sources/Secretive/Views/CreateSecretView.swift index 428e0ca..9cb3f64 100644 --- a/Sources/Secretive/Views/CreateSecretView.swift +++ b/Sources/Secretive/Views/CreateSecretView.swift @@ -14,28 +14,28 @@ struct CreateSecretView: View { HStack { VStack { HStack { - Text("Create a New Secret") + Text("create_secret_title") .font(.largeTitle) Spacer() } HStack { - Text("Name:") - TextField("Shhhhh", text: $name) + Text("create_secret_name_label") + TextField("create_secret_name_placeholder", text: $name) .focusable() } if #available(macOS 12.0, *) { ThumbnailPickerView(items: [ - ThumbnailPickerView.Item(value: true, name: "Require Authentication", description: "You will be required to authenticate using Touch ID, Apple Watch, or password before each use.", thumbnail: AuthenticationView()), - ThumbnailPickerView.Item(value: false, name: "Notify", - description: "No authentication is required while your Mac is unlocked, but you will be notified when a secret is used.", + ThumbnailPickerView.Item(value: true, name: "create_secret_require_authentication_title", description: "create_secret_require_authentication_description", thumbnail: AuthenticationView()), + ThumbnailPickerView.Item(value: false, name: "create_secret_notify_title", + description: "create_secret_notify_description", thumbnail: NotificationView()) ], selection: $requiresAuthentication) } else { HStack { VStack(spacing: 20) { Picker("", selection: $requiresAuthentication) { - Text("Requires Authentication (Biometrics or Password) before each use").tag(true) - Text("Authentication not required when Mac is unlocked").tag(false) + Text("create_secret_legacy_require_authentication_description").tag(true) + Text("create_secret_legacy_notify_description").tag(false) } .pickerStyle(RadioGroupPickerStyle()) Spacer(minLength: 10) @@ -46,11 +46,11 @@ struct CreateSecretView: View { } HStack { Spacer() - Button("Cancel") { + Button("create_secret_cancel_buton") { showing = false } .keyboardShortcut(.cancelAction) - Button("Create", action: save) + Button("create_secret_create_button", action: save) .disabled(name.isEmpty) .keyboardShortcut(.defaultAction) }