From f918669116d49772d6acc7fac528f252ef20e944 Mon Sep 17 00:00:00 2001 From: ov Date: Wed, 26 Aug 2020 16:28:53 +0100 Subject: [PATCH] Spanish Translation: Copyable/Editable/AddRemove/SearchBar/PreviewNav (#1569) * AddRemoveButton Translation * CopyableInput EditableInput translations.json * Translation in PreviewNav.jsx * Translation in Feedback.jsx * Translation in AssetList.jsx * Translation in SearchBarComponent * Translations.json merged * Translations.json AddRemoved, feedback and Preview Nav --- client/components/AddRemoveButton.jsx | 9 +++-- client/components/PreviewNav.jsx | 12 +++--- client/modules/IDE/components/AssetList.jsx | 27 +++++++------ .../modules/IDE/components/CopyableInput.jsx | 10 +++-- .../modules/IDE/components/EditableInput.jsx | 11 +++-- client/modules/IDE/components/Feedback.jsx | 5 ++- .../IDE/components/Searchbar/Collection.jsx | 4 +- .../IDE/components/Searchbar/Searchbar.jsx | 11 +++-- .../IDE/components/Searchbar/Sketch.jsx | 2 + translations/locales/en-US/translations.json | 40 +++++++++++++++++++ translations/locales/es-419/translations.json | 40 +++++++++++++++++++ 11 files changed, 136 insertions(+), 35 deletions(-) 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 }) => (