diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-02-03 07:37:27 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-02-03 07:37:27 -0500 |
commit | 0571953755bb96b3d1c15279e2fb429a3ec993a5 (patch) | |
tree | bea9b56e174067ce3d8239702fc2d38f3b0d188c /web/react/components/delete_channel_modal.jsx | |
parent | 5be7d002300afcf1e06cf9878d81f567b4bd9845 (diff) | |
parent | d424c9eaf12653332f15afa2cb9dfc6684fa95d8 (diff) | |
download | chat-0571953755bb96b3d1c15279e2fb429a3ec993a5.tar.gz chat-0571953755bb96b3d1c15279e2fb429a3ec993a5.tar.bz2 chat-0571953755bb96b3d1c15279e2fb429a3ec993a5.zip |
Merge pull request #2051 from ZBoxApp/PLT-7-channel-modals
PLT-7: Refactoring frontend (chunk 10)
Diffstat (limited to 'web/react/components/delete_channel_modal.jsx')
-rw-r--r-- | web/react/components/delete_channel_modal.jsx | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/web/react/components/delete_channel_modal.jsx b/web/react/components/delete_channel_modal.jsx index 1255067fd..d9113bc9f 100644 --- a/web/react/components/delete_channel_modal.jsx +++ b/web/react/components/delete_channel_modal.jsx @@ -5,7 +5,9 @@ import * as AsyncClient from '../utils/async_client.jsx'; import * as Client from '../utils/client.jsx'; const Modal = ReactBootstrap.Modal; import TeamStore from '../stores/team_store.jsx'; -import * as Utils from '../utils/utils.jsx'; +import Constants from '../utils/constants.jsx'; + +import {FormattedMessage} from 'mm-intl'; export default class DeleteChannelModal extends React.Component { constructor(props) { @@ -32,7 +34,20 @@ export default class DeleteChannelModal extends React.Component { } render() { - const channelTerm = Utils.getChannelTerm(this.props.channel.type).toLowerCase(); + let channelTerm = ( + <FormattedMessage + id='delete_channel.channel' + defaultMessage='channel' + /> + ); + if (this.props.channel.type === Constants.PRIVATE_CHANNEL) { + channelTerm = ( + <FormattedMessage + id='delete_channel.group' + defaultMessage='group' + /> + ); + } return ( <Modal @@ -40,10 +55,22 @@ export default class DeleteChannelModal extends React.Component { onHide={this.props.onHide} > <Modal.Header closeButton={true}> - <h4 className='modal-title'>{'Confirm DELETE Channel'}</h4> + <h4 className='modal-title'> + <FormattedMessage + id='delete_channel.confirm' + defaultMessage='Confirm DELETE Channel' + /> + </h4> </Modal.Header> <Modal.Body> - {`Are you sure you wish to delete the ${this.props.channel.display_name} ${channelTerm}?`} + <FormattedMessage + id='delete_channel.question' + defaultMessage='Are you sure you wish to delete the {display_name} {term}?' + values={{ + display_name: this.props.channel.display_name, + term: (channelTerm) + }} + /> </Modal.Body> <Modal.Footer> <button @@ -51,7 +78,10 @@ export default class DeleteChannelModal extends React.Component { className='btn btn-default' onClick={this.props.onHide} > - {'Cancel'} + <FormattedMessage + id='delete_channel.cancel' + defaultMessage='Cancel' + /> </button> <button type='button' @@ -59,7 +89,10 @@ export default class DeleteChannelModal extends React.Component { data-dismiss='modal' onClick={this.handleDelete} > - {'Delete'} + <FormattedMessage + id='delete_channel.del' + defaultMessage='Delete' + /> </button> </Modal.Footer> </Modal> |