From d10bb23ce8dee2c7eee13ebfc4e0f637bf8e5a5e Mon Sep 17 00:00:00 2001 From: Nicolas Gomollon Date: Wed, 17 Jul 2013 16:22:00 -0700 Subject: [PATCH] Makes error messages localizable. --- SSKeychain/SSKeychainQuery.m | 22 +++++++++++----------- SSKeychain/en.lproj/SSKeychain.strings | Bin 0 -> 1576 bytes 2 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 SSKeychain/en.lproj/SSKeychain.strings diff --git a/SSKeychain/SSKeychainQuery.m b/SSKeychain/SSKeychainQuery.m index c082854..a910dfb 100644 --- a/SSKeychain/SSKeychainQuery.m +++ b/SSKeychain/SSKeychainQuery.m @@ -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: diff --git a/SSKeychain/en.lproj/SSKeychain.strings b/SSKeychain/en.lproj/SSKeychain.strings new file mode 100644 index 0000000000000000000000000000000000000000..faeb205b3926664ede624315656b118fe59c4cab GIT binary patch literal 1576 zcmbW1%Z}4P5JhXvS6D1r%zOZ15i~?XNW5pk(i1x~7Kv^70p#a_bE{La2U`fCDCtgj zJ#O8))xUmT+cV4T6Q4I$+R1kIV7XOR+Xovt={U=<=VTyT$(k>GGW+h?bt^RAusN_Ri1OUA2wO+Q63n+)R77sE zDKD8zw~pLfFxA)&ST^j0q4VF?Gv%|Jn!CX>ug6>>c<(jjZ4Rt6Q(Cex&4o!zC6*u&J}5lRI!qQMysg|HG%LmTGf2iD?QAB<)C{n$(!R zTi3OEqgh^hhY|v(IF(`}&T`&v$e;=f)_I;9R7rg?L$V0VsS_>u8+4}^C8?^wQ)*i4 z$;P$xVDovIvPM6~OO-;Q_b+B&6R+8BQIvSol!sz7_Q6R)lBOcK5O%$Es$y70Coc9x oRkvjktbg=#btuch8;A-DofQiCkSLr;zlPFmumS2D5j8|+6DfdBvi literal 0 HcmV?d00001