diff --git a/Sources/RSCore/CloudKit/CloudKitZone.swift b/Sources/RSCore/CloudKit/CloudKitZone.swift index 2474eaf..4f9e52d 100644 --- a/Sources/RSCore/CloudKit/CloudKitZone.swift +++ b/Sources/RSCore/CloudKit/CloudKitZone.swift @@ -17,11 +17,11 @@ public enum CloudKitZoneError: LocalizedError { public var errorDescription: String? { switch self { case .userDeletedZone: - return NSLocalizedString("The iCloud data was deleted. Please remove the application iCloud account and add it again to continue using the application's iCloud support.", comment: "User deleted zone.") + return String(localized: "cloudkit.error.icloud-data-deleted", bundle: .module, comment: "The iCloud data was deleted. Please remove the application iCloud account and add it again to continue using the application's iCloud support.") case .corruptAccount: - return NSLocalizedString("There is an unrecoverable problem with your application iCloud account. Please make sure you have iCloud and iCloud Drive enabled in System Preferences. Then remove the application iCloud account and add it again.", comment: "Corrupt account.") + return String(localized: "cloudkit.error.corrupt-action", bundle: .module, comment: "There is an unrecoverable problem with your application iCloud account. Please make sure you have iCloud and iCloud Drive enabled in System Preferences. Then remove the application iCloud account and add it again.") default: - return NSLocalizedString("An unexpected CloudKit error occurred.", comment: "An unexpected CloudKit error occurred.") + return String(localized: "cloudkit.error.unexpected-error", bundle: .module, comment: "An unexpected CloudKit error occurred.") } } } diff --git a/Sources/RSCore/Resources/Localizable.xcstrings b/Sources/RSCore/Resources/Localizable.xcstrings index 07dd59d..d11b065 100644 --- a/Sources/RSCore/Resources/Localizable.xcstrings +++ b/Sources/RSCore/Resources/Localizable.xcstrings @@ -1,30 +1,6 @@ { "sourceLanguage" : "en", "strings" : { - "Already Shared: a record or share cannot be saved because doing so would cause the same hierarchy of records to exist in multiple shares." : { - "comment" : "Known iCloud Error" - }, - "An unexpected CloudKit error occurred." : { - "comment" : "An unexpected CloudKit error occurred." - }, - "Asset File Modified: the content of the specified asset file was modified while being saved." : { - "comment" : "Known iCloud Error" - }, - "Asset File Not Found: the specified asset file is not found." : { - "comment" : "Known iCloud Error" - }, - "Bad Container: the specified container is unknown or unauthorized." : { - "comment" : "Known iCloud Error" - }, - "Bad Database: the operation could not be completed on the given database." : { - "comment" : "Known iCloud Error" - }, - "Batch Request Failed: the entire batch was rejected." : { - "comment" : "Known iCloud Error" - }, - "Change Token Expired: the previous server change token is too old." : { - "comment" : "Known iCloud Error" - }, "cloudkit.error.alread-shared" : { "comment" : "Already Shared: a record or share cannot be saved because doing so would cause the same hierarchy of records to exist in multiple shares.", "localizations" : { @@ -113,6 +89,28 @@ } } }, + "cloudkit.error.corrupt-action" : { + "comment" : "There is an unrecoverable problem with your application iCloud account. Please make sure you have iCloud and iCloud Drive enabled in System Preferences. Then remove the application iCloud account and add it again.", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "There is an unrecoverable problem with your application iCloud account. Please make sure you have iCloud and iCloud Drive enabled in System Preferences. Then remove the application iCloud account and add it again." + } + } + } + }, + "cloudkit.error.icloud-data-deleted" : { + "comment" : "The iCloud data was deleted. Please remove the application iCloud account and add it again to continue using the application's iCloud support.", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "The iCloud data was deleted. Please remove the application iCloud account and add it again to continue using the application's iCloud support." + } + } + } + }, "cloudkit.error.incompatible-version" : { "comment" : "Incompatible Version: your app version is older than the oldest version allowed.", "localizations" : { @@ -344,6 +342,17 @@ } } }, + "cloudkit.error.unexpected-error" : { + "comment" : "An unexpected CloudKit error occurred.", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "An unexpected CloudKit error occurred." + } + } + } + }, "cloudkit.error.unhandled-error" : { "comment" : "Unhandled Error.", "localizations" : { @@ -399,15 +408,6 @@ } } }, - "Constraint Violation: the server rejected the request because of a conflict with a unique field." : { - "comment" : "Known iCloud Error" - }, - "Incompatible Version: your app version is older than the oldest version allowed." : { - "comment" : "Known iCloud Error" - }, - "Invalid Arguments: the specified request contains bad information." : { - "comment" : "Known iCloud Error" - }, "label.text.%@-moved-or-renamed" : { "comment" : " was moved or renamed while open.", "localizations" : { @@ -451,81 +451,6 @@ } } } - }, - "Limit Exceeded: the request to the server is too large." : { - "comment" : "Known iCloud Error" - }, - "Managed Account Restricted: the request was rejected due to a managed-account restriction." : { - "comment" : "Known iCloud Error" - }, - "Missing Entitlement: the app is missing a required entitlement." : { - "comment" : "Known iCloud Error" - }, - "Network Failure: the internet connection appears to be offline." : { - "comment" : "Known iCloud Error" - }, - "Network Unavailable: the internet connection appears to be offline." : { - "comment" : "Known iCloud Error" - }, - "Not Authenticated: to use the iCloud account, you must enable iCloud Drive. Go to device Settings, sign in to iCloud, then in the app settings, be sure the iCloud Drive feature is enabled." : { - "comment" : "Known iCloud Error" - }, - "OK" : { - "comment" : "OK" - }, - "Partial Failure: some items failed, but the operation succeeded overall." : { - "comment" : "Known iCloud Error" - }, - "Participant May Need Verification: you are not a member of the share." : { - "comment" : "Known iCloud Error" - }, - "Permission Failure: to use this app, you must enable iCloud Drive. Go to device Settings, sign in to iCloud, then in the app settings, be sure the iCloud Drive feature is enabled." : { - "comment" : "Known iCloud Error" - }, - "Quota Exceeded: saving would exceed your current iCloud storage quota." : { - "comment" : "Known iCloud Error" - }, - "Reference Violation: the target of a record's parent or share reference was not found." : { - "comment" : "Known iCloud Error" - }, - "Relaunch" : { - "comment" : "Relaunch Button" - }, - "Request Rate Limited: transfers to and from the server are being rate limited at this time." : { - "comment" : "Known iCloud Error" - }, - "Server Record Changed: the record was rejected because the version on the server is different." : { - "comment" : "Known iCloud Error" - }, - "Server Rejected Request" : { - "comment" : "Known iCloud Error" - }, - "Server Response Lost" : { - "comment" : "Known iCloud Error" - }, - "Service Unavailable: Please try again." : { - "comment" : "Known iCloud Error" - }, - "The iCloud data was deleted. Please remove the application iCloud account and add it again to continue using the application's iCloud support." : { - "comment" : "User deleted zone." - }, - "There is an unrecoverable problem with your application iCloud account. Please make sure you have iCloud and iCloud Drive enabled in System Preferences. Then remove the application iCloud account and add it again." : { - "comment" : "Corrupt account." - }, - "Too Many Participants: a share cannot be saved because too many participants are attached to the share." : { - "comment" : "Known iCloud Error" - }, - "Unhandled Error." : { - "comment" : "Unknown iCloud Error" - }, - "User Deleted Zone: the user has deleted this zone from the settings UI." : { - "comment" : "Known iCloud Error" - }, - "Zone Busy: the server is too busy to handle the zone operation." : { - "comment" : "Known iCloud Error" - }, - "Zone Not Found: the specified record zone does not exist on the server." : { - "comment" : "Known iCloud Error" } }, "version" : "1.0" diff --git a/Sources/RSCore/UIKit/UIViewController+RSCore.swift b/Sources/RSCore/UIKit/UIViewController+RSCore.swift index e67de0c..30acff6 100644 --- a/Sources/RSCore/UIKit/UIViewController+RSCore.swift +++ b/Sources/RSCore/UIKit/UIViewController+RSCore.swift @@ -29,7 +29,7 @@ import SwiftUI public func presentError(title: String, message: String, dismiss: (() -> Void)? = nil) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - let dismissTitle = NSLocalizedString("OK", comment: "OK") + let dismissTitle = String(localized: "label.text.ok", bundle: .module, comment: "OK") let dismissAction = UIAlertAction(title: dismissTitle, style: .default) { _ in dismiss?() }