add missing messages

pull/481/head
slowbackspace 5 years ago
parent 190b574d06
commit 64f257cade

@ -3,10 +3,11 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import styled from 'styled-components'; import styled from 'styled-components';
import { FormattedMessage } from 'react-intl';
import { getOldWalletUrl } from 'utils/url'; import { getOldWalletUrl } from 'utils/url';
import { H5, P, Icon, Button, Link, colors, icons } from 'trezor-ui-components'; import { H5, P, Icon, Button, Link, colors, icons } from 'trezor-ui-components';
import l10nCommonMessages from 'views/common.messages';
import type { TrezorDevice } from 'flowtype'; import type { TrezorDevice } from 'flowtype';
import type { Props as BaseProps } from '../../Container'; import type { Props as BaseProps } from '../../Container';
@ -66,20 +67,21 @@ const Confirmation = (props: Props) => (
<StyledLink onClick={() => props.onReceiveConfirmation(false)}> <StyledLink onClick={() => props.onReceiveConfirmation(false)}>
<Icon size={12} color={colors.TEXT_SECONDARY} icon={icons.CLOSE} /> <Icon size={12} color={colors.TEXT_SECONDARY} icon={icons.CLOSE} />
</StyledLink> </StyledLink>
<H5>Your Trezor is not backed up</H5> <H5>
<FormattedMessage {...l10nCommonMessages.TR_YOUR_TREZOR_IS_NOT_BACKED_UP} />
</H5>
<Icon size={32} color={colors.WARNING_PRIMARY} icon={icons.WARNING} /> <Icon size={32} color={colors.WARNING_PRIMARY} icon={icons.WARNING} />
<StyledP size="small"> <StyledP size="small">
If your device is ever lost or damaged, your funds will be lost. Backup your device <FormattedMessage {...l10nCommonMessages.TR_IF_YOUR_DEVICE_IS_EVER_LOST} />
first, to protect your coins against such events.
</StyledP> </StyledP>
<Row> <Row>
<Link href={`${getOldWalletUrl(props.device)}/?backup`} target="_self"> <Link href={`${getOldWalletUrl(props.device)}/?backup`} target="_self">
<BackupButton onClick={() => props.onReceiveConfirmation(false)}> <BackupButton onClick={() => props.onReceiveConfirmation(false)}>
Create a backup in 3 minutes <FormattedMessage {...l10nCommonMessages.TR_CREATE_BACKUP_IN_3_MINUTES} />
</BackupButton> </BackupButton>
</Link> </Link>
<ProceedButton isWhite onClick={() => props.onReceiveConfirmation(true)}> <ProceedButton isWhite onClick={() => props.onReceiveConfirmation(true)}>
Show address, I will take the risk <FormattedMessage {...l10nCommonMessages.TR_SHOW_ADDRESS_I_WILL_TAKE_THE_RISK} />
</ProceedButton> </ProceedButton>
</Row> </Row>
</Wrapper> </Wrapper>

@ -7,6 +7,7 @@ import { FormattedMessage } from 'react-intl';
import { Link, Button, Icon, P, H5, colors, icons } from 'trezor-ui-components'; import { Link, Button, Icon, P, H5, colors, icons } from 'trezor-ui-components';
import type { TrezorDevice } from 'flowtype'; import type { TrezorDevice } from 'flowtype';
import l10nCommonMessages from 'views/common.messages';
import l10nMessages from './index.messages'; import l10nMessages from './index.messages';
import type { Props as BaseProps } from '../../Container'; import type { Props as BaseProps } from '../../Container';
@ -169,16 +170,26 @@ class ConfirmUnverifiedAddress extends PureComponent<Props> {
{needsBackup && ( {needsBackup && (
<> <>
<Content> <Content>
<H5>Device {device.label} is not backed up</H5> <H5>
<FormattedMessage
{...l10nMessages.TR_DEVICE_LABEL_IS_NOT_BACKED_UP}
values={{ deviceLabel: device.label }}
/>
</H5>
<StyledP size="small"> <StyledP size="small">
If your device is ever lost or damaged, your funds will be lost. <FormattedMessage
Backup your device first, to protect your coins against such events. {...l10nCommonMessages.TR_IF_YOUR_DEVICE_IS_EVER_LOST}
/>
</StyledP> </StyledP>
</Content> </Content>
<Content> <Content>
<Row> <Row>
<Link href={`${getOldWalletUrl(device)}/?backup`}> <Link href={`${getOldWalletUrl(device)}/?backup`}>
<BackupButton>Create a backup in 3 minutes</BackupButton> <BackupButton>
<FormattedMessage
{...l10nCommonMessages.TR_CREATE_BACKUP_IN_3_MINUTES}
/>
</BackupButton>
</Link> </Link>
</Row> </Row>
</Content> </Content>

@ -7,6 +7,10 @@ const definedMessages: Messages = defineMessages({
id: 'TR_DEVICE_LABEL_IS_NOT_CONNECTED', id: 'TR_DEVICE_LABEL_IS_NOT_CONNECTED',
defaultMessage: 'Device {deviceLabel} is not connected', defaultMessage: 'Device {deviceLabel} is not connected',
}, },
TR_DEVICE_LABEL_IS_NOT_BACKED_UP: {
id: 'TR_DEVICE_LABEL_IS_NOT_BACKED_UP',
defaultMessage: 'Device {deviceLabel} is not backed up',
},
TR_DEVICE_LABEL_IS_UNAVAILABLE: { TR_DEVICE_LABEL_IS_UNAVAILABLE: {
id: 'TR_DEVICE_LABEL_IS_UNAVAILABLE', id: 'TR_DEVICE_LABEL_IS_UNAVAILABLE',
defaultMessage: 'Device {deviceLabel} is unavailable', defaultMessage: 'Device {deviceLabel} is unavailable',

@ -6,8 +6,11 @@ import styled from 'styled-components';
import { Button, H5, Link, P, Icon, icons, colors } from 'trezor-ui-components'; import { Button, H5, Link, P, Icon, icons, colors } from 'trezor-ui-components';
import coins from 'constants/coins'; import coins from 'constants/coins';
import { FormattedMessage } from 'react-intl';
import TezosImage from './images/xtz.png'; import TezosImage from './images/xtz.png';
import type { Props as BaseProps } from '../../Container'; import type { Props as BaseProps } from '../../Container';
import l10nCommonMessages from '../common.messages';
import l10nMessages from './index.messages';
type Props = { type Props = {
onCancel: $ElementType<$ElementType<BaseProps, 'modalActions'>, 'onCancel'>, onCancel: $ElementType<$ElementType<BaseProps, 'modalActions'>, 'onCancel'>,
@ -44,11 +47,17 @@ const TezosWallet = (props: Props) => (
<Icon size={12} color={colors.TEXT_SECONDARY} icon={icons.CLOSE} /> <Icon size={12} color={colors.TEXT_SECONDARY} icon={icons.CLOSE} />
</StyledLink> </StyledLink>
<Img src={TezosImage} /> <Img src={TezosImage} />
<H5>Tezos wallet</H5> <H5>
<P isSmaller>You will be redirected to external wallet</P> <FormattedMessage {...l10nMessages.TR_TEZOS_WALLET} />
</H5>
<P size="small">
<FormattedMessage {...l10nCommonMessages.TR_YOU_WILL_BE_REDIRECTED_TO_EXTERNAL} />
</P>
<Link href={coins.find(i => i.id === 'xtz').url}> <Link href={coins.find(i => i.id === 'xtz').url}>
<StyledButton onClick={props.onCancel}>Go to external wallet</StyledButton> <StyledButton onClick={props.onCancel}>
<FormattedMessage {...l10nCommonMessages.TR_GO_TO_EXTERNAL_WALLET} />
</StyledButton>
</Link> </Link>
</Wrapper> </Wrapper>
); );

@ -0,0 +1,12 @@
/* @flow */
import { defineMessages } from 'react-intl';
import type { Messages } from 'flowtype/npm/react-intl';
const definedMessages: Messages = defineMessages({
TR_TEZOS_WALLET: {
id: 'TR_TEZOS_WALLET',
defaultMessage: 'Tezos wallet',
},
});
export default definedMessages;

@ -1,7 +1,8 @@
/* @flow */ /* @flow */
import * as React from 'react'; import * as React from 'react';
import { Notification } from 'trezor-ui-components'; import { Notification } from 'trezor-ui-components';
import { FormattedMessage } from 'react-intl';
import l10nCommonMessages from 'views/common.messages';
import type { Props } from '../../index'; import type { Props } from '../../index';
export default (props: Props) => { export default (props: Props) => {
@ -13,11 +14,13 @@ export default (props: Props) => {
<Notification <Notification
key="no-backup" key="no-backup"
type="warning" type="warning"
title="Your Trezor is not backed up!" title={<FormattedMessage {...l10nCommonMessages.TR_YOUR_TREZOR_IS_NOT_BACKED_UP} />}
message="If your device is ever lost or damaged, your funds will be lost. Backup your device first, to protect your coins against such events." message={<FormattedMessage {...l10nCommonMessages.TR_IF_YOUR_DEVICE_IS_EVER_LOST} />}
actions={[ actions={[
{ {
label: 'Create a backup', label: (
<FormattedMessage {...l10nCommonMessages.TR_CREATE_BACKUP_IN_3_MINUTES} />
),
callback: props.routerActions.gotoBackup, callback: props.routerActions.gotoBackup,
}, },
]} ]}

@ -150,7 +150,12 @@ class ConnectDevice extends PureComponent<Props> {
<Wrapper> <Wrapper>
<ConnectTrezorWrapper> <ConnectTrezorWrapper>
{this.props.showDisconnect && `Unplug "${this.props.deviceLabel}" device`} {this.props.showDisconnect && (
<FormattedMessage
{...l10nMessages.TR_UNPLUG_DEVICE_LABEL}
values={{ deviceLabel: this.props.deviceLabel }}
/>
)}
{!this.props.showDisconnect && ( {!this.props.showDisconnect && (
<React.Fragment> <React.Fragment>
{this.getTrezorDeviceImage()} {this.getTrezorDeviceImage()}

@ -33,6 +33,10 @@ const definedMessages: Messages = defineMessages({
description: 'Part of the sentence: Dont have a Trezor? Get one', description: 'Part of the sentence: Dont have a Trezor? Get one',
defaultMessage: 'Get one', defaultMessage: 'Get one',
}, },
TR_UNPLUG_DEVICE_LABEL: {
id: 'TR_UNPLUG_DEVICE_LABEL',
defaultMessage: 'Unplug "{deviceLabel}" device',
},
}); });
export default definedMessages; export default definedMessages;

@ -141,7 +141,7 @@ class AccountBalance extends PureComponent<Props, State> {
<Tooltip <Tooltip
maxWidth={285} maxWidth={285}
placement="top" placement="top"
content="Fiat rates are not currently available." content={<FormattedMessage {...l10nMessages.TR_FIAT_RATES_ARE_NOT_CURRENTLY} />}
> >
<StyledIcon icon={ICONS.HELP} color={colors.TEXT_SECONDARY} size={12} /> <StyledIcon icon={ICONS.HELP} color={colors.TEXT_SECONDARY} size={12} />
</Tooltip> </Tooltip>

@ -16,6 +16,10 @@ const definedMessages: Messages = defineMessages({
defaultMessage: 'Reserve', defaultMessage: 'Reserve',
description: 'Label for minimal XRP account reserve', description: 'Label for minimal XRP account reserve',
}, },
TR_FIAT_RATES_ARE_NOT_CURRENTLY: {
id: 'TR_FIAT_RATES_ARE_NOT_CURRENTLY',
defaultMessage: 'Fiat rates are not currently available.',
},
}); });
export default definedMessages; export default definedMessages;

@ -3,8 +3,10 @@ import React from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import { Button, Icon, Link, P, H4, colors, icons } from 'trezor-ui-components'; import { Button, Icon, Link, P, H4, colors, icons } from 'trezor-ui-components';
import { getOldWalletUrl } from 'utils/url'; import { getOldWalletUrl } from 'utils/url';
import { FormattedMessage } from 'react-intl';
import l10nCommonMessages from 'views/common.messages';
import type { TrezorDevice } from 'flowtype'; import type { TrezorDevice } from 'flowtype';
import l10nMessages from './index.messages';
type Props = { type Props = {
device: ?TrezorDevice, device: ?TrezorDevice,
@ -40,24 +42,29 @@ const StyledIcon = styled(Icon)`
margin-bottom: 15px; margin-bottom: 15px;
`; `;
const FirmwareUpdate = (props: Props) => ( const NoBackup = (props: Props) => (
<Wrapper> <Wrapper>
<StyledIcon size={64} color={colors.WARNING_PRIMARY} icon={icons.WARNING} /> <StyledIcon size={64} color={colors.WARNING_PRIMARY} icon={icons.WARNING} />
<StyledH>Your Trezor is not backed up!</StyledH> <StyledH>
<FormattedMessage {...l10nCommonMessages.TR_YOUR_TREZOR_IS_NOT_BACKED_UP} />
</StyledH>
<Message> <Message>
<StyledP> <StyledP>
If your device is ever lost or damaged, your funds will be lost. Backup your device <FormattedMessage {...l10nCommonMessages.TR_IF_YOUR_DEVICE_IS_EVER_LOST} />
first, to protect your coins against such events.
</StyledP> </StyledP>
<P>Please use Bitcoin wallet interface to create a backup.</P> <P>
<FormattedMessage {...l10nMessages.TR_PLEASE_USE_TO_CREATE_BACKUP} />
</P>
</Message> </Message>
<Link href={`${getOldWalletUrl(props.device)}?backup=1`} target="_self"> <Link href={`${getOldWalletUrl(props.device)}?backup=1`} target="_self">
<Button>Take me to the Bitcoin wallet</Button> <Button>
<FormattedMessage {...l10nCommonMessages.TR_TAKE_ME_TO_BITCOIN_WALLET} />
</Button>
</Link> </Link>
<StyledNavLink isGray to="/"> <StyledNavLink isGray to="/">
Ill do that later. <FormattedMessage {...l10nCommonMessages.TR_I_WILL_DO_THAT_LATER} />
</StyledNavLink> </StyledNavLink>
</Wrapper> </Wrapper>
); );
export default FirmwareUpdate; export default NoBackup;

@ -0,0 +1,12 @@
/* @flow */
import { defineMessages } from 'react-intl';
import type { Messages } from 'flowtype/npm/react-intl';
const definedMessages: Messages = defineMessages({
TR_PLEASE_USE_TO_CREATE_BACKUP: {
id: 'TR_PLEASE_USE_TO_CREATE_BACKUP',
defaultMessage: 'Please use Bitcoin wallet interface to create a backup.',
},
});
export default definedMessages;

@ -78,6 +78,23 @@ const definedMessages: Messages = defineMessages({
id: 'TR_THE_ACCOUNT_BALANCE_IS_HIDDEN', id: 'TR_THE_ACCOUNT_BALANCE_IS_HIDDEN',
defaultMessage: 'The account balance is hidden.', defaultMessage: 'The account balance is hidden.',
}, },
TR_IF_YOUR_DEVICE_IS_EVER_LOST: {
id: 'TR_IF_YOUR_DEVICE_IS_EVER_LOST',
defaultMessage:
'If your device is ever lost or damaged, your funds will be lost. Backup your device first, to protect your coins against such events.',
},
TR_CREATE_BACKUP_IN_3_MINUTES: {
id: 'TR_CREATE_BACKUP_IN_3_MINUTES',
defaultMessage: 'Create a backup in 3 minutes',
},
TR_YOUR_TREZOR_IS_NOT_BACKED_UP: {
id: 'TR_YOUR_TREZOR_IS_NOT_BACKED_UP',
defaultMessage: 'Your Trezor is not backed up',
},
TR_SHOW_ADDRESS_I_WILL_TAKE_THE_RISK: {
id: 'TR_SHOW_ADDRESS_I_WILL_TAKE_THE_RISK',
defaultMessage: 'Show address, I will take the risk',
},
}); });
export default definedMessages; export default definedMessages;

Loading…
Cancel
Save