@@ -3,6 +3,8 @@ import React from 'react';
33import { reduxForm } from 'redux-form' ;
44import { Link , browserHistory } from 'react-router' ;
55import { Helmet } from 'react-helmet' ;
6+ import { withTranslation } from 'react-i18next' ;
7+ import i18n from 'i18next' ;
68import { validateAndLoginUser } from '../actions' ;
79import LoginForm from '../components/LoginForm' ;
810import { validateLogin } from '../../../utils/reduxFormUtils' ;
@@ -34,23 +36,23 @@ class LoginView extends React.Component {
3436 < Nav layout = "dashboard" />
3537 < main className = "form-container" >
3638 < Helmet >
37- < title > p5.js Web Editor | Login </ title >
39+ < title > { this . props . t ( 'LoginView.Title' ) } </ title >
3840 </ Helmet >
3941 < div className = "form-container__content" >
40- < h2 className = "form-container__title" > Log In </ h2 >
42+ < h2 className = "form-container__title" > { this . props . t ( 'LoginView.Login' ) } </ h2 >
4143 < LoginForm { ...this . props } />
42- < h2 className = "form-container__divider" > Or </ h2 >
44+ < h2 className = "form-container__divider" > { this . props . t ( 'LoginView.LoginOr' ) } </ h2 >
4345 < div className = "form-container__stack" >
4446 < SocialAuthButton service = { SocialAuthButton . services . github } />
4547 < SocialAuthButton service = { SocialAuthButton . services . google } />
4648 </ div >
4749 < p className = "form__navigation-options" >
48- Don't have an account?
49- < Link className = "form__signup-button" to = "/signup" > Sign Up </ Link >
50+ { this . props . t ( 'LoginView.DontHaveAccount' ) }
51+ < Link className = "form__signup-button" to = "/signup" > { this . props . t ( 'LoginView.SignUp' ) } </ Link >
5052 </ p >
5153 < p className = "form__navigation-options" >
52- Forgot your password?
53- < Link className = "form__reset-password-button" to = "/reset-password" > Reset your password </ Link >
54+ { this . props . t ( 'LoginView.ForgotPassword' ) }
55+ < Link className = "form__reset-password-button" to = "/reset-password" > { this . props . t ( 'LoginView.ResetPassword' ) } </ Link >
5456 </ p >
5557 </ div >
5658 </ main >
@@ -76,7 +78,8 @@ LoginView.propTypes = {
7678 previousPath : PropTypes . string . isRequired ,
7779 user : PropTypes . shape ( {
7880 authenticated : PropTypes . bool
79- } )
81+ } ) ,
82+ t : PropTypes . func . isRequired
8083} ;
8184
8285LoginView . defaultProps = {
@@ -85,8 +88,8 @@ LoginView.defaultProps = {
8588 }
8689} ;
8790
88- export default reduxForm ( {
91+ export default withTranslation ( ) ( reduxForm ( {
8992 form : 'login' ,
9093 fields : [ 'email' , 'password' ] ,
9194 validate : validateLogin
92- } , mapStateToProps , mapDispatchToProps ) ( LoginView ) ;
95+ } , mapStateToProps , mapDispatchToProps ) ( LoginView ) ) ;
0 commit comments