11import PropTypes from 'prop-types' ;
22import React from 'react' ;
3+ import { withTranslation } from 'react-i18next' ;
34
45import { domOnlyProps } from '../../../utils/reduxFormUtils' ;
56import Button from '../../../common/Button' ;
@@ -20,12 +21,10 @@ function SignupForm(props) {
2021 onSubmit = { handleSubmit ( props . signUpUser . bind ( this , props . previousPath ) ) }
2122 >
2223 < p className = "form__field" >
23- < label htmlFor = "username" className = "form__label" >
24- User Name
25- </ label >
24+ < label htmlFor = "username" className = "form__label" > { props . t ( 'SignupForm.Title' ) } </ label >
2625 < input
2726 className = "form__input"
28- aria-label = "username"
27+ aria-label = { props . t ( 'SignupForm.TitleARIA' ) }
2928 type = "text"
3029 id = "username"
3130 { ...domOnlyProps ( username ) }
@@ -35,12 +34,10 @@ function SignupForm(props) {
3534 ) }
3635 </ p >
3736 < p className = "form__field" >
38- < label htmlFor = "email" className = "form__label" >
39- Email
40- </ label >
37+ < label htmlFor = "email" className = "form__label" > { props . t ( 'SignupForm.Email' ) } </ label >
4138 < input
4239 className = "form__input"
43- aria-label = "email"
40+ aria-label = { props . t ( 'SignupForm.EmailARIA' ) }
4441 type = "text"
4542 id = "email"
4643 { ...domOnlyProps ( email ) }
@@ -50,12 +47,10 @@ function SignupForm(props) {
5047 ) }
5148 </ p >
5249 < p className = "form__field" >
53- < label htmlFor = "password" className = "form__label" >
54- Password
55- </ label >
50+ < label htmlFor = "password" className = "form__label" > { props . t ( 'SignupForm.Password' ) } </ label >
5651 < input
5752 className = "form__input"
58- aria-label = "password"
53+ aria-label = { props . t ( 'SignupForm.PasswordARIA' ) }
5954 type = "password"
6055 id = "password"
6156 { ...domOnlyProps ( password ) }
@@ -65,22 +60,22 @@ function SignupForm(props) {
6560 ) }
6661 </ p >
6762 < p className = "form__field" >
68- < label htmlFor = "confirm password" className = "form__label" >
69- Confirm Password
70- </ label >
63+ < label htmlFor = "confirm password" className = "form__label" > { props . t ( 'SignupForm.ConfirmPassword' ) } </ label >
7164 < input
7265 className = "form__input"
7366 type = "password"
74- aria-label = "confirm password"
67+ aria-label = { props . t ( 'SignupForm.ConfirmPasswordARIA' ) }
7568 id = "confirm password"
7669 { ...domOnlyProps ( confirmPassword ) }
7770 />
7871 { confirmPassword . touched && confirmPassword . error && (
7972 < span className = "form-error" > { confirmPassword . error } </ span >
8073 ) }
8174 </ p >
82- < Button type = "submit" disabled = { submitting || invalid || pristine } >
83- Sign Up
75+ < Button
76+ type = "submit"
77+ disabled = { submitting || invalid || pristine }
78+ > { props . t ( 'SignupForm.SubmitSignup' ) }
8479 </ Button >
8580 </ form >
8681 ) ;
@@ -99,6 +94,7 @@ SignupForm.propTypes = {
9994 invalid : PropTypes . bool ,
10095 pristine : PropTypes . bool ,
10196 previousPath : PropTypes . string . isRequired ,
97+ t : PropTypes . func . isRequired
10298} ;
10399
104100SignupForm . defaultProps = {
@@ -107,4 +103,4 @@ SignupForm.defaultProps = {
107103 invalid : false ,
108104} ;
109105
110- export default SignupForm ;
106+ export default withTranslation ( ) ( SignupForm ) ;
0 commit comments