Browse Source

Updated stale translations

gre-patch-1
Juan Cortes Ross 6 years ago
parent
commit
a87e6c50d6
No known key found for this signature in database GPG Key ID: 34A99C03E9455EB8
  1. 18
      src/components/MainSideBar/index.js
  2. 2
      src/components/PillsDaysCount.js
  3. 10
      src/components/SettingsPage/index.js
  4. 2
      src/components/base/Pills/index.js
  5. 20
      src/components/modals/AddAccounts/index.js
  6. 14
      src/components/modals/Receive/index.js
  7. 5
      src/components/modals/Receive/steps/01-step-account.js
  8. 3
      src/components/modals/Receive/steps/02-step-connect-device.js
  9. 14
      src/components/modals/Send/index.js

18
src/components/MainSideBar/index.js

@ -1,7 +1,7 @@
// @flow // @flow
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import { translate } from 'react-i18next' import { Trans, translate } from 'react-i18next'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { compose } from 'redux' import { compose } from 'redux'
import { withRouter } from 'react-router' import { withRouter } from 'react-router'
@ -87,13 +87,6 @@ class MainSideBar extends PureComponent<Props> {
push(to) push(to)
} }
ADD_ACCOUNT_EMPTY_STATE = (
<Box relative pr={3}>
<img style={{ position: 'absolute', top: -10, right: 5 }} alt="" src={i('arrow-add.svg')} />
{this.props.t('emptyState.sidebar.text')}
</Box>
)
handleClickDashboard = () => this.push('/') handleClickDashboard = () => this.push('/')
handleOpenSendModal = () => this.props.openModal(MODAL_SEND) handleOpenSendModal = () => this.props.openModal(MODAL_SEND)
handleOpenReceiveModal = () => this.props.openModal(MODAL_RECEIVE) handleOpenReceiveModal = () => this.props.openModal(MODAL_RECEIVE)
@ -110,6 +103,13 @@ class MainSideBar extends PureComponent<Props> {
<AddAccountButton tooltipText={t('addAccounts.title')} onClick={this.handleOpenImportModal} /> <AddAccountButton tooltipText={t('addAccounts.title')} onClick={this.handleOpenImportModal} />
) )
const emptyState = (
<Box relative pr={3}>
<img style={{ position: 'absolute', top: -10, right: 5 }} alt="" src={i('arrow-add.svg')} />
<Trans i18nKey="emptyState.sidebar.text" />
</Box>
)
return ( return (
<Box relative bg="white" style={{ width: 230 }}> <Box relative bg="white" style={{ width: 230 }}>
<TopGradient /> <TopGradient />
@ -168,7 +168,7 @@ class MainSideBar extends PureComponent<Props> {
<SideBarList <SideBarList
title={t('sidebar.accounts', { count: accounts.length })} title={t('sidebar.accounts', { count: accounts.length })}
titleRight={addAccountButton} titleRight={addAccountButton}
emptyState={this.ADD_ACCOUNT_EMPTY_STATE} emptyState={emptyState}
> >
{accounts.map(account => ( {accounts.map(account => (
<AccountListItem <AccountListItem

2
src/components/PillsDaysCount.js

@ -10,7 +10,7 @@ import Track from 'analytics/Track'
type Props = { type Props = {
selected: string, selected: string,
onChange: ({ key: string, value: *, label: string }) => *, onChange: ({ key: string, value: *, label: React$Node }) => *,
t: T, t: T,
} }

10
src/components/SettingsPage/index.js

@ -3,7 +3,7 @@
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import { compose } from 'redux' import { compose } from 'redux'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { translate } from 'react-i18next' import { Trans, translate } from 'react-i18next'
import type { T } from 'types/common' import type { T } from 'types/common'
import { Switch, Route } from 'react-router' import { Switch, Route } from 'react-router'
import type { RouterHistory, Match, Location } from 'react-router' import type { RouterHistory, Match, Location } from 'react-router'
@ -40,22 +40,22 @@ class SettingsPage extends PureComponent<Props, State> {
this._items = [ this._items = [
{ {
key: 'display', key: 'display',
label: props.t('settings.tabs.display'), label: <Trans i18nKey="settings.tabs.display" />,
value: SectionDisplay, value: SectionDisplay,
}, },
{ {
key: 'currencies', key: 'currencies',
label: props.t('settings.tabs.currencies'), label: <Trans i18nKey="settings.tabs.currencies" />,
value: SectionCurrencies, value: SectionCurrencies,
}, },
{ {
key: 'about', key: 'about',
label: props.t('settings.tabs.about'), label: <Trans i18nKey="settings.tabs.about" />,
value: SectionAbout, value: SectionAbout,
}, },
{ {
key: 'help', key: 'help',
label: props.t('settings.tabs.help'), label: <Trans i18nKey="settings.tabs.help" />,
value: SectionHelp, value: SectionHelp,
}, },
] ]

2
src/components/base/Pills/index.js

@ -8,7 +8,7 @@ import Box, { Tabbable } from 'components/base/Box'
import BoldToggle from 'components/base/BoldToggle' import BoldToggle from 'components/base/BoldToggle'
type Item = { type Item = {
label: string, label: React$Node,
key: string, key: string,
value?: any, value?: any,
} }

20
src/components/modals/AddAccounts/index.js

@ -3,7 +3,7 @@
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import { compose } from 'redux' import { compose } from 'redux'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { translate } from 'react-i18next' import { Trans, translate } from 'react-i18next'
import { createStructuredSelector } from 'reselect' import { createStructuredSelector } from 'reselect'
import Track from 'analytics/Track' 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 StepImport, { StepImportFooter } from './steps/03-step-import'
import StepFinish, { StepFinishFooter } from './steps/04-step-finish' import StepFinish, { StepFinishFooter } from './steps/04-step-finish'
const createSteps = ({ t }: { t: T }) => { const createSteps = () => {
const onBack = ({ transitionTo, resetScanState }: StepProps) => { const onBack = ({ transitionTo, resetScanState }: StepProps) => {
resetScanState() resetScanState()
transitionTo('chooseCurrency') transitionTo('chooseCurrency')
@ -38,7 +38,7 @@ const createSteps = ({ t }: { t: T }) => {
return [ return [
{ {
id: 'chooseCurrency', id: 'chooseCurrency',
label: t('addAccounts.breadcrumb.informations'), label: <Trans i18nKey="addAccounts.breadcrumb.informations" />,
component: StepChooseCurrency, component: StepChooseCurrency,
footer: StepChooseCurrencyFooter, footer: StepChooseCurrencyFooter,
onBack: null, onBack: null,
@ -46,7 +46,7 @@ const createSteps = ({ t }: { t: T }) => {
}, },
{ {
id: 'connectDevice', id: 'connectDevice',
label: t('addAccounts.breadcrumb.connectDevice'), label: <Trans i18nKey="addAccounts.breadcrumb.connectDevice" />,
component: StepConnectDevice, component: StepConnectDevice,
footer: StepConnectDeviceFooter, footer: StepConnectDeviceFooter,
onBack, onBack,
@ -54,7 +54,7 @@ const createSteps = ({ t }: { t: T }) => {
}, },
{ {
id: 'import', id: 'import',
label: t('addAccounts.breadcrumb.import'), label: <Trans i18nKey="addAccounts.breadcrumb.import" />,
component: StepImport, component: StepImport,
footer: StepImportFooter, footer: StepImportFooter,
onBack, onBack,
@ -62,7 +62,7 @@ const createSteps = ({ t }: { t: T }) => {
}, },
{ {
id: 'finish', id: 'finish',
label: t('addAccounts.breadcrumb.finish'), label: <Trans i18nKey="addAccounts.breadcrumb.finish" />,
component: StepFinish, component: StepFinish,
footer: StepFinishFooter, footer: StepFinishFooter,
onBack: null, onBack: null,
@ -72,7 +72,6 @@ const createSteps = ({ t }: { t: T }) => {
} }
type Props = { type Props = {
t: T,
device: ?Device, device: ?Device,
existingAccounts: Account[], existingAccounts: Account[],
closeModal: string => void, closeModal: string => void,
@ -143,7 +142,7 @@ const INITIAL_STATE = {
class AddAccounts extends PureComponent<Props, State> { class AddAccounts extends PureComponent<Props, State> {
state = INITIAL_STATE state = INITIAL_STATE
STEPS = createSteps({ t: this.props.t }) STEPS = createSteps()
handleClickAdd = async () => { handleClickAdd = async () => {
const { addAccount } = this.props const { addAccount } = this.props
@ -205,7 +204,7 @@ class AddAccounts extends PureComponent<Props, State> {
} }
render() { render() {
const { t, device, existingAccounts } = this.props const { device, existingAccounts } = this.props
const { const {
stepId, stepId,
currency, currency,
@ -238,6 +237,7 @@ class AddAccounts extends PureComponent<Props, State> {
onGoStep1: this.onGoStep1, onGoStep1: this.onGoStep1,
editedNames, editedNames,
} }
const title = <Trans i18nKey="addAccounts.title" />
return ( return (
<Modal <Modal
@ -247,7 +247,7 @@ class AddAccounts extends PureComponent<Props, State> {
render={({ onClose }) => ( render={({ onClose }) => (
<Stepper <Stepper
key={reset} // THIS IS A HACK because stepper is not controllable. FIXME key={reset} // THIS IS A HACK because stepper is not controllable. FIXME
title={t('addAccounts.title')} title={title}
initialStepId="chooseCurrency" initialStepId="chooseCurrency"
onStepChange={this.handleStepChange} onStepChange={this.handleStepChange}
onClose={onClose} onClose={onClose}

14
src/components/modals/Receive/index.js

@ -3,7 +3,7 @@
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import { compose } from 'redux' import { compose } from 'redux'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { translate } from 'react-i18next' import { Trans, translate } from 'react-i18next'
import { createStructuredSelector } from 'reselect' import { createStructuredSelector } from 'reselect'
import SyncSkipUnderPriority from 'components/SyncSkipUnderPriority' import SyncSkipUnderPriority from 'components/SyncSkipUnderPriority'
@ -58,23 +58,23 @@ export type StepProps = DefaultStepProps & {
onChangeAddressVerified: (?boolean, ?Error) => void, onChangeAddressVerified: (?boolean, ?Error) => void,
} }
const createSteps = ({ t }: { t: T }) => [ const createSteps = () => [
{ {
id: 'account', id: 'account',
label: t('receive.steps.chooseAccount.title'), label: <Trans i18nKey="receive.steps.chooseAccount.title" />,
component: StepAccount, component: StepAccount,
footer: StepAccountFooter, footer: StepAccountFooter,
}, },
{ {
id: 'device', id: 'device',
label: t('receive.steps.connectDevice.title'), label: <Trans i18nKey="receive.steps.connectDevice.title" />,
component: StepConnectDevice, component: StepConnectDevice,
footer: StepConnectDeviceFooter, footer: StepConnectDeviceFooter,
onBack: ({ transitionTo }: StepProps) => transitionTo('account'), onBack: ({ transitionTo }: StepProps) => transitionTo('account'),
}, },
{ {
id: 'confirm', id: 'confirm',
label: t('receive.steps.confirmAddress.title'), label: <Trans i18nKey="receive.steps.confirmAddress.title" />,
footer: StepConfirmAddressFooter, footer: StepConfirmAddressFooter,
component: StepConfirmAddress, component: StepConfirmAddress,
onBack: ({ transitionTo }: StepProps) => transitionTo('device'), onBack: ({ transitionTo }: StepProps) => transitionTo('device'),
@ -82,7 +82,7 @@ const createSteps = ({ t }: { t: T }) => [
}, },
{ {
id: 'receive', id: 'receive',
label: t('receive.steps.receiveFunds.title'), label: <Trans i18nKey="receive.steps.receiveFunds.title" />,
component: StepReceiveFunds, component: StepReceiveFunds,
shouldPreventClose: ({ isAddressVerified }: StepProps) => isAddressVerified === null, shouldPreventClose: ({ isAddressVerified }: StepProps) => isAddressVerified === null,
}, },
@ -108,7 +108,7 @@ const INITIAL_STATE = {
class ReceiveModal extends PureComponent<Props, State> { class ReceiveModal extends PureComponent<Props, State> {
state = INITIAL_STATE state = INITIAL_STATE
STEPS = createSteps({ t: this.props.t }) STEPS = createSteps()
handleBeforeOpenModal = ({ data }) => { handleBeforeOpenModal = ({ data }) => {
const { account } = this.state const { account } = this.state

5
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 SelectAccount from 'components/SelectAccount'
import CurrencyDownStatusAlert from 'components/CurrencyDownStatusAlert' import CurrencyDownStatusAlert from 'components/CurrencyDownStatusAlert'
import { Trans } from 'react-i18next'
import type { StepProps } from '../index' import type { StepProps } from '../index'
export default function StepAccount({ t, account, onChangeAccount }: StepProps) { 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 ( return (
<Button disabled={!account} primary onClick={() => transitionTo('device')}> <Button disabled={!account} primary onClick={() => transitionTo('device')}>
{t('common.continue')} <Trans i18nKey="common.continue" />
</Button> </Button>
) )
} }

3
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 TrackPage from 'analytics/TrackPage'
import type { StepProps } from '../index' import type { StepProps } from '../index'
import { Trans } from 'react-i18next'
export default function StepConnectDevice({ account, onChangeAppOpened }: StepProps) { export default function StepConnectDevice({ account, onChangeAppOpened }: StepProps) {
return ( return (
@ -42,7 +43,7 @@ export function StepConnectDeviceFooter({
{t('receive.steps.connectDevice.withoutDevice')} {t('receive.steps.connectDevice.withoutDevice')}
</Button> </Button>
<Button disabled={!isAppOpened} primary onClick={() => transitionTo('confirm')}> <Button disabled={!isAppOpened} primary onClick={() => transitionTo('confirm')}>
{t('common.continue')} <Trans i18nKey="common.continue" />
</Button> </Button>
</Box> </Box>
) )

14
src/components/modals/Send/index.js

@ -4,7 +4,7 @@ import React, { PureComponent } from 'react'
import invariant from 'invariant' import invariant from 'invariant'
import { compose } from 'redux' import { compose } from 'redux'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { translate } from 'react-i18next' import {Trans, translate} from 'react-i18next'
import { createStructuredSelector } from 'reselect' import { createStructuredSelector } from 'reselect'
import type { Account, Operation } from '@ledgerhq/live-common/lib/types' import type { Account, Operation } from '@ledgerhq/live-common/lib/types'
@ -72,29 +72,29 @@ export type StepProps<Transaction> = DefaultStepProps & {
signTransaction: ({ transitionTo: string => void }) => void, signTransaction: ({ transitionTo: string => void }) => void,
} }
const createSteps = ({ t }: { t: T }) => [ const createSteps = () => [
{ {
id: 'amount', id: 'amount',
label: t('send.steps.amount.title'), label: <Trans i18nKey='send.steps.amount.title'/>,
component: StepAmount, component: StepAmount,
footer: StepAmountFooter, footer: StepAmountFooter,
}, },
{ {
id: 'device', id: 'device',
label: t('send.steps.connectDevice.title'), label: <Trans i18nKey='send.steps.connectDevice.title'/>,
component: StepConnectDevice, component: StepConnectDevice,
footer: StepConnectDeviceFooter, footer: StepConnectDeviceFooter,
onBack: ({ transitionTo }) => transitionTo('amount'), onBack: ({ transitionTo }) => transitionTo('amount'),
}, },
{ {
id: 'verification', id: 'verification',
label: t('send.steps.verification.title'), label: <Trans i18nKey='send.steps.verification.title'/>,
component: StepVerification, component: StepVerification,
shouldPreventClose: true, shouldPreventClose: true,
}, },
{ {
id: 'confirmation', id: 'confirmation',
label: t('send.steps.confirmation.title'), label: <Trans i18nKey='send.steps.confirmation.title'/>,
component: StepConfirmation, component: StepConfirmation,
footer: StepConfirmationFooter, footer: StepConfirmationFooter,
onBack: ({ transitionTo, onRetry }) => { onBack: ({ transitionTo, onRetry }) => {
@ -136,7 +136,7 @@ class SendModal extends PureComponent<Props, State<*>> {
} }
} }
STEPS = createSteps({ t: this.props.t }) STEPS = createSteps()
_signTransactionSub = null _signTransactionSub = null
_isUnmounted = false _isUnmounted = false

Loading…
Cancel
Save