Commit ce856731 authored by nano's avatar nano

i18n

parent ad93297c
import { Button, Checkbox, Form, Icon, Input, Spin } from 'antd';
import { FormattedMessage as Format } from 'react-intl'
import languages from '../../i18n.json'
import { connect } from 'dva';
import { Link } from 'dva/router';
import React from 'react';
import React, { PropTypes } from 'react';
import "./Login.less"
const FormItem = Form.Item;
......@@ -11,6 +10,10 @@ const FormItem = Form.Item;
class Login extends React.Component {
static contextTypes = {
intl: PropTypes.object.isRequired,
}
onSubmitLogin = (e) => {
const { form, dispatch } = this.props;
if (e) {
......@@ -28,8 +31,8 @@ class Login extends React.Component {
render() {
const { getFieldDecorator } = this.props.form;
const { isLoginSubmit = false, language } = this.props;
const lan = languages[language]
const { isLoginSubmit = false } = this.props;
const { intl: {messages} } = this.context
return (
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%' }}>
......@@ -39,7 +42,7 @@ class Login extends React.Component {
{getFieldDecorator('account', {
rules: [{ required: true, message: 'Please input your account!' }],
})(
<Input prefix={<Icon type="user" style={{ fontSize: 13 }} />} placeholder={lan["Username"]} />,
<Input prefix={<Icon type="user" style={{ fontSize: 13 }} />} placeholder={messages["Username"]} />,
)}
</FormItem>
<FormItem>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment