Skip to content
Snippets Groups Projects
Unverified Commit 2a895635 authored by chrisgarrity's avatar chrisgarrity Committed by GitHub
Browse files

Merge pull request #3315 from apple502j/translate-record

Translate record modal
parents a00a5298 3c0d0752
No related branches found
No related tags found
No related merge requests found
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {defineMessages, injectIntl, intlShape} from 'react-intl';
import Box from '../box/box.jsx'; import Box from '../box/box.jsx';
import Meter from '../meter/meter.jsx'; import Meter from '../meter/meter.jsx';
import Waveform from '../waveform/waveform.jsx'; import Waveform from '../waveform/waveform.jsx';
...@@ -7,6 +8,29 @@ import Waveform from '../waveform/waveform.jsx'; ...@@ -7,6 +8,29 @@ import Waveform from '../waveform/waveform.jsx';
import styles from './record-modal.css'; import styles from './record-modal.css';
import stopIcon from './icon--stop-recording.svg'; import stopIcon from './icon--stop-recording.svg';
const messages = defineMessages({
beginRecord: {
defaultMessage: 'Begin recording by clicking the button below',
description: 'Message for recording sound modal',
id: 'gui.recordingStep.beginRecord'
},
permission: {
defaultMessage: '{arrow}We need your permission to use your microphone',
description: 'Permission required notice in recording sound modal. Do not translate {arrow}',
id: 'gui.recordingStep.permission'
},
stop: {
defaultMessage: 'Stop recording',
description: 'Stop recording button label',
id: 'gui.recordingStep.stop'
},
record: {
defaultMessage: 'Record',
description: 'Record button label',
id: 'gui.recordingStep.record'
}
});
const RecordingStep = props => ( const RecordingStep = props => (
<Box> <Box>
<Box className={styles.visualizationContainer}> <Box className={styles.visualizationContainer}>
...@@ -27,8 +51,11 @@ const RecordingStep = props => ( ...@@ -27,8 +51,11 @@ const RecordingStep = props => (
/> />
) : ( ) : (
<span className={styles.helpText}> <span className={styles.helpText}>
{props.listening ? 'Begin recording by clicking the button below' : {props.listening ? props.intl.formatMessage(messages.beginRecord) :
'↖️ \u00A0We need your permission to use your microphone'} props.intl.formatMessage(messages.permission,
{arrow: props.isRtl ? '↗️ \u00A0' : '↖️ \u00A0'}
)
}
</span> </span>
)} )}
</Box> </Box>
...@@ -66,7 +93,11 @@ const RecordingStep = props => ( ...@@ -66,7 +93,11 @@ const RecordingStep = props => (
)} )}
<div className={styles.helpText}> <div className={styles.helpText}>
<span className={styles.recordingText}> <span className={styles.recordingText}>
{props.recording ? 'Stop recording' : 'Record'} {
props.recording ?
props.intl.formatMessage(messages.stop) :
props.intl.formatMessage(messages.record)
}
</span> </span>
</div> </div>
</button> </button>
...@@ -75,6 +106,8 @@ const RecordingStep = props => ( ...@@ -75,6 +106,8 @@ const RecordingStep = props => (
); );
RecordingStep.propTypes = { RecordingStep.propTypes = {
intl: intlShape.isRequired,
isRtl: PropTypes.bool,
level: PropTypes.number, level: PropTypes.number,
levels: PropTypes.arrayOf(PropTypes.number), levels: PropTypes.arrayOf(PropTypes.number),
listening: PropTypes.bool, listening: PropTypes.bool,
...@@ -83,4 +116,4 @@ RecordingStep.propTypes = { ...@@ -83,4 +116,4 @@ RecordingStep.propTypes = {
recording: PropTypes.bool recording: PropTypes.bool
}; };
export default RecordingStep; export default injectIntl(RecordingStep);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment