Fixing translation behavior of download link labels

This commit is contained in:
Jeff Avallone 2018-06-01 17:59:24 -04:00
parent cda91cd3f5
commit 919612bc0d
3 changed files with 9 additions and 5 deletions

View File

@ -42,7 +42,7 @@ class App extends React.PureComponent {
this.setState({
svgUrl: {
url: URL.createObjectURL(blob),
label: this.props.t('Download SVG'),
label: 'Download SVG',
filename: 'image.svg',
type
}
@ -61,7 +61,7 @@ class App extends React.PureComponent {
this.setState({
pngUrl: {
url: URL.createObjectURL(blob),
label: this.props.t('Download PNG'),
label: 'Download PNG',
filename: 'image.png',
type
}

View File

@ -107,7 +107,9 @@ exports[`Form rendering with download URLs 1`] = `
type="image/svg+xml"
>
<SvgMock />
Download SVG
<Trans>
Download SVG
</Trans>
</a>
</li>
<li
@ -119,7 +121,9 @@ exports[`Form rendering with download URLs 1`] = `
type="image/png"
>
<SvgMock />
Download PNG
<Trans>
Download PNG
</Trans>
</a>
</li>
</ul>

View File

@ -66,7 +66,7 @@ class Form extends React.PureComponent {
return downloadUrls.map(({ url, filename, type, label }, i) => <li key={ i }>
<a href={ url } download={ filename } type={ type }>
<DownloadIcon/>{ label }
<DownloadIcon/><Trans>{ label }</Trans>
</a>
</li>);
}