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 // @flow
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import { translate } from 'react-i18next'
import ReactMarkdown from 'react-markdown' import ReactMarkdown from 'react-markdown'
import styled from 'styled-components' import styled from 'styled-components'
@ -10,6 +11,12 @@ import Button from 'components/base/Button'
import Box from 'components/base/Box' import Box from 'components/base/Box'
import Text from 'components/base/Text' import Text from 'components/base/Text'
import type { T } from 'types/common'
type Props = {
t: T,
}
const Notes = styled(Box).attrs({ const Notes = styled(Box).attrs({
ff: 'Open Sans', ff: 'Open Sans',
fontSize: 4, fontSize: 4,
@ -134,23 +141,24 @@ const Title = styled(Text).attrs({
color: 'dark', color: 'dark',
})`` })``
class ReleaseNotes extends PureComponent<*, *> { class ReleaseNotes extends PureComponent<Props, *> {
render() { render() {
const { t } = this.props
const renderBody = ({ data, onClose }) => { const renderBody = ({ data, onClose }) => {
const { name, body: markdown } = data const { name, body: markdown } = data
return ( return (
<ModalBody onClose={onClose}> <ModalBody onClose={onClose}>
<ModalTitle>Release Notes</ModalTitle> <ModalTitle>{t('releaseNotes:title')}</ModalTitle>
<ModalContent> <ModalContent>
<Notes> <Notes>
<Title>Version {name}</Title> <Title>{t('releaseNotes:version', { versionNb: name })}</Title>
<ReactMarkdown>{markdown}</ReactMarkdown> <ReactMarkdown>{markdown}</ReactMarkdown>
</Notes> </Notes>
</ModalContent> </ModalContent>
<ModalFooter horizontal justifyContent="flex-end"> <ModalFooter horizontal justifyContent="flex-end">
<Button onClick={onClose} primary> <Button onClick={onClose} primary>
Continue {t('common:continue')}
</Button> </Button>
</ModalFooter> </ModalFooter>
</ModalBody> </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