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,8 +0,0 @@
{
"title": "User Agreement",
"accept": "Accept",
"declineAndLogout": "Decline and logout",
"description1": "We have updated our {link}.",
"termsOfService": "terms of service",
"description2": "In order to continue using {name} service, you need to accept them."
}

View File

@@ -1,6 +1,12 @@
import { defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './AcceptRulesBody';
import messages from './AcceptRules.intl.json';
const messages = defineMessages({
title: 'User Agreement',
accept: 'Accept',
declineAndLogout: 'Decline and logout',
});
export default factory({
title: messages.title,

View File

@@ -5,10 +5,9 @@ import { Link } from 'react-router-dom';
import icons from 'app/components/ui/icons.scss';
import BaseAuthBody from 'app/components/auth/BaseAuthBody';
import appInfo from 'app/components/auth/appInfo/AppInfo.intl.json';
import appName from 'app/components/auth/appInfo/appName.intl';
import styles from './acceptRules.scss';
import messages from './AcceptRules.intl.json';
export default class AcceptRulesBody extends BaseAuthBody {
static displayName = 'AcceptRulesBody';
@@ -25,20 +24,22 @@ export default class AcceptRulesBody extends BaseAuthBody {
<p className={styles.descriptionText}>
<Message
{...messages.description1}
key="description1"
defaultMessage="We have updated our {link}."
values={{
link: (
<Link to="/rules" target="_blank">
<Message {...messages.termsOfService} />
<Message key="termsOfService" defaultMessage="terms of service" />
</Link>
),
}}
/>
<br />
<Message
{...messages.description2}
key="description2"
defaultMessage="In order to continue using {name} service, you need to accept them."
values={{
name: <Message {...appInfo.appName} />,
name: <Message {...appName} />,
}}
/>
</p>