Remove all *.intl.json files. Move strings to the corresponding views. Implement custom command to build i18n/en.json file

This commit is contained in:
ErickSkrauch
2020-06-04 19:41:27 +03:00
parent 57cf6b3776
commit bf6a76d006
107 changed files with 1122 additions and 972 deletions

View File

@@ -1,7 +0,0 @@
{
"title": "Forgot password",
"sendMail": "Send mail",
"specifyEmail": "Specify the registration Email address or last used username for your account and we will send an Email with instructions for further password recovery.",
"pleasePressButton": "Please press the button bellow to get an Email with password recovery code.",
"alreadyHaveCode": "Already have a code"
}

View File

@@ -1,7 +1,13 @@
import { defineMessages } from 'react-intl';
import factory from '../factory';
import messages from './ForgotPassword.intl.json';
import Body from './ForgotPasswordBody';
const messages = defineMessages({
title: 'Forgot password',
sendMail: 'Send mail',
alreadyHaveCode: 'Already have a code',
});
export default factory({
title: messages.title,
body: Body,

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { FormattedMessage as Message } from 'react-intl';
import { defineMessages, FormattedMessage as Message } from 'react-intl';
import { Input, Captcha } from 'app/components/ui/form';
import { getLogin } from 'app/components/auth/reducer';
@@ -8,7 +8,10 @@ import { PanelIcon } from 'app/components/ui/Panel';
import BaseAuthBody from 'app/components/auth/BaseAuthBody';
import styles from './forgotPassword.scss';
import messages from './ForgotPassword.intl.json';
const messages = defineMessages({
emailOrUsername: 'Email or username',
});
export default class ForgotPasswordBody extends BaseAuthBody {
static displayName = 'ForgotPasswordBody';
@@ -36,14 +39,17 @@ export default class ForgotPasswordBody extends BaseAuthBody {
{isLoginEditShown ? (
<div>
<p className={styles.descriptionText}>
<Message {...messages.specifyEmail} />
<Message
key="specifyEmail"
defaultMessage="Specify the registration Email address or last used username for your account and we will send an Email with instructions for further password recovery."
/>
</p>
<Input
{...this.bindField('login')}
icon="envelope"
color="lightViolet"
required
placeholder={messages.accountEmail}
placeholder={messages.emailOrUsername}
defaultValue={login}
/>
</div>
@@ -54,7 +60,10 @@ export default class ForgotPasswordBody extends BaseAuthBody {
<span className={styles.editLogin} onClick={this.onClickEdit} data-testid="edit-login" />
</div>
<p className={styles.descriptionText}>
<Message {...messages.pleasePressButton} />
<Message
key="pleasePressButton"
defaultMessage="Please press the button bellow to get an Email with password recovery code."
/>
</p>
</div>
)}