Fix a typo in a variable name

This commit is contained in:
Paul Godavari 2021-09-29 14:16:08 -05:00
parent 37cb93ed1a
commit 7696ca8c2b

View File

@ -17,34 +17,34 @@ extension UIViewController {
presentAccountError(accountError, dismiss: dismiss) presentAccountError(accountError, dismiss: dismiss)
} else if let decodingError = error as? DecodingError { } else if let decodingError = error as? DecodingError {
let errorTitle = NSLocalizedString("Error", comment: "Error") let errorTitle = NSLocalizedString("Error", comment: "Error")
let infromativeText: String = "" var informativeText: String = ""
switch decodingError { switch decodingError {
case .typeMismatch(let type, _): case .typeMismatch(let type, _):
let localizedError = NSLocalizedString("This theme cannot be used because the the type—“%@”—is mismatched in the Info.plist", comment: "Type mismatch") let localizedError = NSLocalizedString("This theme cannot be used because the the type—“%@”—is mismatched in the Info.plist", comment: "Type mismatch")
informativeText = NSString.localizedStringWithFormat(localizedError as NSString, type as! CVarArg) as String informativeText = NSString.localizedStringWithFormat(localizedError as NSString, type as! CVarArg) as String
presentError(title: title, message: infromativeText, dismiss: dismiss) presentError(title: errorTitle, message: informativeText, dismiss: dismiss)
case .valueNotFound(let value, _): case .valueNotFound(let value, _):
let localizedError = NSLocalizedString("This theme cannot be used because the the value—“%@”—is not found in the Info.plist.", comment: "Decoding value missing") let localizedError = NSLocalizedString("This theme cannot be used because the the value—“%@”—is not found in the Info.plist.", comment: "Decoding value missing")
informativeText = NSString.localizedStringWithFormat(localizedError as NSString, value as! CVarArg) as String informativeText = NSString.localizedStringWithFormat(localizedError as NSString, value as! CVarArg) as String
presentError(title: title, message: infromativeText, dismiss: dismiss) presentError(title: errorTitle, message: informativeText, dismiss: dismiss)
case .keyNotFound(let codingKey, _): case .keyNotFound(let codingKey, _):
let localizedError = NSLocalizedString("This theme cannot be used because the the key—“%@”—is not found in the Info.plist.", comment: "Decoding key missing") let localizedError = NSLocalizedString("This theme cannot be used because the the key—“%@”—is not found in the Info.plist.", comment: "Decoding key missing")
informativeText = NSString.localizedStringWithFormat(localizedError as NSString, codingKey.stringValue) as String informativeText = NSString.localizedStringWithFormat(localizedError as NSString, codingKey.stringValue) as String
presentError(title: title, message: infromativeText, dismiss: dismiss) presentError(title: errorTitle, message: informativeText, dismiss: dismiss)
case .dataCorrupted(let context): case .dataCorrupted(let context):
guard let error = context.underlyingError as NSError?, guard let error = context.underlyingError as NSError?,
let debugDescription = error.userInfo["NSDebugDescription"] as? String else { let debugDescription = error.userInfo["NSDebugDescription"] as? String else {
informativeText = error.localizedDescription informativeText = error.localizedDescription
presentError(title: title, message: infromativeText, dismiss: dismiss) presentError(title: errorTitle, message: informativeText, dismiss: dismiss)
return return
} }
let localizedError = NSLocalizedString("This theme cannot be used because of data corruption in the Info.plist. %@.", comment: "Decoding key missing") let localizedError = NSLocalizedString("This theme cannot be used because of data corruption in the Info.plist. %@.", comment: "Decoding key missing")
informativeText = NSString.localizedStringWithFormat(localizedError as NSString, debugDescription) as String informativeText = NSString.localizedStringWithFormat(localizedError as NSString, debugDescription) as String
presentError(title: title, message: infromativeText, dismiss: dismiss) presentError(title: errorTitle, message: informativeText, dismiss: dismiss)
default: default:
informativeText = error.localizedDescription informativeText = error.localizedDescription
presentError(title: title, message: infromativeText, dismiss: dismiss) presentError(title: errorTitle, message: informativeText, dismiss: dismiss)
} }
} else { } else {
let errorTitle = NSLocalizedString("Error", comment: "Error") let errorTitle = NSLocalizedString("Error", comment: "Error")