Skip to content

Commit fcb73a9

Browse files
authored
fix(authenticator): Update ConfirmResetPassword submit text for Angular (#1793)
* Update confirm-password submit text * Add changeset * Add backwards compatibility for Send Code translation
1 parent 331df83 commit fcb73a9

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.changeset/shiny-bags-doubt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@aws-amplify/ui-angular': patch
3+
---
4+
5+
Update submit text for Angular ConfirmResetPassword screen

packages/angular/projects/ui-angular/src/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h3 class="amplify-heading">{{ headerText }}</h3>
1414
></amplify-base-form-fields>
1515

1616
<button amplify-button variation="primary" fullWidth="true" type="submit">
17-
{{ sendCodeText }}
17+
{{ submitText }}
1818
</button>
1919

2020
<button

packages/angular/projects/ui-angular/src/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AuthenticatorService } from '../../../../services/authenticator.service
33
import {
44
FormFieldsArray,
55
getFormDataFromEvent,
6+
hasTranslation,
67
translate,
78
} from '@aws-amplify/ui';
89

@@ -15,10 +16,17 @@ export class ConfirmResetPasswordComponent {
1516
@Input() public headerText = translate('Reset your password');
1617

1718
// translated strings
18-
public sendCodeText = translate('Send Code');
1919
public backToSignInText = translate('Back to Sign In');
2020
public resendCodeText = translate('Resend Code');
2121
public sortedFormFields: FormFieldsArray;
22+
/**
23+
* Support backwards compatibility for erroneous 'Send Code' text
24+
* See https://github.com/aws-amplify/amplify-ui/issues/1784
25+
* TODO: Remove support for 'Send Code' translation in next Major release
26+
*/
27+
public submitText = hasTranslation('Submit')
28+
? translate('Submit')
29+
: translate('Send Code');
2230

2331
constructor(public authenticator: AuthenticatorService) {}
2432

0 commit comments

Comments
 (0)