From 5718ae6805f72dd1543b914c3e1e81eaee6149e3 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Fri, 5 Jan 2024 12:37:59 -0800 Subject: [PATCH] Continue localization (#503) * Comments in agent. * Fix copyable view --- Sources/SecretAgent/Localizable.xcstrings | 9 +++++++++ Sources/Secretive/Localizable.xcstrings | 20 ++++++++++++++++++++ Sources/Secretive/Views/CopyableView.swift | 6 +++--- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/Sources/SecretAgent/Localizable.xcstrings b/Sources/SecretAgent/Localizable.xcstrings index f62bcd5..b0a6190 100644 --- a/Sources/SecretAgent/Localizable.xcstrings +++ b/Sources/SecretAgent/Localizable.xcstrings @@ -2,6 +2,7 @@ "sourceLanguage" : "en", "strings" : { "persist_authentication_accept_button" : { + "comment" : "When the user authorizes an action using a secret that requires unlock, they're shown a notification offering to leave the secret unlocked for a set period of time. This is the title for the notification.", "extractionState" : "manual", "localizations" : { "en" : { @@ -13,6 +14,7 @@ } }, "persist_authentication_decline_button" : { + "comment" : "When the user authorizes an action using a secret that requires unlock, they're shown a notification offering to leave the secret unlocked for a set period of time. This is the decline button for the notification.", "extractionState" : "manual", "localizations" : { "en" : { @@ -24,6 +26,7 @@ } }, "signed_notification_description_%@" : { + "comment" : "When the user performs an action using a secret, they're shown a notification describing what happened. This is the description, showing which secret was used. The placeholder is the name of the secret.", "extractionState" : "manual", "localizations" : { "en" : { @@ -35,6 +38,7 @@ } }, "signed_notification_title_%@" : { + "comment" : "When the user performs an action using a secret, they're shown a notification describing what happened. This is the title, showing which app requested the action. The placeholder is the name of the app.", "extractionState" : "manual", "localizations" : { "en" : { @@ -46,6 +50,7 @@ } }, "update_notification_ignore_button" : { + "comment" : "When an update is available, a notification is shown. This is the button to decline an update.", "extractionState" : "manual", "localizations" : { "en" : { @@ -57,6 +62,7 @@ } }, "update_notification_update_button" : { + "comment" : "When an update is available, a notification is shown. This is the button to download an update.", "extractionState" : "manual", "localizations" : { "en" : { @@ -68,6 +74,7 @@ } }, "update_notification_update_critical_title_%@" : { + "comment" : "When an update is available, a notification is shown. This is the title for a very high priority update with security fixes. The placeholder is for the application version, eg \"Critical Security Update - 2.0\"", "extractionState" : "manual", "localizations" : { "en" : { @@ -79,6 +86,7 @@ } }, "update_notification_update_description" : { + "comment" : "When an update is available, a notification is shown. This is the description to download an update.", "extractionState" : "manual", "localizations" : { "en" : { @@ -90,6 +98,7 @@ } }, "update_notification_update_normal_title_%@" : { + "comment" : "When an update is available, a notification is shown. This is the title for a normal priority update. The placeholder is for the application version, eg \"Update Available - 2.0\"", "extractionState" : "manual", "localizations" : { "en" : { diff --git a/Sources/Secretive/Localizable.xcstrings b/Sources/Secretive/Localizable.xcstrings index 5115ce1..5e481de 100644 --- a/Sources/Secretive/Localizable.xcstrings +++ b/Sources/Secretive/Localizable.xcstrings @@ -107,6 +107,26 @@ } } }, + "copyable_click_to_copy_button" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Click to Copy" + } + } + } + }, + "copyable_copied" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Copied" + } + } + } + }, "create_secret_cancel_button" : { "localizations" : { "en" : { diff --git a/Sources/Secretive/Views/CopyableView.swift b/Sources/Secretive/Views/CopyableView.swift index ff9497e..8b2630f 100644 --- a/Sources/Secretive/Views/CopyableView.swift +++ b/Sources/Secretive/Views/CopyableView.swift @@ -66,12 +66,12 @@ struct CopyableView: View { ) } - var hoverText: String { + var hoverText: LocalizedStringKey { switch interactionState { case .hovering: - return "Click to Copy" + return "copyable_click_to_copy_button" case .clicking: - return "Copied" + return "copyable_copied" case .normal: fatalError() }