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/Nav.jsx b/client/components/Nav.jsx index 4056607f..1aff3927 100644 --- a/client/components/Nav.jsx +++ b/client/components/Nav.jsx @@ -5,7 +5,7 @@ import { withRouter } from 'react-router'; import { Link } from 'react-router'; import classNames from 'classnames'; import { withTranslation } from 'react-i18next'; -import i18next from 'i18next'; +import { languageKeyToLabel } from '../i18n'; import * as IDEActions from '../modules/IDE/actions/ide'; import * as toastActions from '../modules/IDE/actions/toast'; import * as projectActions from '../modules/IDE/actions/project'; @@ -549,7 +549,7 @@ class Nav extends React.PureComponent { renderLanguageMenu(navDropdownState) { return ( - + ); } @@ -605,6 +605,7 @@ class Nav extends React.PureComponent { renderUnauthenticatedUserMenu(navDropdownState) { return (