From b65b3344163248feb316047ad9b70120db84e396 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Mon, 30 Sep 2019 10:41:20 +0200 Subject: Add texts in settings to i18n --- .../settings/settings/EditSettingsForm.js | 56 ++++++---- src/i18n/apply-branding.js | 1 + src/i18n/locales/defaultMessages.json | 122 +++++++++++++-------- src/i18n/locales/en-US.json | 4 +- .../settings/settings/EditSettingsForm.json | 122 +++++++++++++-------- 5 files changed, 184 insertions(+), 121 deletions(-) diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 6552220f1..1d2383125 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js @@ -13,6 +13,15 @@ import Input from '../../ui/Input'; import { FRANZ_TRANSLATION } from '../../../config'; +function escapeHtml(unsafe) { + return unsafe + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + const messages = defineMessages({ headline: { id: 'settings.app.headline', @@ -26,6 +35,10 @@ const messages = defineMessages({ id: 'settings.app.serverInfo', defaultMessage: '!!!We advice you to logout after changing your server as your settings might not be saved otherwise.', }, + serverMoneyInfo: { + id: 'settings.app.serverMoneyInfo', + defaultMessage: '!!!You are using the official Franz Server for Ferdi.\nWe know that Ferdi allows you to use all its features for free but you are still using Franz\'s server resources - which Franz\'s creator has to pay for.\nPlease still consider [Link 1]paying for a Franz account[/Link] or [Link 2]using a self-hosted ferdi-server[/Link] (if you have the knowledge and resources to do so). \nBy using Ferdi, you still profit greatly from Franz\'s recipe store, server resources and its development.', + }, todoServerInfo: { id: 'settings.app.todoServerInfo', defaultMessage: '!!!This server will be used for the "Franz Todo" feature. (default: https://app.franztodos.com)', @@ -38,6 +51,10 @@ const messages = defineMessages({ id: 'settings.app.lockedPasswordInfo', defaultMessage: '!!!Please make sure to set a password you\'ll remember.\nIf you loose this password, you will have to reinstall Ferdi.', }, + lockInfo: { + id: 'settings.app.lockInfo', + defaultMessage: '!!!Ferdi password lock allows you to keep your messages protected.\nUsing Ferdi password lock, you will be prompted to enter your password everytime you start Ferdi or lock Ferdi yourself using the lock symbol in the bottom left corner or the shortcut CMD/CTRL+Shift+L.', + }, scheduledDNDTimeInfo: { id: 'settings.app.scheduledDNDTimeInfo', defaultMessage: '!!!Times in 24-Hour-Format. End time can be before start time (e.g. start 17:00, end 09:00) to enable Do-not-Disturb overnight.', @@ -218,24 +235,20 @@ export default @observer class EditSettingsForm extends Component { borderTop: 0, marginTop: 0, paddingTop: 0, marginBottom: '2rem', }} > - - You are using the official Franz Server for Ferdi. -
- We know that Ferdi allows you to use all its features for free but you are - still using Franz's server resources - which Franz's creator has to pay for. -
- Please still consider - {' '} - paying for a Franz account - {' '} - or - {' '} - using a self-hosted ferdi-server - {' '} - (if you have the knowledge and resources to do so). -
- By using Ferdi, you still profit greatly from Franz's recipe store, server resources and its development. -
+ ') + .replace('[Link 2]', '') + .replace(/\[\/Link]/g, ''), + }} + style={{ + whiteSpace: 'pre-wrap', + }} + />

)} {isWorkspaceEnabled && ( @@ -276,12 +289,7 @@ export default @observer class EditSettingsForm extends Component { }} > - Ferdi password lock allows you to keep your messages protected. -
- Using Ferdi password lock, you will be prompted to enter your password everytime you - start Ferdi or lock Ferdi yourself using the lock symbol in the bottom left corner or the shortcut - {' '} - CMD/CTRL+Shift+L + { intl.formatMessage(messages.lockInfo) }

diff --git a/src/i18n/apply-branding.js b/src/i18n/apply-branding.js index 7e706ca55..662799ab0 100644 --- a/src/i18n/apply-branding.js +++ b/src/i18n/apply-branding.js @@ -9,6 +9,7 @@ console.log('Applying Ferdi branding to translations...'); // Keys to ignore when applying branding const ignore = [ 'login.customServerSuggestion', + 'settings.app.todoServerInfo', ]; // Files to ignore when applying branding diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 8022aed3b..4033407e3 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json @@ -2465,312 +2465,338 @@ "defaultMessage": "!!!Settings", "end": { "column": 3, - "line": 20 + "line": 29 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.headline", "start": { "column": 12, - "line": 17 + "line": 26 } }, { "defaultMessage": "!!!General", "end": { "column": 3, - "line": 24 + "line": 33 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.headlineGeneral", "start": { "column": 19, - "line": 21 + "line": 30 } }, { "defaultMessage": "!!!We advice you to logout after changing your server as your settings might not be saved otherwise.", "end": { "column": 3, - "line": 28 + "line": 37 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.serverInfo", "start": { "column": 14, - "line": 25 + "line": 34 + } + }, + { + "defaultMessage": "!!!You are using the official Franz Server for Ferdi.\nWe know that Ferdi allows you to use all its features for free but you are still using Franz's server resources - which Franz's creator has to pay for.\nPlease still consider [Link 1]paying for a Franz account[/Link] or [Link 2]using a self-hosted ferdi-server[/Link] (if you have the knowledge and resources to do so). \nBy using Ferdi, you still profit greatly from Franz's recipe store, server resources and its development.", + "end": { + "column": 3, + "line": 41 + }, + "file": "src/components/settings/settings/EditSettingsForm.js", + "id": "settings.app.serverMoneyInfo", + "start": { + "column": 19, + "line": 38 } }, { "defaultMessage": "!!!This server will be used for the \"Franz Todo\" feature. (default: https://app.franztodos.com)", "end": { "column": 3, - "line": 32 + "line": 45 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.todoServerInfo", "start": { "column": 18, - "line": 29 + "line": 42 } }, { "defaultMessage": "!!!Ferdi Lock Password", "end": { "column": 3, - "line": 36 + "line": 49 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.lockedPassword", "start": { "column": 18, - "line": 33 + "line": 46 } }, { "defaultMessage": "!!!Please make sure to set a password you'll remember.\nIf you loose this password, you will have to reinstall Ferdi.", "end": { "column": 3, - "line": 40 + "line": 53 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.lockedPasswordInfo", "start": { "column": 22, - "line": 37 + "line": 50 + } + }, + { + "defaultMessage": "!!!Ferdi password lock allows you to keep your messages protected.\nUsing Ferdi password lock, you will be prompted to enter your password everytime you start Ferdi or lock Ferdi yourself using the lock symbol in the bottom left corner or the shortcut CMD/CTRL+Shift+L.", + "end": { + "column": 3, + "line": 57 + }, + "file": "src/components/settings/settings/EditSettingsForm.js", + "id": "settings.app.lockInfo", + "start": { + "column": 12, + "line": 54 } }, { "defaultMessage": "!!!Times in 24-Hour-Format. End time can be before start time (e.g. start 17:00, end 09:00) to enable Do-not-Disturb overnight.", "end": { "column": 3, - "line": 44 + "line": 61 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.scheduledDNDTimeInfo", "start": { "column": 24, - "line": 41 + "line": 58 } }, { "defaultMessage": "!!!Scheduled Do-not-Disturb allows you to define a period of time in which you do not want to get Notifications from Ferdi.", "end": { "column": 3, - "line": 48 + "line": 65 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.scheduledDNDInfo", "start": { "column": 20, - "line": 45 + "line": 62 } }, { "defaultMessage": "!!!Language", "end": { "column": 3, - "line": 52 + "line": 69 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.headlineLanguage", "start": { "column": 20, - "line": 49 + "line": 66 } }, { "defaultMessage": "!!!Updates", "end": { "column": 3, - "line": 56 + "line": 73 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.headlineUpdates", "start": { "column": 19, - "line": 53 + "line": 70 } }, { "defaultMessage": "!!!Appearance", "end": { "column": 3, - "line": 60 + "line": 77 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.headlineAppearance", "start": { "column": 22, - "line": 57 + "line": 74 } }, { "defaultMessage": "!!!Advanced", "end": { "column": 3, - "line": 64 + "line": 81 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.headlineAdvanced", "start": { "column": 20, - "line": 61 + "line": 78 } }, { "defaultMessage": "!!!Help us to translate Ferdi into your language.", "end": { "column": 3, - "line": 68 + "line": 85 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.translationHelp", "start": { "column": 19, - "line": 65 + "line": 82 } }, { "defaultMessage": "!!!Cache", "end": { "column": 3, - "line": 72 + "line": 89 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.subheadlineCache", "start": { "column": 20, - "line": 69 + "line": 86 } }, { "defaultMessage": "!!!Ferdi cache is currently using {size} of disk space.", "end": { "column": 3, - "line": 76 + "line": 93 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.cacheInfo", "start": { "column": 13, - "line": 73 + "line": 90 } }, { "defaultMessage": "!!!Clear cache", "end": { "column": 3, - "line": 80 + "line": 97 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.buttonClearAllCache", "start": { "column": 23, - "line": 77 + "line": 94 } }, { "defaultMessage": "!!!Check for updates", "end": { "column": 3, - "line": 84 + "line": 101 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.buttonSearchForUpdate", "start": { "column": 25, - "line": 81 + "line": 98 } }, { "defaultMessage": "!!!Restart & install update", "end": { "column": 3, - "line": 88 + "line": 105 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.buttonInstallUpdate", "start": { "column": 23, - "line": 85 + "line": 102 } }, { "defaultMessage": "!!!Is searching for update", "end": { "column": 3, - "line": 92 + "line": 109 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.updateStatusSearching", "start": { "column": 25, - "line": 89 + "line": 106 } }, { "defaultMessage": "!!!Update available, downloading...", "end": { "column": 3, - "line": 96 + "line": 113 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.updateStatusAvailable", "start": { "column": 25, - "line": 93 + "line": 110 } }, { "defaultMessage": "!!!You are using the latest version of Ferdi", "end": { "column": 3, - "line": 100 + "line": 117 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.updateStatusUpToDate", "start": { "column": 24, - "line": 97 + "line": 114 } }, { "defaultMessage": "!!!Current version:", "end": { "column": 3, - "line": 104 + "line": 121 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.currentVersion", "start": { "column": 18, - "line": 101 + "line": 118 } }, { "defaultMessage": "!!!Changes require restart", "end": { "column": 3, - "line": 108 + "line": 125 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.restartRequired", "start": { "column": 29, - "line": 105 + "line": 122 } }, { "defaultMessage": "!!!Official translations are English & German. All other languages are community based translations.", "end": { "column": 3, - "line": 112 + "line": 129 }, "file": "src/components/settings/settings/EditSettingsForm.js", "id": "settings.app.languageDisclaimer", "start": { "column": 22, - "line": 109 + "line": 126 } } ], diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 784a0aeb5..ad64bec14 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -247,14 +247,16 @@ "settings.app.headlineLanguage": "Language", "settings.app.headlineUpdates": "Updates", "settings.app.languageDisclaimer": "Official translations are English & German. All other languages are community based translations.", + "settings.app.lockInfo": "Ferdi password lock allows you to keep your messages protected.\nUsing Ferdi password lock, you will be prompted to enter your password everytime you start Ferdi or lock Ferdi yourself using the lock symbol in the bottom left corner or the shortcut CMD/CTRL+Shift+L.", "settings.app.lockedPassword": "Ferdi Lock Password", "settings.app.lockedPasswordInfo": "Please make sure to set a password you'll remember.\nIf you loose this password, you will have to reinstall Ferdi.", "settings.app.restartRequired": "Changes require restart", "settings.app.scheduledDNDInfo": "Scheduled Do-not-Disturb allows you to define a period of time in which you do not want to get Notifications from Ferdi.", "settings.app.scheduledDNDTimeInfo": "Times in 24-Hour-Format. End time can be before start time (e.g. start 17:00, end 09:00) to enable Do-not-Disturb overnight.", "settings.app.serverInfo": "We advice you to logout after changing your server as your settings might not be saved otherwise.", + "settings.app.serverMoneyInfo": "You are using the official Ferdi Server for Ferdi.\nWe know that Ferdi allows you to use all its features for free but you are still using Ferdi's server resources - which Ferdi's creator has to pay for.\nPlease still consider [Link 1]paying for a Ferdi account[/Link] or [Link 2]using a self-hosted ferdi-server[/Link] (if you have the knowledge and resources to do so). \nBy using Ferdi, you still profit greatly from Ferdi's recipe store, server resources and its development.", "settings.app.subheadlineCache": "Cache", - "settings.app.todoServerInfo": "This server will be used for the \"Ferdi Todo\" feature. (default: https://app.Ferditodos.com)", + "settings.app.todoServerInfo": "This server will be used for the \"Ferdi Todo\" feature. (default: https://app.franztodos.com)", "settings.app.translationHelp": "Help us to translate Ferdi into your language.", "settings.app.updateStatusAvailable": "Update available, downloading...", "settings.app.updateStatusSearching": "Is searching for update", diff --git a/src/i18n/messages/src/components/settings/settings/EditSettingsForm.json b/src/i18n/messages/src/components/settings/settings/EditSettingsForm.json index ccbc155f3..07815de19 100644 --- a/src/i18n/messages/src/components/settings/settings/EditSettingsForm.json +++ b/src/i18n/messages/src/components/settings/settings/EditSettingsForm.json @@ -4,11 +4,11 @@ "defaultMessage": "!!!Settings", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 17, + "line": 26, "column": 12 }, "end": { - "line": 20, + "line": 29, "column": 3 } }, @@ -17,11 +17,11 @@ "defaultMessage": "!!!General", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 21, + "line": 30, "column": 19 }, "end": { - "line": 24, + "line": 33, "column": 3 } }, @@ -30,11 +30,24 @@ "defaultMessage": "!!!We advice you to logout after changing your server as your settings might not be saved otherwise.", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 25, + "line": 34, "column": 14 }, "end": { - "line": 28, + "line": 37, + "column": 3 + } + }, + { + "id": "settings.app.serverMoneyInfo", + "defaultMessage": "!!!You are using the official Franz Server for Ferdi.\nWe know that Ferdi allows you to use all its features for free but you are still using Franz's server resources - which Franz's creator has to pay for.\nPlease still consider [Link 1]paying for a Franz account[/Link] or [Link 2]using a self-hosted ferdi-server[/Link] (if you have the knowledge and resources to do so). \nBy using Ferdi, you still profit greatly from Franz's recipe store, server resources and its development.", + "file": "src/components/settings/settings/EditSettingsForm.js", + "start": { + "line": 38, + "column": 19 + }, + "end": { + "line": 41, "column": 3 } }, @@ -43,11 +56,11 @@ "defaultMessage": "!!!This server will be used for the \"Franz Todo\" feature. (default: https://app.franztodos.com)", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 29, + "line": 42, "column": 18 }, "end": { - "line": 32, + "line": 45, "column": 3 } }, @@ -56,11 +69,11 @@ "defaultMessage": "!!!Ferdi Lock Password", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 33, + "line": 46, "column": 18 }, "end": { - "line": 36, + "line": 49, "column": 3 } }, @@ -69,11 +82,24 @@ "defaultMessage": "!!!Please make sure to set a password you'll remember.\nIf you loose this password, you will have to reinstall Ferdi.", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 37, + "line": 50, "column": 22 }, "end": { - "line": 40, + "line": 53, + "column": 3 + } + }, + { + "id": "settings.app.lockInfo", + "defaultMessage": "!!!Ferdi password lock allows you to keep your messages protected.\nUsing Ferdi password lock, you will be prompted to enter your password everytime you start Ferdi or lock Ferdi yourself using the lock symbol in the bottom left corner or the shortcut CMD/CTRL+Shift+L.", + "file": "src/components/settings/settings/EditSettingsForm.js", + "start": { + "line": 54, + "column": 12 + }, + "end": { + "line": 57, "column": 3 } }, @@ -82,11 +108,11 @@ "defaultMessage": "!!!Times in 24-Hour-Format. End time can be before start time (e.g. start 17:00, end 09:00) to enable Do-not-Disturb overnight.", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 41, + "line": 58, "column": 24 }, "end": { - "line": 44, + "line": 61, "column": 3 } }, @@ -95,11 +121,11 @@ "defaultMessage": "!!!Scheduled Do-not-Disturb allows you to define a period of time in which you do not want to get Notifications from Ferdi.", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 45, + "line": 62, "column": 20 }, "end": { - "line": 48, + "line": 65, "column": 3 } }, @@ -108,11 +134,11 @@ "defaultMessage": "!!!Language", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 49, + "line": 66, "column": 20 }, "end": { - "line": 52, + "line": 69, "column": 3 } }, @@ -121,11 +147,11 @@ "defaultMessage": "!!!Updates", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 53, + "line": 70, "column": 19 }, "end": { - "line": 56, + "line": 73, "column": 3 } }, @@ -134,11 +160,11 @@ "defaultMessage": "!!!Appearance", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 57, + "line": 74, "column": 22 }, "end": { - "line": 60, + "line": 77, "column": 3 } }, @@ -147,11 +173,11 @@ "defaultMessage": "!!!Advanced", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 61, + "line": 78, "column": 20 }, "end": { - "line": 64, + "line": 81, "column": 3 } }, @@ -160,11 +186,11 @@ "defaultMessage": "!!!Help us to translate Ferdi into your language.", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 65, + "line": 82, "column": 19 }, "end": { - "line": 68, + "line": 85, "column": 3 } }, @@ -173,11 +199,11 @@ "defaultMessage": "!!!Cache", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 69, + "line": 86, "column": 20 }, "end": { - "line": 72, + "line": 89, "column": 3 } }, @@ -186,11 +212,11 @@ "defaultMessage": "!!!Ferdi cache is currently using {size} of disk space.", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 73, + "line": 90, "column": 13 }, "end": { - "line": 76, + "line": 93, "column": 3 } }, @@ -199,11 +225,11 @@ "defaultMessage": "!!!Clear cache", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 77, + "line": 94, "column": 23 }, "end": { - "line": 80, + "line": 97, "column": 3 } }, @@ -212,11 +238,11 @@ "defaultMessage": "!!!Check for updates", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 81, + "line": 98, "column": 25 }, "end": { - "line": 84, + "line": 101, "column": 3 } }, @@ -225,11 +251,11 @@ "defaultMessage": "!!!Restart & install update", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 85, + "line": 102, "column": 23 }, "end": { - "line": 88, + "line": 105, "column": 3 } }, @@ -238,11 +264,11 @@ "defaultMessage": "!!!Is searching for update", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 89, + "line": 106, "column": 25 }, "end": { - "line": 92, + "line": 109, "column": 3 } }, @@ -251,11 +277,11 @@ "defaultMessage": "!!!Update available, downloading...", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 93, + "line": 110, "column": 25 }, "end": { - "line": 96, + "line": 113, "column": 3 } }, @@ -264,11 +290,11 @@ "defaultMessage": "!!!You are using the latest version of Ferdi", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 97, + "line": 114, "column": 24 }, "end": { - "line": 100, + "line": 117, "column": 3 } }, @@ -277,11 +303,11 @@ "defaultMessage": "!!!Current version:", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 101, + "line": 118, "column": 18 }, "end": { - "line": 104, + "line": 121, "column": 3 } }, @@ -290,11 +316,11 @@ "defaultMessage": "!!!Changes require restart", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 105, + "line": 122, "column": 29 }, "end": { - "line": 108, + "line": 125, "column": 3 } }, @@ -303,11 +329,11 @@ "defaultMessage": "!!!Official translations are English & German. All other languages are community based translations.", "file": "src/components/settings/settings/EditSettingsForm.js", "start": { - "line": 109, + "line": 126, "column": 22 }, "end": { - "line": 112, + "line": 129, "column": 3 } } -- cgit v1.2.3-54-g00ecf