diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 112dbd37f..6b3e9ea95 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -31,6 +31,7 @@ "ContentBlock.moveDown": "Move down", "ContentBlock.moveUp": "Move up", "ContentBlock.text": "text", + "Dialog.closeDialog": "Close dialog", "EmptyCenterPanel.no-content": "Add or select a board from the sidebar to get started.", "EmptyCenterPanel.workspace": "This is the workspace for:", "Filter.includes": "includes", diff --git a/webapp/src/components/dialog.tsx b/webapp/src/components/dialog.tsx index cf2e85d91..c90508dae 100644 --- a/webapp/src/components/dialog.tsx +++ b/webapp/src/components/dialog.tsx @@ -1,6 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react' +import {injectIntl, IntlShape} from 'react-intl' import IconButton from '../widgets/buttons/iconButton' import CloseIcon from '../widgets/icons/close' @@ -11,10 +12,11 @@ import './dialog.scss' type Props = { children: React.ReactNode toolsMenu: React.ReactNode - onClose: () => void + onClose: () => void, + intl: IntlShape } -export default class Dialog extends React.PureComponent { +class Dialog extends React.PureComponent { public componentDidMount(): void { document.addEventListener('keydown', this.keydownHandler) } @@ -35,7 +37,12 @@ export default class Dialog extends React.PureComponent { } public render(): JSX.Element { - const {toolsMenu} = this.props + const {toolsMenu, intl} = this.props + + const closeDialogText = intl.formatMessage({ + id: 'Dialog.closeDialog', + defaultMessage: 'Close dialog', + }) return (
{ } - title={'Close dialog'} + title={closeDialogText} className='IconButton--large' />
@@ -77,3 +84,5 @@ export default class Dialog extends React.PureComponent { this.props.onClose() } } + +export default injectIntl(Dialog)