From 22400d97f5b85fa7e20721df73dba5dff0f57ad4 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 21 Mar 2019 16:07:17 +0100 Subject: add i18n messages for service loading and workspace switching --- .../workspaces/components/WorkspaceSwitchingIndicator.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/features/workspaces') diff --git a/src/features/workspaces/components/WorkspaceSwitchingIndicator.js b/src/features/workspaces/components/WorkspaceSwitchingIndicator.js index f68ac1b00..68ce6fd87 100644 --- a/src/features/workspaces/components/WorkspaceSwitchingIndicator.js +++ b/src/features/workspaces/components/WorkspaceSwitchingIndicator.js @@ -3,9 +3,18 @@ import PropTypes from 'prop-types'; import { observer } from 'mobx-react'; import injectSheet from 'react-jss'; import classnames from 'classnames'; +import { defineMessages, intlShape } from 'react-intl'; + import { workspacesState } from '../state'; import LoaderComponent from '../../../components/ui/Loader'; +const messages = defineMessages({ + switchingTo: { + id: 'workspaces.switchingIndicator.switchingTo', + defaultMessage: '!!!Switching to', + }, +}); + const styles = theme => ({ wrapper: { display: 'flex', @@ -40,8 +49,13 @@ class WorkspaceSwitchingIndicator extends Component { classes: PropTypes.object.isRequired, }; + static contextTypes = { + intl: intlShape, + }; + render() { const { classes } = this.props; + const { intl } = this.context; const { isSwitchingWorkspace, isWorkspaceDrawerOpen, nextWorkspace } = workspacesState; if (!isSwitchingWorkspace) return null; const nextWorkspaceName = nextWorkspace ? nextWorkspace.name : 'All services'; @@ -54,7 +68,7 @@ class WorkspaceSwitchingIndicator extends Component { >

- {`Switching to ${nextWorkspaceName}`} + {`${intl.formatMessage(messages.switchingTo)} ${nextWorkspaceName}`}

-- cgit v1.2.3-70-g09d2