From 7f7f8798b721fb0deb1413f3efe41a68d7899bf9 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Tue, 9 Sep 2025 22:54:30 -0700 Subject: [PATCH] More strings. --- .../Packages/Resources/Localizable.xcstrings | 308 ------------------ .../PersistentAuthenticationHandler.swift | 8 +- 2 files changed, 3 insertions(+), 313 deletions(-) diff --git a/Sources/Packages/Resources/Localizable.xcstrings b/Sources/Packages/Resources/Localizable.xcstrings index 4c74ae6..38e0bbd 100644 --- a/Sources/Packages/Resources/Localizable.xcstrings +++ b/Sources/Packages/Resources/Localizable.xcstrings @@ -808,84 +808,6 @@ } } }, - "auth_context_persist_for_duration_unknown" : { - "comment" : "When the user clicks the notification to leave a secret unlocked, they are shown a prompt to approve the action. This is the description, showing which secret will used. The placeholder is the name of the secret. This is a fallback used when a duration is unable to be specified.", - "extractionState" : "manual", - "localizations" : { - "ca" : { - "stringUnit" : { - "state" : "translated", - "value" : "desbloqueja el secret \"%1$(secretName)@\"" - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Secret \"%1$(secretName)@\" entsperren" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "unlock secret “%1$(secretName)@\"" - } - }, - "fi" : { - "stringUnit" : { - "state" : "translated", - "value" : "avaa salaisuuden \"%1$(secretName)@\" lukitus" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "déverrouiller le secret \"%1$(secretName)@\"" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "sblocca il Segreto \"%1$(secretName)@\"" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "シークレット“%1$(secretName)@”のロックを解除します" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "비밀 \"%1$(secretName)@\" 잠금 해제" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "odblokuj sekret “%1$(secretName)@”" - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "destravar secreto \"%1$(secretName)@\"" - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "разблокировать секрет \"%1$(secretName)@\"" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "解锁密钥串 \"%1$(secretName)@\"" - } - } - } - }, "auth_context_request_deny_button" : { "comment" : "When the user chooses to perform an action that requires Touch ID/password authentication, they are shown a prompt to approve the action. This is the deny button for that prompt.", "extractionState" : "manual", @@ -1042,17 +964,6 @@ } } }, - "copy_button" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Copy" - } - } - } - }, "copyable_click_to_copy_button" : { "extractionState" : "manual", "localizations" : { @@ -2076,83 +1987,6 @@ } } }, - "delete_confirmation_confirm_name_label" : { - "extractionState" : "manual", - "localizations" : { - "ca" : { - "stringUnit" : { - "state" : "translated", - "value" : "Confirma el nom" - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Name bestätigen" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Confirm Name" - } - }, - "fi" : { - "stringUnit" : { - "state" : "translated", - "value" : "Vahvista nimi" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Confirmer le nom" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Conferma nome" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "名前の確認" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "확인 이름" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Powtórz nazwę" - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "Confirmar Nome" - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "Подтвердить название" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "确认名称" - } - } - } - }, "delete_confirmation_delete_button" : { "extractionState" : "manual", "localizations" : { @@ -4555,77 +4389,6 @@ } } }, - "setup_ssh_added_manually_button" : { - "extractionState" : "manual", - "localizations" : { - "ca" : { - "stringUnit" : { - "state" : "translated", - "value" : "L'he afegida manualment" - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Ich habe es Manuell Eingefügt" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "I Added it Manually" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Je l'ai ajouté manuellement" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "L’ho aggiunta manualmente" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "手動で追加する" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "내가 수동으로 추가했습니다" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Dodałem to samodzielnie" - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "Eu adicionei manualmente" - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "Добавлено мною вручную" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "我自行手动添加" - } - } - } - }, "setup_updates_description" : { "extractionState" : "manual", "localizations" : { @@ -4768,77 +4531,6 @@ } } }, - "setup_updates_readmore" : { - "extractionState" : "manual", - "localizations" : { - "ca" : { - "stringUnit" : { - "state" : "translated", - "value" : "Llegiu més ací." - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Lies hier mehr darüber." - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Read more about this here." - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pour en savoir plus, cliquez ici." - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Leggi di più a riguardo qui." - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "詳細はこちら" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "이에 대한 자세한 내용은 여기를 참조하세요." - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Przeczytaj więcej tutaj." - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "Leia mais sobre isto aqui." - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "Больше подробностей здесь." - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "在此处查看详情。" - } - } - } - }, "setup_updates_title" : { "extractionState" : "manual", "localizations" : { diff --git a/Sources/Packages/Sources/SecureEnclaveSecretKit/PersistentAuthenticationHandler.swift b/Sources/Packages/Sources/SecureEnclaveSecretKit/PersistentAuthenticationHandler.swift index 79d4a30..4934c77 100644 --- a/Sources/Packages/Sources/SecureEnclaveSecretKit/PersistentAuthenticationHandler.swift +++ b/Sources/Packages/Sources/SecureEnclaveSecretKit/PersistentAuthenticationHandler.swift @@ -56,11 +56,9 @@ extension SecureEnclave { formatter.unitsStyle = .spellOut formatter.allowedUnits = [.hour, .minute, .day] - if let durationString = formatter.string(from: duration) { - newContext.localizedReason = String(localized: .authContextPersistForDuration(secretName: secret.name, duration: durationString)) - } else { - newContext.localizedReason = String(localized: .authContextPersistForDurationUnknown(secretName: secret.name)) - } + + let durationString = formatter.string(from: duration)! + newContext.localizedReason = String(localized: .authContextPersistForDuration(secretName: secret.name, duration: durationString)) let success = try await newContext.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: newContext.localizedReason) guard success else { return } let context = PersistentAuthenticationContext(secret: secret, context: newContext, duration: duration)