Commit 7c9026a9 authored by 庞志刚's avatar 庞志刚 Committed by 陈帅

增加验证码按钮国际化, Fix #2790 . (#2810)

Signed-off-by: default avatarPangZhiGang <306888588@qq.com>
parent 6e0163ad
import React, { Component } from 'react';
import { Form, Input, Button, Row, Col } from 'antd';
import { formatMessage } from 'umi/locale';
import omit from 'omit.js';
import styles from './index.less';
import ItemMap from './map';
......@@ -9,7 +10,8 @@ const FormItem = Form.Item;
class WrapFormItem extends Component {
static defaultProps = {
buttonText: '获取验证码',
getCaptchaButtonText: formatMessage({ id: 'form.captcha' }),
getCaptchaSecondText: formatMessage({ id: 'form.captcha.second' }),
};
constructor(props) {
......@@ -83,7 +85,8 @@ class WrapFormItem extends Component {
defaultValue,
rules,
name,
buttonText,
getCaptchaButtonText,
getCaptchaSecondText,
updateActive,
type,
...restProps
......@@ -108,7 +111,7 @@ class WrapFormItem extends Component {
size="large"
onClick={this.onGetCaptcha}
>
{count ? `${count} s` : buttonText}
{count ? `${count} ${getCaptchaSecondText}` : getCaptchaButtonText}
</Button>
</Col>
</Row>
......
......@@ -13,6 +13,11 @@
}
}
.getCaptcha {
display: block;
width: 100%;
}
.icon {
font-size: 24px;
color: rgba(0, 0, 0, 0.2);
......
......@@ -32,7 +32,7 @@
}
.content {
padding: 72px 0 24px 0;
padding: 32px 0 24px 0;
}
}
......
......@@ -20,6 +20,8 @@ export default {
'validation.date.required': 'Please select the start and end date',
'validation.goal.required': 'Please enter a description of the goal',
'validation.standard.required': 'Please enter a metric',
'form.captcha': 'Get Captcha',
'form.captcha.second': 'sec',
'form.optional': ' (optional) ',
'form.submit': 'Submit',
'form.save': 'Save',
......
......@@ -16,6 +16,8 @@ export default {
'validation.phone-number.required': 'Por favor insira seu telefone!',
'validation.phone-number.wrong-format': 'Formato de telefone errado!',
'validation.verification-code.required': 'Por favor insira seu código de verificação!',
'form.captcha': 'Get Captcha',
'form.captcha.second': 'sec',
'form.email.placeholder': 'Email',
'form.password.placeholder': 'Senha',
'form.confirm-password.placeholder': 'Confirme a senha',
......
......@@ -19,6 +19,8 @@ export default {
'validation.date.required': '请选择起止日期',
'validation.goal.required': '请输入目标描述',
'validation.standard.required': '请输入衡量标准',
'form.captcha': '获取验证码',
'form.captcha.second': '',
'form.optional': '(选填)',
'form.submit': '提交',
'form.save': '保存',
......
......@@ -19,6 +19,8 @@ export default {
'validation.date.required': '請選擇起止日期',
'validation.goal.required': '請輸入目標描述',
'validation.standard.required': '請輸入衡量標淮',
'form.captcha': '獲取驗證碼',
'form.captcha.second': '',
'form.optional': '(選填)',
'form.submit': '提交',
'form.save': '保存',
......
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