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' ;
@@ -13,44 +14,44 @@ function SignupForm(props) {
1314 return (
1415 < form className = "form" onSubmit = { handleSubmit ( props . signUpUser . bind ( this , props . previousPath ) ) } >
1516 < p className = "form__field" >
16- < label htmlFor = "username" className = "form__label" > User Name </ label >
17+ < label htmlFor = "username" className = "form__label" > { props . t ( 'SignupForm.Title' ) } </ label >
1718 < input
1819 className = "form__input"
19- aria-label = "username"
20+ aria-label = { props . t ( 'SignupForm.TitleARIA' ) }
2021 type = "text"
2122 id = "username"
2223 { ...domOnlyProps ( username ) }
2324 />
2425 { username . touched && username . error && < span className = "form-error" > { username . error } </ span > }
2526 </ p >
2627 < p className = "form__field" >
27- < label htmlFor = "email" className = "form__label" > Email</ label >
28+ < label htmlFor = "email" className = "form__label" > { props . t ( 'SignupForm. Email' ) } </ label >
2829 < input
2930 className = "form__input"
30- aria-label = "email"
31+ aria-label = { props . t ( 'SignupForm.EmailARIA' ) }
3132 type = "text"
3233 id = "email"
3334 { ...domOnlyProps ( email ) }
3435 />
3536 { email . touched && email . error && < span className = "form-error" > { email . error } </ span > }
3637 </ p >
3738 < p className = "form__field" >
38- < label htmlFor = "password" className = "form__label" > Password</ label >
39+ < label htmlFor = "password" className = "form__label" > { props . t ( 'SignupForm. Password' ) } </ label >
3940 < input
4041 className = "form__input"
41- aria-label = "password"
42+ aria-label = { props . t ( 'SignupForm.PasswordARIA' ) }
4243 type = "password"
4344 id = "password"
4445 { ...domOnlyProps ( password ) }
4546 />
4647 { password . touched && password . error && < span className = "form-error" > { password . error } </ span > }
4748 </ p >
4849 < p className = "form__field" >
49- < label htmlFor = "confirm password" className = "form__label" > Confirm Password </ label >
50+ < label htmlFor = "confirm password" className = "form__label" > { props . t ( 'SignupForm.ConfirmPassword' ) } </ label >
5051 < input
5152 className = "form__input"
5253 type = "password"
53- aria-label = "confirm password"
54+ aria-label = { props . t ( 'SignupForm.ConfirmPasswordARIA' ) }
5455 id = "confirm password"
5556 { ...domOnlyProps ( confirmPassword ) }
5657 />
@@ -63,7 +64,7 @@ function SignupForm(props) {
6364 < Button
6465 type = "submit"
6566 disabled = { submitting || invalid || pristine }
66- > Sign Up
67+ > { props . t ( 'SignupForm.SubmitSignup' ) }
6768 </ Button >
6869 </ form >
6970 ) ;
@@ -81,7 +82,8 @@ SignupForm.propTypes = {
8182 submitting : PropTypes . bool ,
8283 invalid : PropTypes . bool ,
8384 pristine : PropTypes . bool ,
84- previousPath : PropTypes . string . isRequired
85+ previousPath : PropTypes . string . isRequired ,
86+ t : PropTypes . func . isRequired
8587} ;
8688
8789SignupForm . defaultProps = {
@@ -90,4 +92,4 @@ SignupForm.defaultProps = {
9092 invalid : false
9193} ;
9294
93- export default SignupForm ;
95+ export default withTranslation ( ) ( SignupForm ) ;
0 commit comments