diff options
author | Dominik Guzei <dominik.guzei@gmail.com> | 2019-03-21 16:07:17 +0100 |
---|---|---|
committer | Dominik Guzei <dominik.guzei@gmail.com> | 2019-03-21 16:08:11 +0100 |
commit | 22400d97f5b85fa7e20721df73dba5dff0f57ad4 (patch) | |
tree | 49318b57189359ea53bf450cda130bb9f767907f /src | |
parent | improve workspace drawer layout (diff) | |
download | ferdium-app-22400d97f5b85fa7e20721df73dba5dff0f57ad4.tar.gz ferdium-app-22400d97f5b85fa7e20721df73dba5dff0f57ad4.tar.zst ferdium-app-22400d97f5b85fa7e20721df73dba5dff0f57ad4.zip |
add i18n messages for service loading and workspace switching
Diffstat (limited to 'src')
-rw-r--r-- | src/components/layout/AppLayout.js | 1 | ||||
-rw-r--r-- | src/components/ui/WebviewLoader/index.js | 16 | ||||
-rw-r--r-- | src/features/workspaces/components/WorkspaceSwitchingIndicator.js | 16 | ||||
-rw-r--r-- | src/i18n/locales/defaultMessages.json | 60 | ||||
-rw-r--r-- | src/i18n/locales/en-US.json | 6 | ||||
-rw-r--r-- | src/i18n/messages/src/components/layout/AppLayout.json | 24 | ||||
-rw-r--r-- | src/i18n/messages/src/components/ui/WebviewLoader/index.json | 15 | ||||
-rw-r--r-- | src/i18n/messages/src/features/workspaces/components/WorkspaceSwitchingIndicator.json | 15 |
8 files changed, 123 insertions, 30 deletions
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 4e897e623..4dd5ff686 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -15,7 +15,6 @@ import ErrorBoundary from '../util/ErrorBoundary'; | |||
15 | 15 | ||
16 | import { isWindows } from '../../environment'; | 16 | import { isWindows } from '../../environment'; |
17 | import { workspacesState } from '../../features/workspaces/state'; | 17 | import { workspacesState } from '../../features/workspaces/state'; |
18 | import FullscreenLoader from '../ui/FullscreenLoader'; | ||
19 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; | 18 | import WorkspaceSwitchingIndicator from '../../features/workspaces/components/WorkspaceSwitchingIndicator'; |
20 | 19 | ||
21 | function createMarkup(HTMLString) { | 20 | function createMarkup(HTMLString) { |
diff --git a/src/components/ui/WebviewLoader/index.js b/src/components/ui/WebviewLoader/index.js index d200b8193..58b6b6f1b 100644 --- a/src/components/ui/WebviewLoader/index.js +++ b/src/components/ui/WebviewLoader/index.js | |||
@@ -2,23 +2,35 @@ import React, { Component } from 'react'; | |||
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import injectSheet from 'react-jss'; | 4 | import injectSheet from 'react-jss'; |
5 | import { defineMessages, intlShape } from 'react-intl'; | ||
5 | 6 | ||
6 | import FullscreenLoader from '../FullscreenLoader'; | 7 | import FullscreenLoader from '../FullscreenLoader'; |
7 | |||
8 | import styles from './styles'; | 8 | import styles from './styles'; |
9 | 9 | ||
10 | const messages = defineMessages({ | ||
11 | loading: { | ||
12 | id: 'service.webviewLoader.loading', | ||
13 | defaultMessage: '!!!Loading', | ||
14 | }, | ||
15 | }); | ||
16 | |||
10 | export default @observer @injectSheet(styles) class WebviewLoader extends Component { | 17 | export default @observer @injectSheet(styles) class WebviewLoader extends Component { |
11 | static propTypes = { | 18 | static propTypes = { |
12 | name: PropTypes.string.isRequired, | 19 | name: PropTypes.string.isRequired, |
13 | classes: PropTypes.object.isRequired, | 20 | classes: PropTypes.object.isRequired, |
14 | }; | 21 | }; |
15 | 22 | ||
23 | static contextTypes = { | ||
24 | intl: intlShape, | ||
25 | }; | ||
26 | |||
16 | render() { | 27 | render() { |
17 | const { classes, name } = this.props; | 28 | const { classes, name } = this.props; |
29 | const { intl } = this.context; | ||
18 | return ( | 30 | return ( |
19 | <FullscreenLoader | 31 | <FullscreenLoader |
20 | className={classes.component} | 32 | className={classes.component} |
21 | title={`Loading ${name}`} | 33 | title={`${intl.formatMessage(messages.loading)} ${name}`} |
22 | /> | 34 | /> |
23 | ); | 35 | ); |
24 | } | 36 | } |
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'; | |||
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import injectSheet from 'react-jss'; | 4 | import injectSheet from 'react-jss'; |
5 | import classnames from 'classnames'; | 5 | import classnames from 'classnames'; |
6 | import { defineMessages, intlShape } from 'react-intl'; | ||
7 | |||
6 | import { workspacesState } from '../state'; | 8 | import { workspacesState } from '../state'; |
7 | import LoaderComponent from '../../../components/ui/Loader'; | 9 | import LoaderComponent from '../../../components/ui/Loader'; |
8 | 10 | ||
11 | const messages = defineMessages({ | ||
12 | switchingTo: { | ||
13 | id: 'workspaces.switchingIndicator.switchingTo', | ||
14 | defaultMessage: '!!!Switching to', | ||
15 | }, | ||
16 | }); | ||
17 | |||
9 | const styles = theme => ({ | 18 | const styles = theme => ({ |
10 | wrapper: { | 19 | wrapper: { |
11 | display: 'flex', | 20 | display: 'flex', |
@@ -40,8 +49,13 @@ class WorkspaceSwitchingIndicator extends Component { | |||
40 | classes: PropTypes.object.isRequired, | 49 | classes: PropTypes.object.isRequired, |
41 | }; | 50 | }; |
42 | 51 | ||
52 | static contextTypes = { | ||
53 | intl: intlShape, | ||
54 | }; | ||
55 | |||
43 | render() { | 56 | render() { |
44 | const { classes } = this.props; | 57 | const { classes } = this.props; |
58 | const { intl } = this.context; | ||
45 | const { isSwitchingWorkspace, isWorkspaceDrawerOpen, nextWorkspace } = workspacesState; | 59 | const { isSwitchingWorkspace, isWorkspaceDrawerOpen, nextWorkspace } = workspacesState; |
46 | if (!isSwitchingWorkspace) return null; | 60 | if (!isSwitchingWorkspace) return null; |
47 | const nextWorkspaceName = nextWorkspace ? nextWorkspace.name : 'All services'; | 61 | const nextWorkspaceName = nextWorkspace ? nextWorkspace.name : 'All services'; |
@@ -54,7 +68,7 @@ class WorkspaceSwitchingIndicator extends Component { | |||
54 | > | 68 | > |
55 | <div className={classes.component}> | 69 | <div className={classes.component}> |
56 | <h1 className={classes.name}> | 70 | <h1 className={classes.name}> |
57 | {`Switching to ${nextWorkspaceName}`} | 71 | {`${intl.formatMessage(messages.switchingTo)} ${nextWorkspaceName}`} |
58 | </h1> | 72 | </h1> |
59 | <LoaderComponent /> | 73 | <LoaderComponent /> |
60 | </div> | 74 | </div> |
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 1c6c6c969..9171c3592 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json | |||
@@ -625,78 +625,78 @@ | |||
625 | "defaultMessage": "!!!Your services have been updated.", | 625 | "defaultMessage": "!!!Your services have been updated.", |
626 | "end": { | 626 | "end": { |
627 | "column": 3, | 627 | "column": 3, |
628 | "line": 27 | 628 | "line": 28 |
629 | }, | 629 | }, |
630 | "file": "src/components/layout/AppLayout.js", | 630 | "file": "src/components/layout/AppLayout.js", |
631 | "id": "infobar.servicesUpdated", | 631 | "id": "infobar.servicesUpdated", |
632 | "start": { | 632 | "start": { |
633 | "column": 19, | 633 | "column": 19, |
634 | "line": 24 | 634 | "line": 25 |
635 | } | 635 | } |
636 | }, | 636 | }, |
637 | { | 637 | { |
638 | "defaultMessage": "!!!A new update for Franz is available.", | 638 | "defaultMessage": "!!!A new update for Franz is available.", |
639 | "end": { | 639 | "end": { |
640 | "column": 3, | 640 | "column": 3, |
641 | "line": 31 | 641 | "line": 32 |
642 | }, | 642 | }, |
643 | "file": "src/components/layout/AppLayout.js", | 643 | "file": "src/components/layout/AppLayout.js", |
644 | "id": "infobar.updateAvailable", | 644 | "id": "infobar.updateAvailable", |
645 | "start": { | 645 | "start": { |
646 | "column": 19, | 646 | "column": 19, |
647 | "line": 28 | 647 | "line": 29 |
648 | } | 648 | } |
649 | }, | 649 | }, |
650 | { | 650 | { |
651 | "defaultMessage": "!!!Reload services", | 651 | "defaultMessage": "!!!Reload services", |
652 | "end": { | 652 | "end": { |
653 | "column": 3, | 653 | "column": 3, |
654 | "line": 35 | 654 | "line": 36 |
655 | }, | 655 | }, |
656 | "file": "src/components/layout/AppLayout.js", | 656 | "file": "src/components/layout/AppLayout.js", |
657 | "id": "infobar.buttonReloadServices", | 657 | "id": "infobar.buttonReloadServices", |
658 | "start": { | 658 | "start": { |
659 | "column": 24, | 659 | "column": 24, |
660 | "line": 32 | 660 | "line": 33 |
661 | } | 661 | } |
662 | }, | 662 | }, |
663 | { | 663 | { |
664 | "defaultMessage": "!!!Changelog", | 664 | "defaultMessage": "!!!Changelog", |
665 | "end": { | 665 | "end": { |
666 | "column": 3, | 666 | "column": 3, |
667 | "line": 39 | 667 | "line": 40 |
668 | }, | 668 | }, |
669 | "file": "src/components/layout/AppLayout.js", | 669 | "file": "src/components/layout/AppLayout.js", |
670 | "id": "infobar.buttonChangelog", | 670 | "id": "infobar.buttonChangelog", |
671 | "start": { | 671 | "start": { |
672 | "column": 13, | 672 | "column": 13, |
673 | "line": 36 | 673 | "line": 37 |
674 | } | 674 | } |
675 | }, | 675 | }, |
676 | { | 676 | { |
677 | "defaultMessage": "!!!Restart & install update", | 677 | "defaultMessage": "!!!Restart & install update", |
678 | "end": { | 678 | "end": { |
679 | "column": 3, | 679 | "column": 3, |
680 | "line": 43 | 680 | "line": 44 |
681 | }, | 681 | }, |
682 | "file": "src/components/layout/AppLayout.js", | 682 | "file": "src/components/layout/AppLayout.js", |
683 | "id": "infobar.buttonInstallUpdate", | 683 | "id": "infobar.buttonInstallUpdate", |
684 | "start": { | 684 | "start": { |
685 | "column": 23, | 685 | "column": 23, |
686 | "line": 40 | 686 | "line": 41 |
687 | } | 687 | } |
688 | }, | 688 | }, |
689 | { | 689 | { |
690 | "defaultMessage": "!!!Could not load services and user information", | 690 | "defaultMessage": "!!!Could not load services and user information", |
691 | "end": { | 691 | "end": { |
692 | "column": 3, | 692 | "column": 3, |
693 | "line": 47 | 693 | "line": 48 |
694 | }, | 694 | }, |
695 | "file": "src/components/layout/AppLayout.js", | 695 | "file": "src/components/layout/AppLayout.js", |
696 | "id": "infobar.requiredRequestsFailed", | 696 | "id": "infobar.requiredRequestsFailed", |
697 | "start": { | 697 | "start": { |
698 | "column": 26, | 698 | "column": 26, |
699 | "line": 44 | 699 | "line": 45 |
700 | } | 700 | } |
701 | } | 701 | } |
702 | ], | 702 | ], |
@@ -2550,6 +2550,24 @@ | |||
2550 | { | 2550 | { |
2551 | "descriptors": [ | 2551 | "descriptors": [ |
2552 | { | 2552 | { |
2553 | "defaultMessage": "!!!Loading", | ||
2554 | "end": { | ||
2555 | "column": 3, | ||
2556 | "line": 14 | ||
2557 | }, | ||
2558 | "file": "src/components/ui/WebviewLoader/index.js", | ||
2559 | "id": "service.webviewLoader.loading", | ||
2560 | "start": { | ||
2561 | "column": 11, | ||
2562 | "line": 11 | ||
2563 | } | ||
2564 | } | ||
2565 | ], | ||
2566 | "path": "src/components/ui/WebviewLoader/index.json" | ||
2567 | }, | ||
2568 | { | ||
2569 | "descriptors": [ | ||
2570 | { | ||
2553 | "defaultMessage": "!!!Something went wrong.", | 2571 | "defaultMessage": "!!!Something went wrong.", |
2554 | "end": { | 2572 | "end": { |
2555 | "column": 3, | 2573 | "column": 3, |
@@ -3367,6 +3385,24 @@ | |||
3367 | { | 3385 | { |
3368 | "descriptors": [ | 3386 | "descriptors": [ |
3369 | { | 3387 | { |
3388 | "defaultMessage": "!!!Switching to", | ||
3389 | "end": { | ||
3390 | "column": 3, | ||
3391 | "line": 15 | ||
3392 | }, | ||
3393 | "file": "src/features/workspaces/components/WorkspaceSwitchingIndicator.js", | ||
3394 | "id": "workspaces.switchingIndicator.switchingTo", | ||
3395 | "start": { | ||
3396 | "column": 15, | ||
3397 | "line": 12 | ||
3398 | } | ||
3399 | } | ||
3400 | ], | ||
3401 | "path": "src/features/workspaces/components/WorkspaceSwitchingIndicator.json" | ||
3402 | }, | ||
3403 | { | ||
3404 | "descriptors": [ | ||
3405 | { | ||
3370 | "defaultMessage": "!!!Field is required", | 3406 | "defaultMessage": "!!!Field is required", |
3371 | "end": { | 3407 | "end": { |
3372 | "column": 3, | 3408 | "column": 3, |
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 9716c3717..231e8f261 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json | |||
@@ -115,6 +115,7 @@ | |||
115 | "service.errorHandler.headline": "Oh no!", | 115 | "service.errorHandler.headline": "Oh no!", |
116 | "service.errorHandler.message": "Error", | 116 | "service.errorHandler.message": "Error", |
117 | "service.errorHandler.text": "{name} has failed to load.", | 117 | "service.errorHandler.text": "{name} has failed to load.", |
118 | "service.webviewLoader.loading": "Loading", | ||
118 | "services.getStarted": "Get started", | 119 | "services.getStarted": "Get started", |
119 | "services.welcome": "Welcome to Franz", | 120 | "services.welcome": "Welcome to Franz", |
120 | "settings.account.account.editButton": "Edit account", | 121 | "settings.account.account.editButton": "Edit account", |
@@ -300,5 +301,6 @@ | |||
300 | "welcome.loginButton": "Login to your account", | 301 | "welcome.loginButton": "Login to your account", |
301 | "welcome.signupButton": "Create a free account", | 302 | "welcome.signupButton": "Create a free account", |
302 | "workspaceDrawer.allServices": "All services", | 303 | "workspaceDrawer.allServices": "All services", |
303 | "workspaceDrawer.headline": "Workspaces" | 304 | "workspaceDrawer.headline": "Workspaces", |
304 | } | 305 | "workspaces.switchingIndicator.switchingTo": "Switching to" |
306 | } \ No newline at end of file | ||
diff --git a/src/i18n/messages/src/components/layout/AppLayout.json b/src/i18n/messages/src/components/layout/AppLayout.json index 4dd354afc..92593ed5c 100644 --- a/src/i18n/messages/src/components/layout/AppLayout.json +++ b/src/i18n/messages/src/components/layout/AppLayout.json | |||
@@ -4,11 +4,11 @@ | |||
4 | "defaultMessage": "!!!Your services have been updated.", | 4 | "defaultMessage": "!!!Your services have been updated.", |
5 | "file": "src/components/layout/AppLayout.js", | 5 | "file": "src/components/layout/AppLayout.js", |
6 | "start": { | 6 | "start": { |
7 | "line": 26, | 7 | "line": 25, |
8 | "column": 19 | 8 | "column": 19 |
9 | }, | 9 | }, |
10 | "end": { | 10 | "end": { |
11 | "line": 29, | 11 | "line": 28, |
12 | "column": 3 | 12 | "column": 3 |
13 | } | 13 | } |
14 | }, | 14 | }, |
@@ -17,11 +17,11 @@ | |||
17 | "defaultMessage": "!!!A new update for Franz is available.", | 17 | "defaultMessage": "!!!A new update for Franz is available.", |
18 | "file": "src/components/layout/AppLayout.js", | 18 | "file": "src/components/layout/AppLayout.js", |
19 | "start": { | 19 | "start": { |
20 | "line": 30, | 20 | "line": 29, |
21 | "column": 19 | 21 | "column": 19 |
22 | }, | 22 | }, |
23 | "end": { | 23 | "end": { |
24 | "line": 33, | 24 | "line": 32, |
25 | "column": 3 | 25 | "column": 3 |
26 | } | 26 | } |
27 | }, | 27 | }, |
@@ -30,11 +30,11 @@ | |||
30 | "defaultMessage": "!!!Reload services", | 30 | "defaultMessage": "!!!Reload services", |
31 | "file": "src/components/layout/AppLayout.js", | 31 | "file": "src/components/layout/AppLayout.js", |
32 | "start": { | 32 | "start": { |
33 | "line": 34, | 33 | "line": 33, |
34 | "column": 24 | 34 | "column": 24 |
35 | }, | 35 | }, |
36 | "end": { | 36 | "end": { |
37 | "line": 37, | 37 | "line": 36, |
38 | "column": 3 | 38 | "column": 3 |
39 | } | 39 | } |
40 | }, | 40 | }, |
@@ -43,11 +43,11 @@ | |||
43 | "defaultMessage": "!!!Changelog", | 43 | "defaultMessage": "!!!Changelog", |
44 | "file": "src/components/layout/AppLayout.js", | 44 | "file": "src/components/layout/AppLayout.js", |
45 | "start": { | 45 | "start": { |
46 | "line": 38, | 46 | "line": 37, |
47 | "column": 13 | 47 | "column": 13 |
48 | }, | 48 | }, |
49 | "end": { | 49 | "end": { |
50 | "line": 41, | 50 | "line": 40, |
51 | "column": 3 | 51 | "column": 3 |
52 | } | 52 | } |
53 | }, | 53 | }, |
@@ -56,11 +56,11 @@ | |||
56 | "defaultMessage": "!!!Restart & install update", | 56 | "defaultMessage": "!!!Restart & install update", |
57 | "file": "src/components/layout/AppLayout.js", | 57 | "file": "src/components/layout/AppLayout.js", |
58 | "start": { | 58 | "start": { |
59 | "line": 42, | 59 | "line": 41, |
60 | "column": 23 | 60 | "column": 23 |
61 | }, | 61 | }, |
62 | "end": { | 62 | "end": { |
63 | "line": 45, | 63 | "line": 44, |
64 | "column": 3 | 64 | "column": 3 |
65 | } | 65 | } |
66 | }, | 66 | }, |
@@ -69,11 +69,11 @@ | |||
69 | "defaultMessage": "!!!Could not load services and user information", | 69 | "defaultMessage": "!!!Could not load services and user information", |
70 | "file": "src/components/layout/AppLayout.js", | 70 | "file": "src/components/layout/AppLayout.js", |
71 | "start": { | 71 | "start": { |
72 | "line": 46, | 72 | "line": 45, |
73 | "column": 26 | 73 | "column": 26 |
74 | }, | 74 | }, |
75 | "end": { | 75 | "end": { |
76 | "line": 49, | 76 | "line": 48, |
77 | "column": 3 | 77 | "column": 3 |
78 | } | 78 | } |
79 | } | 79 | } |
diff --git a/src/i18n/messages/src/components/ui/WebviewLoader/index.json b/src/i18n/messages/src/components/ui/WebviewLoader/index.json new file mode 100644 index 000000000..ef3e4b593 --- /dev/null +++ b/src/i18n/messages/src/components/ui/WebviewLoader/index.json | |||
@@ -0,0 +1,15 @@ | |||
1 | [ | ||
2 | { | ||
3 | "id": "service.webviewLoader.loading", | ||
4 | "defaultMessage": "!!!Loading", | ||
5 | "file": "src/components/ui/WebviewLoader/index.js", | ||
6 | "start": { | ||
7 | "line": 11, | ||
8 | "column": 11 | ||
9 | }, | ||
10 | "end": { | ||
11 | "line": 14, | ||
12 | "column": 3 | ||
13 | } | ||
14 | } | ||
15 | ] \ No newline at end of file | ||
diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspaceSwitchingIndicator.json b/src/i18n/messages/src/features/workspaces/components/WorkspaceSwitchingIndicator.json new file mode 100644 index 000000000..4f3e6d55c --- /dev/null +++ b/src/i18n/messages/src/features/workspaces/components/WorkspaceSwitchingIndicator.json | |||
@@ -0,0 +1,15 @@ | |||
1 | [ | ||
2 | { | ||
3 | "id": "workspaces.switchingIndicator.switchingTo", | ||
4 | "defaultMessage": "!!!Switching to", | ||
5 | "file": "src/features/workspaces/components/WorkspaceSwitchingIndicator.js", | ||
6 | "start": { | ||
7 | "line": 12, | ||
8 | "column": 15 | ||
9 | }, | ||
10 | "end": { | ||
11 | "line": 15, | ||
12 | "column": 3 | ||
13 | } | ||
14 | } | ||
15 | ] \ No newline at end of file | ||