aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorLibravatar vantezzen <properly@protonmail.com>2019-09-03 09:54:30 +0200
committerLibravatar vantezzen <properly@protonmail.com>2019-09-03 09:54:30 +0200
commit02c62c7b7578ff47d690b3085baa105b47bfe026 (patch)
tree4538eb79ad9dc0b1938ce86394c6dc406f633524 /src/components
parentChange protocol to ferdi (diff)
downloadferdium-app-02c62c7b7578ff47d690b3085baa105b47bfe026.tar.gz
ferdium-app-02c62c7b7578ff47d690b3085baa105b47bfe026.tar.zst
ferdium-app-02c62c7b7578ff47d690b3085baa105b47bfe026.zip
i18n custom Ferdi strings
Diffstat (limited to 'src/components')
-rw-r--r--src/components/auth/Login.js13
-rw-r--r--src/components/layout/AppLayout.js6
-rw-r--r--src/components/services/content/Services.js12
3 files changed, 25 insertions, 6 deletions
diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js
index f8caebd7e..1563e471a 100644
--- a/src/components/auth/Login.js
+++ b/src/components/auth/Login.js
@@ -34,6 +34,14 @@ const messages = defineMessages({
34 id: 'login.invalidCredentials', 34 id: 'login.invalidCredentials',
35 defaultMessage: '!!!Email or password not valid', 35 defaultMessage: '!!!Email or password not valid',
36 }, 36 },
37 customServerQuestion: {
38 id: 'login.customServerQuestion',
39 defaultMessage: '!!!Using a custom Ferdi server?',
40 },
41 customServerSuggestion: {
42 id: 'login.customServerSuggestion',
43 defaultMessage: '!!!Try importing your Franz account',
44 },
37 tokenExpired: { 45 tokenExpired: {
38 id: 'login.tokenExpired', 46 id: 'login.tokenExpired',
39 defaultMessage: '!!!Your session expired, please login again.', 47 defaultMessage: '!!!Your session expired, please login again.',
@@ -141,14 +149,13 @@ export default @observer class Login extends Component {
141 <p className="error-message center">{intl.formatMessage(messages.invalidCredentials)}</p> 149 <p className="error-message center">{intl.formatMessage(messages.invalidCredentials)}</p>
142 { window.ferdi.stores.settings.all.app.server !== 'https://api.franzinfra.com' && ( 150 { window.ferdi.stores.settings.all.app.server !== 'https://api.franzinfra.com' && (
143 <p className="error-message center"> 151 <p className="error-message center">
144 Using a custom Ferdi server? Try 152 {intl.formatMessage(messages.customServerQuestion)}{' '}
145 {' '}
146 <Link 153 <Link
147 to={`${window.ferdi.stores.settings.all.app.server.replace('v1', '')}/import`} 154 to={`${window.ferdi.stores.settings.all.app.server.replace('v1', '')}/import`}
148 target="_blank" 155 target="_blank"
149 style={{ cursor: 'pointer', textDecoration: 'underline' }} 156 style={{ cursor: 'pointer', textDecoration: 'underline' }}
150 > 157 >
151importing your Franz account 158 {intl.formatMessage(messages.customServerSuggestion)}
152 </Link> 159 </Link>
153 </p> 160 </p>
154 )} 161 )}
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js
index 02550c87f..5c3d301e0 100644
--- a/src/components/layout/AppLayout.js
+++ b/src/components/layout/AppLayout.js
@@ -34,6 +34,10 @@ const messages = defineMessages({
34 id: 'infobar.requiredRequestsFailed', 34 id: 'infobar.requiredRequestsFailed',
35 defaultMessage: '!!!Could not load services and user information', 35 defaultMessage: '!!!Could not load services and user information',
36 }, 36 },
37 authRequestFailed: {
38 id: 'infobar.authRequestFailed',
39 defaultMessage: '!!!There were errors while trying to perform an authenticated request. Please try logging out and back in if this error persists.',
40 },
37}); 41});
38 42
39const styles = theme => ({ 43const styles = theme => ({
@@ -154,7 +158,7 @@ class AppLayout extends Component {
154 onClick={retryRequiredRequests} 158 onClick={retryRequiredRequests}
155 > 159 >
156 <span className="mdi mdi-flash" /> 160 <span className="mdi mdi-flash" />
157 There were errors while trying to perform an authenticated request. Please try logging out and back in if this error persists. 161 {intl.formatMessage(messages.authRequestFailed)}
158 </InfoBar> 162 </InfoBar>
159 )} 163 )}
160 {showServicesUpdatedInfoBar && ( 164 {showServicesUpdatedInfoBar && (
diff --git a/src/components/services/content/Services.js b/src/components/services/content/Services.js
index 9fe737529..5fad070f0 100644
--- a/src/components/services/content/Services.js
+++ b/src/components/services/content/Services.js
@@ -16,6 +16,14 @@ const messages = defineMessages({
16 id: 'services.getStarted', 16 id: 'services.getStarted',
17 defaultMessage: '!!!Get started', 17 defaultMessage: '!!!Get started',
18 }, 18 },
19 login: {
20 id: 'services.login',
21 defaultMessage: '!!!Please login to use Ferdi.',
22 },
23 serverInfo: {
24 id: 'services.serverInfo',
25 defaultMessage: '!!!Optionally, you can change your Ferdi server by clicking the cog in the bottom left corner.',
26 },
19}); 27});
20 28
21export default @observer class Services extends Component { 29export default @observer class Services extends Component {
@@ -64,8 +72,8 @@ export default @observer class Services extends Component {
64 <h1>{intl.formatMessage(messages.welcome)}</h1> 72 <h1>{intl.formatMessage(messages.welcome)}</h1>
65 { !isLoggedIn && ( 73 { !isLoggedIn && (
66 <> 74 <>
67 <p>Please login to use Ferdi.</p> 75 <p>{intl.formatMessage(messages.login)}</p>
68 <p>Optionally, you can change your Ferdi server by clicking the cog in the bottom left corner.</p> 76 <p>{intl.formatMessage(messages.serverInfo)}</p>
69 </> 77 </>
70 ) } 78 ) }
71 <Appear 79 <Appear