diff --git a/client/components/AddRemoveButton.jsx b/client/components/AddRemoveButton.jsx index 7350c177..ea600cf9 100644 --- a/client/components/AddRemoveButton.jsx +++ b/client/components/AddRemoveButton.jsx @@ -1,11 +1,13 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { withTranslation } from 'react-i18next'; + import AddIcon from '../images/plus.svg'; import RemoveIcon from '../images/minus.svg'; -const AddRemoveButton = ({ type, onClick }) => { - const alt = type === 'add' ? 'Add to collection' : 'Remove from collection'; +const AddRemoveButton = ({ type, onClick, t }) => { + const alt = type === 'add' ? t('AddRemoveButton.AltAddARIA') : t('AddRemoveButton.AltRemoveARIA'); const Icon = type === 'add' ? AddIcon : RemoveIcon; return ( @@ -22,6 +24,7 @@ const AddRemoveButton = ({ type, onClick }) => { AddRemoveButton.propTypes = { type: PropTypes.oneOf(['add', 'remove']).isRequired, onClick: PropTypes.func.isRequired, + t: PropTypes.func.isRequired }; -export default AddRemoveButton; +export default withTranslation()(AddRemoveButton); diff --git a/client/components/PreviewNav.jsx b/client/components/PreviewNav.jsx index 6a983e19..8c430050 100644 --- a/client/components/PreviewNav.jsx +++ b/client/components/PreviewNav.jsx @@ -1,22 +1,23 @@ import PropTypes from 'prop-types'; import React from 'react'; import { Link } from 'react-router'; +import { withTranslation } from 'react-i18next'; import LogoIcon from '../images/p5js-logo-small.svg'; import CodeIcon from '../images/code.svg'; -const PreviewNav = ({ owner, project }) => ( +const PreviewNav = ({ owner, project, t }) => (