From a7b07cd45074b89f588006c2c0b08ab94aeb5688 Mon Sep 17 00:00:00 2001 From: chrisgarrity Date: Tue, 17 Jul 2018 08:50:04 -0400 Subject: [PATCH] Localize custom procedure modal title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added localization for ‘Make a Block’ * ‘block name’ default text is in scratch-blocks The changes in `error-step.jsx` were needed because the same id was defined in there and `unavailable_step.jsx`. The scripts to generate the json file for Transifex give an error if the same id is defined in two places. In error step it simply uses the id without redefining default value etc. The alternative would be to add a new messages.jsx file that has the definitions for shared text and include that in both places that use them. --- src/components/connection-modal/error-step.jsx | 4 ---- .../custom-procedures/custom-procedures.jsx | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/connection-modal/error-step.jsx b/src/components/connection-modal/error-step.jsx index 681d74b72..9f491aab9 100644 --- a/src/components/connection-modal/error-step.jsx +++ b/src/components/connection-modal/error-step.jsx @@ -43,8 +43,6 @@ const ErrorStep = props => ( src={backIcon} /> @@ -57,8 +55,6 @@ const ErrorStep = props => ( src={helpIcon} /> diff --git a/src/components/custom-procedures/custom-procedures.jsx b/src/components/custom-procedures/custom-procedures.jsx index 08131ea5b..81756e762 100644 --- a/src/components/custom-procedures/custom-procedures.jsx +++ b/src/components/custom-procedures/custom-procedures.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import Modal from '../modal/modal.jsx'; import Box from '../box/box.jsx'; -import {FormattedMessage} from 'react-intl'; +import {defineMessages, injectIntl, intlShape, FormattedMessage} from 'react-intl'; import booleanInputIcon from './icon--boolean-input.svg'; import textInputIcon from './icon--text-input.svg'; @@ -10,10 +10,18 @@ import labelIcon from './icon--label.svg'; import styles from './custom-procedures.css'; +const messages = defineMessages({ + myblockModalTitle: { + defaultMessage: 'Make a Block', + description: 'Title for the modal where you create a custom block.', + id: 'gui.customProcedures.myblockModalTitle' + } +}); + const CustomProcedures = props => ( ( CustomProcedures.propTypes = { componentRef: PropTypes.func.isRequired, + intl: intlShape, onAddBoolean: PropTypes.func.isRequired, onAddLabel: PropTypes.func.isRequired, onAddTextNumber: PropTypes.func.isRequired, @@ -142,4 +151,4 @@ CustomProcedures.propTypes = { warp: PropTypes.bool.isRequired }; -export default CustomProcedures; +export default injectIntl(CustomProcedures);