Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Commit

Permalink
Makes error messages localizable.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasgomollon committed Jul 17, 2013
1 parent 431e0aa commit d10bb23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions SSKeychain/SSKeychainQuery.m
Expand Up @@ -185,47 +185,47 @@ + (NSError *)errorWithCode:(OSStatus) code {
NSString *message = nil;
switch (code) {
case errSecSuccess: return nil;
case SSKeychainErrorBadArguments: message = @"Some of the arguments were invalid"; break;
case SSKeychainErrorBadArguments: message = NSLocalizedStringFromTable(@"SSKeychainErrorBadArguments", @"SSKeychain", nil); break;

#if TARGET_OS_IPHONE
case errSecUnimplemented: {
message = @"Function or operation not implemented";
message = NSLocalizedStringFromTable(@"errSecUnimplemented", @"SSKeychain", nil);
break;
}
case errSecParam: {
message = @"One or more parameters passed to a function were not valid";
message = NSLocalizedStringFromTable(@"errSecParam", @"SSKeychain", nil);
break;
}
case errSecAllocate: {
message = @"Failed to allocate memory";
message = NSLocalizedStringFromTable(@"errSecAllocate", @"SSKeychain", nil);
break;
}
case errSecNotAvailable: {
message = @"No keychain is available. You may need to restart your computer";
message = NSLocalizedStringFromTable(@"errSecNotAvailable", @"SSKeychain", nil);
break;
}
case errSecDuplicateItem: {
message = @"The specified item already exists in the keychain";
message = NSLocalizedStringFromTable(@"errSecDuplicateItem", @"SSKeychain", nil);
break;
}
case errSecItemNotFound: {
message = @"The specified item could not be found in the keychain";
message = NSLocalizedStringFromTable(@"errSecItemNotFound", @"SSKeychain", nil);
break;
}
case errSecInteractionNotAllowed: {
message = @"User interaction is not allowed";
message = NSLocalizedStringFromTable(@"errSecInteractionNotAllowed", @"SSKeychain", nil);
break;
}
case errSecDecode: {
message = @"Unable to decode the provided data";
message = NSLocalizedStringFromTable(@"errSecDecode", @"SSKeychain", nil);
break;
}
case errSecAuthFailed: {
message = @"The user name or passphrase you entered is not correct";
message = NSLocalizedStringFromTable(@"errSecAuthFailed", @"SSKeychain", nil);
break;
}
default: {
message = @"Refer to SecBase.h for description";
message = NSLocalizedStringFromTable(@"errSecDefault", @"SSKeychain", nil);
}
#else
default:
Expand Down
Binary file added SSKeychain/en.lproj/SSKeychain.strings
Binary file not shown.

0 comments on commit d10bb23

Please sign in to comment.