From a87e6c50d63ad54433a92616cbf6e38dddf2dc40 Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Thu, 22 Nov 2018 18:05:54 +0100 Subject: [PATCH] Updated stale translations --- src/components/MainSideBar/index.js | 18 ++++++++--------- src/components/PillsDaysCount.js | 2 +- src/components/SettingsPage/index.js | 10 +++++----- src/components/base/Pills/index.js | 2 +- src/components/modals/AddAccounts/index.js | 20 +++++++++---------- src/components/modals/Receive/index.js | 14 ++++++------- .../modals/Receive/steps/01-step-account.js | 5 +++-- .../Receive/steps/02-step-connect-device.js | 3 ++- src/components/modals/Send/index.js | 14 ++++++------- 9 files changed, 45 insertions(+), 43 deletions(-) diff --git a/src/components/MainSideBar/index.js b/src/components/MainSideBar/index.js index fbf843ed..8fa91bf5 100644 --- a/src/components/MainSideBar/index.js +++ b/src/components/MainSideBar/index.js @@ -1,7 +1,7 @@ // @flow import React, { PureComponent } from 'react' -import { translate } from 'react-i18next' +import { Trans, translate } from 'react-i18next' import { connect } from 'react-redux' import { compose } from 'redux' import { withRouter } from 'react-router' @@ -87,13 +87,6 @@ class MainSideBar extends PureComponent { push(to) } - ADD_ACCOUNT_EMPTY_STATE = ( - - - {this.props.t('emptyState.sidebar.text')} - - ) - handleClickDashboard = () => this.push('/') handleOpenSendModal = () => this.props.openModal(MODAL_SEND) handleOpenReceiveModal = () => this.props.openModal(MODAL_RECEIVE) @@ -110,6 +103,13 @@ class MainSideBar extends PureComponent { ) + const emptyState = ( + + + + + ) + return ( @@ -168,7 +168,7 @@ class MainSideBar extends PureComponent { {accounts.map(account => ( *, + onChange: ({ key: string, value: *, label: React$Node }) => *, t: T, } diff --git a/src/components/SettingsPage/index.js b/src/components/SettingsPage/index.js index 1a4e5a5c..5652f5f3 100644 --- a/src/components/SettingsPage/index.js +++ b/src/components/SettingsPage/index.js @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react' import { compose } from 'redux' import { connect } from 'react-redux' -import { translate } from 'react-i18next' +import { Trans, translate } from 'react-i18next' import type { T } from 'types/common' import { Switch, Route } from 'react-router' import type { RouterHistory, Match, Location } from 'react-router' @@ -40,22 +40,22 @@ class SettingsPage extends PureComponent { this._items = [ { key: 'display', - label: props.t('settings.tabs.display'), + label: , value: SectionDisplay, }, { key: 'currencies', - label: props.t('settings.tabs.currencies'), + label: , value: SectionCurrencies, }, { key: 'about', - label: props.t('settings.tabs.about'), + label: , value: SectionAbout, }, { key: 'help', - label: props.t('settings.tabs.help'), + label: , value: SectionHelp, }, ] diff --git a/src/components/base/Pills/index.js b/src/components/base/Pills/index.js index b32e4456..d6bdb62b 100644 --- a/src/components/base/Pills/index.js +++ b/src/components/base/Pills/index.js @@ -8,7 +8,7 @@ import Box, { Tabbable } from 'components/base/Box' import BoldToggle from 'components/base/BoldToggle' type Item = { - label: string, + label: React$Node, key: string, value?: any, } diff --git a/src/components/modals/AddAccounts/index.js b/src/components/modals/AddAccounts/index.js index a9f8fff9..e6edd600 100644 --- a/src/components/modals/AddAccounts/index.js +++ b/src/components/modals/AddAccounts/index.js @@ -3,7 +3,7 @@ import React, { PureComponent } from 'react' import { compose } from 'redux' import { connect } from 'react-redux' -import { translate } from 'react-i18next' +import { Trans, translate } from 'react-i18next' import { createStructuredSelector } from 'reselect' import Track from 'analytics/Track' @@ -30,7 +30,7 @@ import StepConnectDevice, { StepConnectDeviceFooter } from './steps/02-step-conn import StepImport, { StepImportFooter } from './steps/03-step-import' import StepFinish, { StepFinishFooter } from './steps/04-step-finish' -const createSteps = ({ t }: { t: T }) => { +const createSteps = () => { const onBack = ({ transitionTo, resetScanState }: StepProps) => { resetScanState() transitionTo('chooseCurrency') @@ -38,7 +38,7 @@ const createSteps = ({ t }: { t: T }) => { return [ { id: 'chooseCurrency', - label: t('addAccounts.breadcrumb.informations'), + label: , component: StepChooseCurrency, footer: StepChooseCurrencyFooter, onBack: null, @@ -46,7 +46,7 @@ const createSteps = ({ t }: { t: T }) => { }, { id: 'connectDevice', - label: t('addAccounts.breadcrumb.connectDevice'), + label: , component: StepConnectDevice, footer: StepConnectDeviceFooter, onBack, @@ -54,7 +54,7 @@ const createSteps = ({ t }: { t: T }) => { }, { id: 'import', - label: t('addAccounts.breadcrumb.import'), + label: , component: StepImport, footer: StepImportFooter, onBack, @@ -62,7 +62,7 @@ const createSteps = ({ t }: { t: T }) => { }, { id: 'finish', - label: t('addAccounts.breadcrumb.finish'), + label: , component: StepFinish, footer: StepFinishFooter, onBack: null, @@ -72,7 +72,6 @@ const createSteps = ({ t }: { t: T }) => { } type Props = { - t: T, device: ?Device, existingAccounts: Account[], closeModal: string => void, @@ -143,7 +142,7 @@ const INITIAL_STATE = { class AddAccounts extends PureComponent { state = INITIAL_STATE - STEPS = createSteps({ t: this.props.t }) + STEPS = createSteps() handleClickAdd = async () => { const { addAccount } = this.props @@ -205,7 +204,7 @@ class AddAccounts extends PureComponent { } render() { - const { t, device, existingAccounts } = this.props + const { device, existingAccounts } = this.props const { stepId, currency, @@ -238,6 +237,7 @@ class AddAccounts extends PureComponent { onGoStep1: this.onGoStep1, editedNames, } + const title = return ( { render={({ onClose }) => ( void, } -const createSteps = ({ t }: { t: T }) => [ +const createSteps = () => [ { id: 'account', - label: t('receive.steps.chooseAccount.title'), + label: , component: StepAccount, footer: StepAccountFooter, }, { id: 'device', - label: t('receive.steps.connectDevice.title'), + label: , component: StepConnectDevice, footer: StepConnectDeviceFooter, onBack: ({ transitionTo }: StepProps) => transitionTo('account'), }, { id: 'confirm', - label: t('receive.steps.confirmAddress.title'), + label: , footer: StepConfirmAddressFooter, component: StepConfirmAddress, onBack: ({ transitionTo }: StepProps) => transitionTo('device'), @@ -82,7 +82,7 @@ const createSteps = ({ t }: { t: T }) => [ }, { id: 'receive', - label: t('receive.steps.receiveFunds.title'), + label: , component: StepReceiveFunds, shouldPreventClose: ({ isAddressVerified }: StepProps) => isAddressVerified === null, }, @@ -108,7 +108,7 @@ const INITIAL_STATE = { class ReceiveModal extends PureComponent { state = INITIAL_STATE - STEPS = createSteps({ t: this.props.t }) + STEPS = createSteps() handleBeforeOpenModal = ({ data }) => { const { account } = this.state diff --git a/src/components/modals/Receive/steps/01-step-account.js b/src/components/modals/Receive/steps/01-step-account.js index ae3b70a3..e45cc9e1 100644 --- a/src/components/modals/Receive/steps/01-step-account.js +++ b/src/components/modals/Receive/steps/01-step-account.js @@ -9,6 +9,7 @@ import Button from 'components/base/Button' import SelectAccount from 'components/SelectAccount' import CurrencyDownStatusAlert from 'components/CurrencyDownStatusAlert' +import { Trans } from 'react-i18next' import type { StepProps } from '../index' export default function StepAccount({ t, account, onChangeAccount }: StepProps) { @@ -23,10 +24,10 @@ export default function StepAccount({ t, account, onChangeAccount }: StepProps) ) } -export function StepAccountFooter({ t, transitionTo, account }: StepProps) { +export function StepAccountFooter({ transitionTo, account }: StepProps) { return ( ) } diff --git a/src/components/modals/Receive/steps/02-step-connect-device.js b/src/components/modals/Receive/steps/02-step-connect-device.js index f0bed7c8..ecd156ae 100644 --- a/src/components/modals/Receive/steps/02-step-connect-device.js +++ b/src/components/modals/Receive/steps/02-step-connect-device.js @@ -9,6 +9,7 @@ import CurrencyDownStatusAlert from 'components/CurrencyDownStatusAlert' import TrackPage from 'analytics/TrackPage' import type { StepProps } from '../index' +import { Trans } from 'react-i18next' export default function StepConnectDevice({ account, onChangeAppOpened }: StepProps) { return ( @@ -42,7 +43,7 @@ export function StepConnectDeviceFooter({ {t('receive.steps.connectDevice.withoutDevice')} ) diff --git a/src/components/modals/Send/index.js b/src/components/modals/Send/index.js index cd7b122a..724c1b53 100644 --- a/src/components/modals/Send/index.js +++ b/src/components/modals/Send/index.js @@ -4,7 +4,7 @@ import React, { PureComponent } from 'react' import invariant from 'invariant' import { compose } from 'redux' import { connect } from 'react-redux' -import { translate } from 'react-i18next' +import {Trans, translate} from 'react-i18next' import { createStructuredSelector } from 'reselect' import type { Account, Operation } from '@ledgerhq/live-common/lib/types' @@ -72,29 +72,29 @@ export type StepProps = DefaultStepProps & { signTransaction: ({ transitionTo: string => void }) => void, } -const createSteps = ({ t }: { t: T }) => [ +const createSteps = () => [ { id: 'amount', - label: t('send.steps.amount.title'), + label: , component: StepAmount, footer: StepAmountFooter, }, { id: 'device', - label: t('send.steps.connectDevice.title'), + label: , component: StepConnectDevice, footer: StepConnectDeviceFooter, onBack: ({ transitionTo }) => transitionTo('amount'), }, { id: 'verification', - label: t('send.steps.verification.title'), + label: , component: StepVerification, shouldPreventClose: true, }, { id: 'confirmation', - label: t('send.steps.confirmation.title'), + label: , component: StepConfirmation, footer: StepConfirmationFooter, onBack: ({ transitionTo, onRetry }) => { @@ -136,7 +136,7 @@ class SendModal extends PureComponent> { } } - STEPS = createSteps({ t: this.props.t }) + STEPS = createSteps() _signTransactionSub = null _isUnmounted = false