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 @@
{
"chooseAccountTitle": "Choose an account",
"addAccount": "Log into another account",
"logoutAll": "Log out from all accounts",
"pleaseChooseAccount": "Please select an account you're willing to use",
"pleaseChooseAccountForApp": "Please select an account that you want to use to authorize {appName}"
}

View File

@@ -1,7 +1,13 @@
import { defineMessages } from 'react-intl';
import factory from '../factory';
import messages from './ChooseAccount.intl.json';
import Body from './ChooseAccountBody';
const messages = defineMessages({
chooseAccountTitle: 'Choose an account',
addAccount: 'Log into another account',
logoutAll: 'Log out from all accounts',
});
export default factory({
title: messages.chooseAccountTitle,
body: Body,

View File

@@ -7,7 +7,6 @@ import { AccountSwitcher } from 'app/components/accounts';
import { Account } from 'app/components/accounts/reducer';
import styles from './chooseAccount.scss';
import messages from './ChooseAccount.intl.json';
export default class ChooseAccountBody extends BaseAuthBody {
static displayName = 'ChooseAccountBody';
@@ -23,14 +22,18 @@ export default class ChooseAccountBody extends BaseAuthBody {
<div className={styles.description}>
{client ? (
<Message
{...messages.pleaseChooseAccountForApp}
key="pleaseChooseAccountForApp"
defaultMessage="Please select an account that you want to use to authorize {appName}"
values={{
appName: <span className={styles.appName}>{client.name}</span>,
}}
/>
) : (
<div className={styles.description}>
<Message {...messages.pleaseChooseAccount} />
<Message
key="pleaseChooseAccount"
defaultMessage="Please select an account you're willing to use"
/>
</div>
)}
</div>