Skip to content
Snippets Groups Projects
Commit 73d10e55 authored by chrisgarrity's avatar chrisgarrity
Browse files

Localize how-tos title

Another approach would be to have the title be part of what’s imported from `lib/libraries/decks/index.jsx`
parent a952c190
No related branches found
No related tags found
No related merge requests found
import bindAll from 'lodash.bindall';
import PropTypes from 'prop-types';
import React from 'react';
import {injectIntl, intlShape, defineMessages} from 'react-intl';
import decksLibraryContent from '../lib/libraries/decks/index.jsx';
......@@ -17,6 +18,14 @@ import {
activateDeck
} from '../reducers/cards';
const messages = defineMessages({
tipsLibraryTitle: {
defaultMessage: 'How-Tos',
description: 'Heading for the help/how-tos library',
id: 'gui.tipsLibrary.howtos'
}
});
class TipsLibrary extends React.PureComponent {
constructor (props) {
super(props);
......@@ -45,7 +54,7 @@ class TipsLibrary extends React.PureComponent {
<LibraryComponent
data={decksLibraryThumbnailData}
filterable={false}
title="How-Tos"
title={this.props.intl.formatMessage(messages.tipsLibraryTitle)}
visible={this.props.visible}
onItemSelected={this.handleItemSelect}
onRequestClose={this.props.onRequestClose}
......@@ -55,6 +64,7 @@ class TipsLibrary extends React.PureComponent {
}
TipsLibrary.propTypes = {
intl: intlShape.isRequired,
onActivateDeck: PropTypes.func.isRequired,
onRequestClose: PropTypes.func,
visible: PropTypes.bool
......@@ -69,7 +79,7 @@ const mapDispatchToProps = dispatch => ({
onRequestClose: () => dispatch(closeTipsLibrary())
});
export default connect(
export default injectIntl(connect(
mapStateToProps,
mapDispatchToProps
)(TipsLibrary);
)(TipsLibrary));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment