Localize strings in code

This commit is contained in:
Danny Moesch 2019-01-14 20:57:45 +01:00 committed by Mingshen Sun
parent 2d5ca58bd9
commit 1b4040135e
36 changed files with 626 additions and 334 deletions

View file

@ -23,27 +23,6 @@ public enum AppError: Error {
extension AppError: LocalizedError {
public var errorDescription: String? {
switch self {
case .RepositoryNotSetError:
return "Git repository is not set."
case let .RepositoryRemoteBranchNotFoundError(remoteBranchName):
return "Cannot find remote branch 'origin/\(remoteBranchName)'."
case let .RepositoryBranchNotFound(branchName):
return "Branch with name '\(branchName)' not found in repository."
case .KeyImportError:
return "Cannot import the key."
case .PasswordDuplicatedError:
return "Cannot add the password: password duplicated."
case .GitResetError:
return "Cannot identify the latest synced commit."
case .PGPPublicKeyNotExistError:
return "PGP public key doesn't exist."
case .WrongPasswordFilename:
return "Cannot write to the password file."
case .DecryptionError:
return "Cannot decrypt password."
case .UnknownError:
return "Unknown error."
}
return String(describing: self).localize()
}
}