From 378b6119fb6926a2aa82d72ce239cfab95b7bad2 Mon Sep 17 00:00:00 2001 From: Thibaut Boustany Date: Tue, 12 Jun 2018 16:48:17 +0200 Subject: [PATCH] i18n --- src/components/modals/ReleaseNotes.js | 18 +++++++++++++----- static/i18n/en/releaseNotes.yml | 3 +++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 static/i18n/en/releaseNotes.yml diff --git a/src/components/modals/ReleaseNotes.js b/src/components/modals/ReleaseNotes.js index 249d1c77..57d7ac2f 100644 --- a/src/components/modals/ReleaseNotes.js +++ b/src/components/modals/ReleaseNotes.js @@ -1,5 +1,6 @@ // @flow import React, { PureComponent } from 'react' +import { translate } from 'react-i18next' import ReactMarkdown from 'react-markdown' import styled from 'styled-components' @@ -10,6 +11,12 @@ import Button from 'components/base/Button' import Box from 'components/base/Box' import Text from 'components/base/Text' +import type { T } from 'types/common' + +type Props = { + t: T, +} + const Notes = styled(Box).attrs({ ff: 'Open Sans', fontSize: 4, @@ -134,23 +141,24 @@ const Title = styled(Text).attrs({ color: 'dark', })`` -class ReleaseNotes extends PureComponent<*, *> { +class ReleaseNotes extends PureComponent { render() { + const { t } = this.props const renderBody = ({ data, onClose }) => { const { name, body: markdown } = data return ( - Release Notes + {t('releaseNotes:title')} - Version {name} + {t('releaseNotes:version', { versionNb: name })} {markdown} @@ -161,4 +169,4 @@ class ReleaseNotes extends PureComponent<*, *> { } } -export default ReleaseNotes +export default translate()(ReleaseNotes) diff --git a/static/i18n/en/releaseNotes.yml b/static/i18n/en/releaseNotes.yml new file mode 100644 index 00000000..f5cb99de --- /dev/null +++ b/static/i18n/en/releaseNotes.yml @@ -0,0 +1,3 @@ +title: Release notes + +version: Version {{versionNb}}