From 58298518019e10603f61bc281de5bb605730e541 Mon Sep 17 00:00:00 2001 From: oruburos Date: Wed, 19 Aug 2020 18:42:56 +0100 Subject: [PATCH 01/10] AddRemoveButton Translation --- client/components/AddRemoveButton.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/components/AddRemoveButton.jsx b/client/components/AddRemoveButton.jsx index 7350c177e7..80e673bdda 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.altAdd') : t('AddRemoveButton.altRemove'); 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); From 62dca7d7f6179752def55b4bbf28a9ef892a22df Mon Sep 17 00:00:00 2001 From: oruburos Date: Thu, 20 Aug 2020 12:09:36 +0100 Subject: [PATCH 02/10] CopyableInput EditableInput translations.json --- client/modules/IDE/components/CopyableInput.jsx | 10 ++++++---- client/modules/IDE/components/EditableInput.jsx | 6 ++++-- translations/locales/en-US/translations.json | 7 +++++++ translations/locales/es-419/translations.json | 11 +++++++++++ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/client/modules/IDE/components/CopyableInput.jsx b/client/modules/IDE/components/CopyableInput.jsx index cbce2f3e93..e471a5e983 100644 --- a/client/modules/IDE/components/CopyableInput.jsx +++ b/client/modules/IDE/components/CopyableInput.jsx @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import Clipboard from 'clipboard'; import classNames from 'classnames'; +import { withTranslation } from 'react-i18next'; import ShareIcon from '../../../images/share.svg'; @@ -45,7 +46,7 @@ class CopyableInput extends React.Component {
{ this.tooltip = element; }} onMouseLeave={this.onMouseLeaveHandler} > @@ -69,7 +70,7 @@ class CopyableInput extends React.Component { rel="noopener noreferrer" href={value} className="copyable-input__preview" - aria-label={`Open ${label} view in new tab`} + aria-label={this.props.t('CopyableInput.CopiedARIA', { label })} >