From c7143cd31d448037f4ced5f34c3277b7aed9fc8d Mon Sep 17 00:00:00 2001 From: meriadec Date: Fri, 13 Apr 2018 11:47:16 +0200 Subject: [PATCH] Add translations to manager page --- src/components/ManagerPage/AppsList.js | 9 ++++++--- src/components/ManagerPage/ManagerApp.js | 12 +++++++++--- static/i18n/en/manager.yml | 2 ++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/components/ManagerPage/AppsList.js b/src/components/ManagerPage/AppsList.js index a4179c81..eb25dca4 100644 --- a/src/components/ManagerPage/AppsList.js +++ b/src/components/ManagerPage/AppsList.js @@ -2,13 +2,14 @@ import React, { PureComponent } from 'react' import styled from 'styled-components' +import { translate } from 'react-i18next' import { runJob } from 'renderer/events' import Box from 'components/base/Box' import Modal, { ModalBody } from 'components/base/Modal' -import type { Device } from 'types/common' +import type { Device, T } from 'types/common' import ManagerApp from './ManagerApp' @@ -42,6 +43,7 @@ type LedgerApp = { type Props = { device: Device, + t: T, } type State = { @@ -152,11 +154,12 @@ class AppsList extends PureComponent { } render() { + const { t } = this.props return ( - {'All apps'} + {t('manager:allApps')} {this.renderList()} @@ -165,4 +168,4 @@ class AppsList extends PureComponent { } } -export default AppsList +export default translate()(AppsList) diff --git a/src/components/ManagerPage/ManagerApp.js b/src/components/ManagerPage/ManagerApp.js index 69cadf47..d4680a5c 100644 --- a/src/components/ManagerPage/ManagerApp.js +++ b/src/components/ManagerPage/ManagerApp.js @@ -2,6 +2,9 @@ import React from 'react' import styled from 'styled-components' +import { translate } from 'react-i18next' + +import type { T } from 'types/common' import Box from 'components/base/Box' import Text from 'components/base/Text' @@ -40,6 +43,7 @@ const AppName = styled(Box).attrs({ ` type Props = { + t: T, name: string, version: string, icon: string, @@ -47,8 +51,8 @@ type Props = { // onUninstall: Function, } -export default function ManagerApp(props: Props) { - const { name, version, icon, onInstall } = props +function ManagerApp(props: Props) { + const { name, version, icon, onInstall, t } = props const iconUrl = `https://api.ledgerwallet.com/update/assets/icons/${icon}` return ( @@ -60,8 +64,10 @@ export default function ManagerApp(props: Props) { ) } + +export default translate()(ManagerApp) diff --git a/static/i18n/en/manager.yml b/static/i18n/en/manager.yml index 1ebabc12..49396b36 100644 --- a/static/i18n/en/manager.yml +++ b/static/i18n/en/manager.yml @@ -1,3 +1,5 @@ tabs: apps: Apps device: My device +install: Install +allApps: All apps