From 0c5eea03c3890ea3166abc16e47dee38854feb39 Mon Sep 17 00:00:00 2001 From: Jens Utbult Date: Thu, 16 Jan 2025 17:07:18 +0100 Subject: [PATCH] Fixed missing translations. --- Authenticator/Localizable.xcstrings | 162 ++++++++++++++++-- .../Model/ConfigurationViewModel.swift | 2 +- Authenticator/UI/About/TutorialView.swift | 16 +- Authenticator/UI/ErrorAlertView.swift | 19 +- .../UI/YubiKeyConfiguration/FIDOPINView.swift | 2 +- .../YubiKeyConfiguration/FIDOResetView.swift | 2 +- .../OATHPasswordView.swift | 6 +- .../YubiKeyConfiguration/OATHResetView.swift | 2 +- .../OATHSavedPasswordsView.swift | 2 +- .../SmartCardConfigurationController.swift | 8 +- Authenticator/UI/mul.lproj/Main.xcstrings | 2 +- 11 files changed, 191 insertions(+), 32 deletions(-) diff --git a/Authenticator/Localizable.xcstrings b/Authenticator/Localizable.xcstrings index b3ee76d4..7ef434ec 100644 --- a/Authenticator/Localizable.xcstrings +++ b/Authenticator/Localizable.xcstrings @@ -204,6 +204,62 @@ } } }, + "A PIN must be at least %llu characters long and may contain letters, numbers and special characters." : { + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "new", + "value" : "A PIN must be at least %llu characters long and may contain letters, numbers and special characters." + } + }, + "fr" : { + "stringUnit" : { + "state" : "new", + "value" : "A PIN must be at least %llu characters long and may contain letters, numbers and special characters." + } + }, + "ja" : { + "stringUnit" : { + "state" : "new", + "value" : "A PIN must be at least %llu characters long and may contain letters, numbers and special characters." + } + }, + "sk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Kód PIN musí mať aspoň %llu znakov a môže obsahovať písmená, číslice a špeciálne znaky." + } + } + } + }, + "A PIN must be at least %llu characters long, contain at least 2 unique characters, and not be a commonly used PIN, like \"123456\". It may contain letters, numbers and special characters." : { + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "new", + "value" : "A PIN must be at least %llu characters long, contain at least 2 unique characters, and not be a commonly used PIN, like \"123456\". It may contain letters, numbers and special characters." + } + }, + "fr" : { + "stringUnit" : { + "state" : "new", + "value" : "A PIN must be at least %llu characters long, contain at least 2 unique characters, and not be a commonly used PIN, like \"123456\". It may contain letters, numbers and special characters." + } + }, + "ja" : { + "stringUnit" : { + "state" : "new", + "value" : "A PIN must be at least %llu characters long, contain at least 2 unique characters, and not be a commonly used PIN, like \"123456\". It may contain letters, numbers and special characters." + } + }, + "sk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Kód PIN musí mať aspoň %llu znakov, musí obsahovať aspoň 2 jedinečné znaky a nesmie byť bežne používaným kódom PIN, ako napríklad \"123456\". Môže obsahovať písmená, číslice a špeciálne znaky." + } + } + } + }, "About" : { "comment" : "About navigation title", "localizations" : { @@ -496,6 +552,7 @@ }, "and can be used by other applications" : { "comment" : "PIV extension substring in 'These certificates have been added to this [iPad/iPhone] and can be used by other applications'", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -640,6 +697,7 @@ }, "Certificates on this YubiKey can be used to authenticate and sign requests from other applications if added to this" : { "comment" : "PIV extension no certs on yubikey message", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -667,6 +725,9 @@ } } }, + "Certificates on this YubiKey can be used to authenticate and sign requests from other applications if added to this %@." : { + "comment" : "PIV extension no certs on yubikey message" + }, "Certificates on YubiKey" : { "comment" : "PIV extension table cell header", "localizations" : { @@ -1037,6 +1098,35 @@ } } }, + "Configuration read" : { + "comment" : "NFC connection stopped message.", + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "new", + "value" : "Configuration read" + } + }, + "fr" : { + "stringUnit" : { + "state" : "new", + "value" : "Configuration read" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "設定読み込み" + } + }, + "sk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Čítanie konfigurácie" + } + } + } + }, "Confirm OATH reset" : { "extractionState" : "stale", "localizations" : { @@ -2214,7 +2304,7 @@ "de" : { "stringUnit" : { "state" : "translated", - "value" : "ALLGEMEINES" + "value" : "ALLGEMEINE EINSTELLUNGEN" } }, "fr" : { @@ -2236,13 +2326,16 @@ } } } + }, + "Get a shared secret from any service you wish to secure, store it on the YubiKey and use it to generate your security codes.\n\nYou will need a YubiKey 5Ci or a compatible YubiKey with NFC to get started." : { + }, "How does it work" : { "localizations" : { "de" : { "stringUnit" : { "state" : "translated", - "value" : "Wie funktioniert das" + "value" : "Einführung" } }, "fr" : { @@ -2264,6 +2357,15 @@ } } } + }, + "How it works" : { + + }, + "If you have a YubiKey 5Ci, plug it in.\n\nTouch the contacts on the sides when prompted." : { + + }, + "If you have a YubiKey with NFC, pull down the main view to activate NFC.\n\nHold the key horizontally and tilt the iPhone towards the key.\n\nTouch the center of the key to the edge of the phone." : { + }, "Incorrect password. Re-enter password." : { "comment" : "OATH password entry retry", @@ -2299,7 +2401,7 @@ "de" : { "stringUnit" : { "state" : "translated", - "value" : "YubiKey einfügen" + "value" : "YubiKey verbinden" } }, "fr" : { @@ -2327,7 +2429,7 @@ "de" : { "stringUnit" : { "state" : "translated", - "value" : "YubiKey stecken oder nach unten ziehen, um NFC zu aktivieren" + "value" : "YubiKey verbinden oder nach unten ziehen, um NFC zu aktivieren" } }, "fr" : { @@ -2378,6 +2480,9 @@ } } } + }, + "Invalid session state." : { + }, "Invalid signature" : { "comment" : "PIV extension NFC invalid signature\nPIV extension invalid signature", @@ -3497,7 +3602,6 @@ }, "Other applications can use client certificates on your YubiKey for authentication and signing purposes." : { "comment" : "PIV extension info alert message", - "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -4154,6 +4258,7 @@ }, "Public key certificates on" : { "comment" : "PIV extension no certs on device message", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -4180,6 +4285,12 @@ } } } + }, + "Public key certificates on %@" : { + "comment" : "PIV extension no certs on device" + }, + "QR codes are available from the services you wish to secure.\n\nSimply scan the QR code when you add your YubiKey and generate your own security codes." : { + }, "re-enter password" : { "localizations" : { @@ -4243,7 +4354,7 @@ "de" : { "stringUnit" : { "state" : "translated", - "value" : "Erfahre mehr..." + "value" : "Weitere Infos..." } }, "fr" : { @@ -5467,6 +5578,9 @@ } } } + }, + "The key is busy performing another operation." : { + }, "The passwords do not match" : { "comment" : "Configuration set password not matching error alert message", @@ -5555,6 +5669,9 @@ } } } + }, + "The requested functionality is missing or disabled in this YubiKey." : { + }, "The smart card extension requires notifications to be enabled for Yubico Authenticator. Enable it in the iOS Settings." : { "comment" : "PIV extensions notifications alert message", @@ -5612,6 +5729,9 @@ } } } + }, + "The YubiKey is not connected." : { + }, "There's already an account named" : { "comment" : "OATH substring in 'There's already an account named [issuer, name] on this YubiKey.", @@ -5644,6 +5764,7 @@ }, "These certificates have been added to this" : { "comment" : "PIV extension substring in 'These certificates have been added to this [iPad/iPhone] and can be used by other applications'", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -5671,6 +5792,9 @@ } } }, + "These certificates have been added to this %@ and can be used by other applications." : { + "comment" : "PIV extension certs on device" + }, "This operation is not supported over Lightning on this YubiKey. Please use Yubico Authenticator for desktop to reset the FIDO application." : { "localizations" : { "de" : { @@ -6016,7 +6140,7 @@ "de" : { "stringUnit" : { "state" : "translated", - "value" : "One-Time Passwort zeigen/verbergen" + "value" : "One-Time Password Einstellungen" } }, "fr" : { @@ -6038,6 +6162,9 @@ } } } + }, + "Touch key time out." : { + }, "Touch the button on the YubiKey now." : { "comment" : "FIDO reset view", @@ -6389,7 +6516,7 @@ "de" : { "stringUnit" : { "state" : "translated", - "value" : "Was gibt es Neues?" + "value" : "Neuigkeiten" } }, "fr" : { @@ -6418,7 +6545,7 @@ "de" : { "stringUnit" : { "state" : "translated", - "value" : "Was gibt es Neues?" + "value" : "Neuigkeiten" } }, "fr" : { @@ -6470,13 +6597,16 @@ } } } + }, + "Where to get QR codes" : { + }, "While the YubiKey is inserted the on-screen keyboard will not appear. To show the keyboard you will have to remove the YubiKey and then re-insert it." : { "localizations" : { "de" : { "stringUnit" : { "state" : "translated", - "value" : "Solange der YubiKey eingesteckt ist, wird die Bildschirmtastatur nicht angezeigt. Um die Tastatur anzuzeigen, musst Du den YubiKey abziehen und dann wieder einstecken." + "value" : "Solange der YubiKey verbunden ist, wird die Bildschirmtastatur nicht angezeigt. Um die Tastatur anzuzeigen, musst Du den YubiKey abziehen und erneut verbinden." } }, "fr" : { @@ -6784,6 +6914,18 @@ } } } + }, + "YubiKey 5 Series NFC authentication" : { + + }, + "YubiKey 5Ci authentication" : { + + }, + "YubiKey connection is not found." : { + + }, + "YubiKey connection lost." : { + }, "YubiKey has been reset" : { "extractionState" : "stale", diff --git a/Authenticator/Model/ConfigurationViewModel.swift b/Authenticator/Model/ConfigurationViewModel.swift index 81d2e143..f87c81f6 100644 --- a/Authenticator/Model/ConfigurationViewModel.swift +++ b/Authenticator/Model/ConfigurationViewModel.swift @@ -76,7 +76,7 @@ class ConfigurationViewModel: ObservableObject { session.getDeviceInfo { info, error in DispatchQueue.main.async { self?.deviceInfo = info - YubiKitManager.shared.stopNFCConnection(withMessage: "Configuration read") + YubiKitManager.shared.stopNFCConnection(withMessage: String(localized: "Configuration read", comment: "NFC connection stopped message.")) } } } diff --git a/Authenticator/UI/About/TutorialView.swift b/Authenticator/UI/About/TutorialView.swift index 8e77c460..1c64b22c 100644 --- a/Authenticator/UI/About/TutorialView.swift +++ b/Authenticator/UI/About/TutorialView.swift @@ -85,24 +85,24 @@ struct TutorialPageModel: Hashable, Identifiable { extension TutorialView { var tutorialPages: [TutorialPageModel] { - [TutorialPageModel(title: "How it works", + [TutorialPageModel(title: String(localized: "How it works"), image: Image(.authAppImgLight), - text: "Get a shared secret from any service you wish to secure, store it on the YubiKey and use it to generate your security codes." + "\n\n" + "You will need a YubiKey 5Ci or a compatible YubiKey with NFC to get started.", + text: String(localized: "Get a shared secret from any service you wish to secure, store it on the YubiKey and use it to generate your security codes.\n\nYou will need a YubiKey 5Ci or a compatible YubiKey with NFC to get started."), link: URL(string: "https://www.yubico.com/")!), - TutorialPageModel(title: "YubiKey 5Ci authentication", + TutorialPageModel(title: String(localized: "YubiKey 5Ci authentication"), image: Image(.authAppIntro2Yk5Ci), - text: "If you have a YubiKey 5Ci, plug it in." + "\n\n" + "Touch the contacts on the sides when prompted.", + text: String(localized: "If you have a YubiKey 5Ci, plug it in.\n\nTouch the contacts on the sides when prompted."), link: nil), - TutorialPageModel(title: "YubiKey 5 Series NFC authentication", + TutorialPageModel(title: String(localized: "YubiKey 5 Series NFC authentication"), image: Image(.authAppIntro3YkNfc), - text: "If you have a YubiKey with NFC, pull down the main view to activate NFC." + "\n\n" + "Hold the key horizontally and tilt the iPhone towards the key.\n\nTouch the center of the key to the edge of the phone.", + text: String(localized: "If you have a YubiKey with NFC, pull down the main view to activate NFC.\n\nHold the key horizontally and tilt the iPhone towards the key.\n\nTouch the center of the key to the edge of the phone."), link: nil), - TutorialPageModel(title: "Where to get QR codes", + TutorialPageModel(title: String(localized: "Where to get QR codes"), image: Image(.authAppIntro4QrCode), - text: "QR codes are available from the services you wish to secure." + "\n\n" + "Simply scan the QR code when you add your YubiKey and generate your own security codes.", + text: String(localized: "QR codes are available from the services you wish to secure.\n\nSimply scan the QR code when you add your YubiKey and generate your own security codes."), link: nil) ] } diff --git a/Authenticator/UI/ErrorAlertView.swift b/Authenticator/UI/ErrorAlertView.swift index 12acc502..bc510793 100644 --- a/Authenticator/UI/ErrorAlertView.swift +++ b/Authenticator/UI/ErrorAlertView.swift @@ -74,8 +74,25 @@ struct LocalizedErrorWrapper: LocalizedError { extension NSError { func customDescription() -> String { if self.domain == "com.yubico" { - if self.code == 0x6a84 { + switch self.code { + case 0x1, 0x2: + return String(localized: "The YubiKey is not connected.") + case 0x3: + return String(localized: "Touch key time out.") + case 0x4: + return String(localized: "The key is busy performing another operation.") // This should not happen since YubiKit makes sure to perform one operation at a time. + case 0x5: + return String(localized: "The requested functionality is missing or disabled in this YubiKey.") + case 0x6: + return String(localized: "YubiKey connection lost.") + case 0x7: + return String(localized: "YubiKey connection is not found.") + case 0x8: + return String(localized: "Invalid session state.") + case 0x6a84: return String(localized: "The YubiKey has no more storage for OATH accounts.") + default: + break } } return localizedDescription diff --git a/Authenticator/UI/YubiKeyConfiguration/FIDOPINView.swift b/Authenticator/UI/YubiKeyConfiguration/FIDOPINView.swift index 13dc6239..04aefc5f 100644 --- a/Authenticator/UI/YubiKeyConfiguration/FIDOPINView.swift +++ b/Authenticator/UI/YubiKeyConfiguration/FIDOPINView.swift @@ -175,7 +175,7 @@ struct FIDOSetChangePINView: View { .padding(.horizontal, 15) .padding(.bottom, 5) - Text("\(model.pincomplexity ? "A PIN must be at least \(model.minPinLength) characters long, contain at least 2 unique characters, and not be a commonly used PIN, like \"123456\". It may contain letters, numbers and special characters." : "A PIN must be at least \(model.minPinLength) characters long and may contain letters, numbers and special characters.")") + Text( "\(model.pincomplexity ? String(localized: "A PIN must be at least \(model.minPinLength) characters long, contain at least 2 unique characters, and not be a commonly used PIN, like \"123456\". It may contain letters, numbers and special characters.") : String(localized: "A PIN must be at least \(model.minPinLength) characters long and may contain letters, numbers and special characters."))") .font(.subheadline) .foregroundStyle(Color(.secondaryLabel)) .padding(.horizontal, 25) diff --git a/Authenticator/UI/YubiKeyConfiguration/FIDOResetView.swift b/Authenticator/UI/YubiKeyConfiguration/FIDOResetView.swift index f55189e6..87ea135f 100644 --- a/Authenticator/UI/YubiKeyConfiguration/FIDOResetView.swift +++ b/Authenticator/UI/YubiKeyConfiguration/FIDOResetView.swift @@ -40,7 +40,7 @@ struct FIDOResetView: View { ProgressView(value: progress, total: 4.0).opacity(keyHasBeenReset ? 0.2 : 1.0) Text(messageText).font(.subheadline).multilineTextAlignment(.center).opacity(keyHasBeenReset ? 0.2 : 1.0) } buttons: { - SettingsButton("Reset FIDO") { + SettingsButton(String(localized: "Reset FIDO")) { presentConfirmAlert.toggle() } .disabled(!enableResetButton) diff --git a/Authenticator/UI/YubiKeyConfiguration/OATHPasswordView.swift b/Authenticator/UI/YubiKeyConfiguration/OATHPasswordView.swift index 951abdbd..d58cf4d6 100644 --- a/Authenticator/UI/YubiKeyConfiguration/OATHPasswordView.swift +++ b/Authenticator/UI/YubiKeyConfiguration/OATHPasswordView.swift @@ -37,17 +37,17 @@ struct OATHPasswordView: View { .multilineTextAlignment(.center) } buttons: { if showSetButton { - SettingsButton("Set password") { + SettingsButton(String(localized: "Set password")) { presentSetPassword.toggle() }.disabled(areButtonsDisabled()) } if showChangeButton { - SettingsButton("Change password") { + SettingsButton(String(localized: "Change password")) { presentChangePassword.toggle() }.disabled(areButtonsDisabled()) } if showRemoveButton { - SettingsButton("Remove password") { + SettingsButton(String(localized: "Remove password")) { presentRemovePassword.toggle() }.disabled(areButtonsDisabled()) } diff --git a/Authenticator/UI/YubiKeyConfiguration/OATHResetView.swift b/Authenticator/UI/YubiKeyConfiguration/OATHResetView.swift index 14456647..6ccb7505 100644 --- a/Authenticator/UI/YubiKeyConfiguration/OATHResetView.swift +++ b/Authenticator/UI/YubiKeyConfiguration/OATHResetView.swift @@ -35,7 +35,7 @@ struct OATHResetView: View { .multilineTextAlignment(.center) .opacity(keyHasBeenReset ? 0.2 : 1.0) } buttons: { - SettingsButton("Reset OATH") { + SettingsButton(String(localized: "Reset OATH")) { presentConfirmAlert.toggle() } .disabled(keyHasBeenReset) diff --git a/Authenticator/UI/YubiKeyConfiguration/OATHSavedPasswordsView.swift b/Authenticator/UI/YubiKeyConfiguration/OATHSavedPasswordsView.swift index 168f980a..9e7ef996 100644 --- a/Authenticator/UI/YubiKeyConfiguration/OATHSavedPasswordsView.swift +++ b/Authenticator/UI/YubiKeyConfiguration/OATHSavedPasswordsView.swift @@ -37,7 +37,7 @@ struct OATHSavedPasswordsView: View { .multilineTextAlignment(.center) .opacity(passwordsHasBeenCleared ? 0.2 : 1.0) } buttons: { - SettingsButton("Clear saved passwords") { + SettingsButton(String(localized: "Clear saved passwords")) { presentConfirmAlert.toggle() } .disabled(passwordsHasBeenCleared) diff --git a/Authenticator/UI/YubiKeyConfiguration/SmartCardConfigurationController.swift b/Authenticator/UI/YubiKeyConfiguration/SmartCardConfigurationController.swift index 9180a8a1..debac8d7 100644 --- a/Authenticator/UI/YubiKeyConfiguration/SmartCardConfigurationController.swift +++ b/Authenticator/UI/YubiKeyConfiguration/SmartCardConfigurationController.swift @@ -53,7 +53,7 @@ struct SmartCardConfigurationView: View { Text("Cancel") } }, message: { - Text("This will irrevocably delete all U2F and FIDO2 accounts, including passkeys, from your YubiKey.") + Text("Other applications can use client certificates on your YubiKey for authentication and signing purposes.") }) } } @@ -267,11 +267,11 @@ private class HeaderCell: UITableViewCell { case .onYubiKey: icon.image = UIImage(named: "yubikey")?.withConfiguration(configuration) title.text = String(localized: "Certificates on YubiKey", comment: "PIV extension table cell header") - text.text = "\(String(localized: "Certificates on this YubiKey can be used to authenticate and sign requests from other applications if added to this", comment: "PIV extension no certs on yubikey message")) \(device)." + text.text = String(localized: "Certificates on this YubiKey can be used to authenticate and sign requests from other applications if added to this \(device).", comment: "PIV extension no certs on yubikey message") case .onDevice: icon.image = UIImage(systemName: "iphone", withConfiguration: configuration) - title.text = "\(String(localized: "Public key certificates on", comment: "PIV extension no certs on device message")) \(device)" - text.text = "\(String(localized: "These certificates have been added to this", comment: "PIV extension substring in 'These certificates have been added to this [iPad/iPhone] and can be used by other applications'")) \(device) \(String(localized: "and can be used by other applications", comment: "PIV extension substring in 'These certificates have been added to this [iPad/iPhone] and can be used by other applications'"))." + title.text = String(localized: "Public key certificates on \(device)", comment: "PIV extension no certs on device") + text.text = String(localized: "These certificates have been added to this \(device) and can be used by other applications.", comment: "PIV extension certs on device") } } } diff --git a/Authenticator/UI/mul.lproj/Main.xcstrings b/Authenticator/UI/mul.lproj/Main.xcstrings index 18f8a3a2..4888f2a1 100644 --- a/Authenticator/UI/mul.lproj/Main.xcstrings +++ b/Authenticator/UI/mul.lproj/Main.xcstrings @@ -2984,7 +2984,7 @@ "de" : { "stringUnit" : { "state" : "translated", - "value" : "Wie funktioniert das?" + "value" : "Einführung" } }, "en" : {