Browse Source

Add translations to manager page

master
meriadec 7 years ago
parent
commit
c7143cd31d
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 9
      src/components/ManagerPage/AppsList.js
  2. 12
      src/components/ManagerPage/ManagerApp.js
  3. 2
      static/i18n/en/manager.yml

9
src/components/ManagerPage/AppsList.js

@ -2,13 +2,14 @@
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import { translate } from 'react-i18next'
import { runJob } from 'renderer/events' import { runJob } from 'renderer/events'
import Box from 'components/base/Box' import Box from 'components/base/Box'
import Modal, { ModalBody } from 'components/base/Modal' import Modal, { ModalBody } from 'components/base/Modal'
import type { Device } from 'types/common' import type { Device, T } from 'types/common'
import ManagerApp from './ManagerApp' import ManagerApp from './ManagerApp'
@ -42,6 +43,7 @@ type LedgerApp = {
type Props = { type Props = {
device: Device, device: Device,
t: T,
} }
type State = { type State = {
@ -152,11 +154,12 @@ class AppsList extends PureComponent<Props, State> {
} }
render() { render() {
const { t } = this.props
return ( return (
<Box flow={6}> <Box flow={6}>
<Box> <Box>
<Box mb={4} color="dark" ff="Museo Sans" fontSize={6}> <Box mb={4} color="dark" ff="Museo Sans" fontSize={6}>
{'All apps'} {t('manager:allApps')}
</Box> </Box>
{this.renderList()} {this.renderList()}
</Box> </Box>
@ -165,4 +168,4 @@ class AppsList extends PureComponent<Props, State> {
} }
} }
export default AppsList export default translate()(AppsList)

12
src/components/ManagerPage/ManagerApp.js

@ -2,6 +2,9 @@
import React from 'react' import React from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import { translate } from 'react-i18next'
import type { T } from 'types/common'
import Box from 'components/base/Box' import Box from 'components/base/Box'
import Text from 'components/base/Text' import Text from 'components/base/Text'
@ -40,6 +43,7 @@ const AppName = styled(Box).attrs({
` `
type Props = { type Props = {
t: T,
name: string, name: string,
version: string, version: string,
icon: string, icon: string,
@ -47,8 +51,8 @@ type Props = {
// onUninstall: Function, // onUninstall: Function,
} }
export default function ManagerApp(props: Props) { function ManagerApp(props: Props) {
const { name, version, icon, onInstall } = props const { name, version, icon, onInstall, t } = props
const iconUrl = `https://api.ledgerwallet.com/update/assets/icons/${icon}` const iconUrl = `https://api.ledgerwallet.com/update/assets/icons/${icon}`
return ( return (
<Container> <Container>
@ -60,8 +64,10 @@ export default function ManagerApp(props: Props) {
</Text> </Text>
</Box> </Box>
<Button outline onClick={onInstall}> <Button outline onClick={onInstall}>
{'Install'} {t('manager:install')}
</Button> </Button>
</Container> </Container>
) )
} }
export default translate()(ManagerApp)

2
static/i18n/en/manager.yml

@ -1,3 +1,5 @@
tabs: tabs:
apps: Apps apps: Apps
device: My device device: My device
install: Install
allApps: All apps

Loading…
Cancel
Save