Browse Source

i18n

master
Thibaut Boustany 7 years ago
parent
commit
378b6119fb
No known key found for this signature in database GPG Key ID: 32475B11A2B13EEC
  1. 18
      src/components/modals/ReleaseNotes.js
  2. 3
      static/i18n/en/releaseNotes.yml

18
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<Props, *> {
render() {
const { t } = this.props
const renderBody = ({ data, onClose }) => {
const { name, body: markdown } = data
return (
<ModalBody onClose={onClose}>
<ModalTitle>Release Notes</ModalTitle>
<ModalTitle>{t('releaseNotes:title')}</ModalTitle>
<ModalContent>
<Notes>
<Title>Version {name}</Title>
<Title>{t('releaseNotes:version', { versionNb: name })}</Title>
<ReactMarkdown>{markdown}</ReactMarkdown>
</Notes>
</ModalContent>
<ModalFooter horizontal justifyContent="flex-end">
<Button onClick={onClose} primary>
Continue
{t('common:continue')}
</Button>
</ModalFooter>
</ModalBody>
@ -161,4 +169,4 @@ class ReleaseNotes extends PureComponent<*, *> {
}
}
export default ReleaseNotes
export default translate()(ReleaseNotes)

3
static/i18n/en/releaseNotes.yml

@ -0,0 +1,3 @@
title: Release notes
version: Version {{versionNb}}
Loading…
Cancel
Save