Skip to content

Commit 6d17ddf

Browse files
committed
Localize the detailed bad password error
1 parent 00d02a4 commit 6d17ddf

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

APCAppCore/APCAppCore/Library/Categories/NSError+APCAdditions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ FOUNDATION_EXPORT NSString * kAPCAccountAlreadyExistsErrorMessage;
4141
FOUNDATION_EXPORT NSString * kAPCAccountDoesNotExistErrorMessage;
4242
FOUNDATION_EXPORT NSString * kAPCBadEmailAddressErrorMessage;
4343
FOUNDATION_EXPORT NSString * kAPCBadPasswordErrorMessage;
44+
FOUNDATION_EXPORT NSString * kAPCBadPasswordWithDetailsErrorMessage;
4445
FOUNDATION_EXPORT NSString * kAPCNotReachableErrorMessage;
4546
FOUNDATION_EXPORT NSString * kAPCInvalidEmailAddressOrPasswordErrorMessage;
4647

APCAppCore/APCAppCore/Library/Categories/NSError+APCAdditions.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
NSString * kAPCAccountDoesNotExistErrorMessage;
4444
NSString * kAPCBadEmailAddressErrorMessage;
4545
NSString * kAPCBadPasswordErrorMessage;
46+
NSString * kAPCBadPasswordWithDetailsErrorMessage;
4647
NSString * kAPCNotReachableErrorMessage;
4748
NSString * kAPCInvalidEmailAddressOrPasswordErrorMessage;
4849

@@ -61,6 +62,7 @@ + (void)initialize
6162
kAPCAccountDoesNotExistErrorMessage = NSLocalizedStringWithDefaultValue(@"There is no account registered for this email address and password combination.", @"APCAppCore", APCBundle(), @"There is no account registered for this email address and password combination.", @"Error message when participant attempts to sign in to an existing account with an incorrect email address or password");
6263
kAPCBadEmailAddressErrorMessage = NSLocalizedStringWithDefaultValue(@"The email address submitted is not a valid email address. Please correct the email address and try again.", @"APCAppCore", APCBundle(), @"The email address submitted is not a valid email address. Please correct the email address and try again.", @"Error message when participant attempts to sign up using a non-valid email address");
6364
kAPCBadPasswordErrorMessage = NSLocalizedStringWithDefaultValue(@"The password you have entered is not a valid password. Please try again.", @"APCAppCore", APCBundle(), @"The password you have entered is not a valid password. Please try again.", @"Error message when participant attempts to sign up with a non-valid password");
65+
kAPCBadPasswordWithDetailsErrorMessage = NSLocalizedStringWithDefaultValue(@"The password you have entered is not a valid password. Please try again. Details: %@", @"APCAppCore", APCBundle(), @"The password you have entered is not a valid password. Please try again. Details: %@", @"Format for error message when participant attempts to sign up with a non-valid password, to be filled in with specifics of why it's not valid from the server error message");
6466
kAPCNotReachableErrorMessage = NSLocalizedStringWithDefaultValue(@"We are currently not able to reach the study server. Please retry in a few moments.", @"APCAppCore", APCBundle(), @"We are currently not able to reach the study server. Please retry in a few moments.", @"Error message when the app is unable to reach the Bridge server");
6567
kAPCInvalidEmailAddressOrPasswordErrorMessage = NSLocalizedStringWithDefaultValue(@"Entered email address or password is not valid. Please correct the email address or password and try again.", @"APCAppCore", APCBundle(), @"Entered email address or password is not valid. Please correct the email address or password and try again.", @"Error message when participant attempts to sign up with a non-valid email address or password");
6668
}

APCAppCore/APCAppCore/Library/Categories/NSError+Bridge.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ - (NSString*)bridgeErrorMessage
9090
NSArray *passwordErrors = [errors valueForKey: kSageErrorPasswordKey];
9191
NSString *errorsString = [passwordErrors componentsJoinedByString:@", "];
9292
if (errorsString.length > 0) {
93-
message = [NSString stringWithFormat:@"%@ Details: %@", kAPCBadPasswordErrorMessage, errorsString];
93+
message = [NSString stringWithFormat:kAPCBadPasswordWithDetailsErrorMessage, errorsString];
9494
} else {
9595
message = kAPCBadPasswordErrorMessage;
9696
}

0 commit comments

Comments
 (0)