Merge pull request #2650 from chrisgarrity/issue/2535-myblock-missing-string

Localize custom procedure modal title - per discussion, the changes to error-step are intended to avoid `i18n:src` errors
This commit is contained in:
chrisgarrity authored and GitHub committed 2018-07-17 15:44:35 -04:00
commit 374bbcfef4
2 files changed
+12 -7

No files matched your search

@@ -43,8 +43,6 @@ const ErrorStep = props => (
src={backIcon}
/>
<FormattedMessage
defaultMessage="Try again"
description="Button to initiate trying the device connection again after an error"
id="gui.connection.tryagainbutton"
/>
</button>
@@ -57,8 +55,6 @@ const ErrorStep = props => (
src={helpIcon}
/>
<FormattedMessage
defaultMessage="Help"
description="Button to view help content"
id="gui.connection.helpbutton"
/>
</button>
@@ -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 => (
<Modal
className={styles.modalContent}
contentLabel="Make a Block"
contentLabel={props.intl.formatMessage(messages.myblockModalTitle)}
onRequestClose={props.onCancel}
>
<Box
@@ -133,6 +141,7 @@ 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);