From 4f93d30872b4325a7f26850a4fa9027e674d64a9 Mon Sep 17 00:00:00 2001 From: Lisa Hillebrand Date: Sun, 15 Aug 2021 16:16:04 +0200 Subject: [PATCH 1/3] 511 Rename component --- components/{license.js => License.js} | 0 components/app-wrapper.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename components/{license.js => License.js} (100%) diff --git a/components/license.js b/components/License.js similarity index 100% rename from components/license.js rename to components/License.js diff --git a/components/app-wrapper.js b/components/app-wrapper.js index e8392cc..6810d24 100644 --- a/components/app-wrapper.js +++ b/components/app-wrapper.js @@ -9,7 +9,7 @@ import { openDb } from '../db' import App from './app' import AppLoadingView from './common/app-loading' import AppStatusBar from './common/app-status-bar' -import License from './license' +import License from './License' import PasswordPrompt from './password-prompt' import store from "../store" From 9596f8e52feec1ba6b9fca1ad4e9c4052d0993bd Mon Sep 17 00:00:00 2001 From: Lisa Hillebrand Date: Sun, 15 Aug 2021 17:08:15 +0200 Subject: [PATCH 2/3] 511 Use translation function in license components --- components/License.js | 16 ++++++++-------- components/settings/license.js | 10 ++++++---- i18n/en.json | 16 +++++++++++++--- i18n/en/settings.js | 10 ---------- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/components/License.js b/components/License.js index 8c1bab7..c7cfbd5 100644 --- a/components/License.js +++ b/components/License.js @@ -1,6 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import { BackHandler, StyleSheet, View } from 'react-native' +import { useTranslation } from 'react-i18next' import AppPage from './common/app-page' import AppText from './common/app-text' @@ -9,28 +10,27 @@ import Segment from './common/segment' import { saveLicenseFlag } from '../local-storage' -import { shared } from '../i18n/en/labels' -import settingsLabels from '../i18n/en/settings' import { Containers } from '../styles' -const labels = settingsLabels.license - export default function License({ setLicense }) { const onAcceptLicense = async () => { await saveLicenseFlag() setLicense() } + const { t } = useTranslation() + const currentYear = new Date().getFullYear() + return ( - - {labels.text} + + {t("settings.license.text", { currentYear })} diff --git a/components/settings/license.js b/components/settings/license.js index d3b53c9..f3ead7f 100644 --- a/components/settings/license.js +++ b/components/settings/license.js @@ -1,16 +1,18 @@ import React from 'react' +import { useTranslation } from 'react-i18next' import AppPage from '../common/app-page' import AppText from '../common/app-text' import Segment from '../common/segment' -import labels from '../../i18n/en/settings' - const License = () => { + const { t } = useTranslation() + const currentYear = new Date().getFullYear() + return ( - + - {labels.license.text} + {t("settings.license.text", { currentYear })} ) diff --git a/i18n/en.json b/i18n/en.json index 079edfc..3db6fa5 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,12 +1,22 @@ { "labels": { + "bleedingPrediction": { + "noPrediction": "As soon as you have tracked 3 menstrual cycles, drip will make predictions for the next ones." + }, "home": { "cycleDay": " day of your cycle", "cyclePhase": " cycle phase - ", "addDataForToday": "add data for today" - }, - "bleedingPrediction": { - "noPrediction": "As soon as you have tracked 3 menstrual cycles, drip will make predictions for the next ones." + }, + "shared": { + "cancel": "Cancel", + "ok": "OK" + } + }, + "settings": { + "license": { + "title": "drip is an open-source cycle tracking app", + "text": "Copyright (C) {{currentYear}} Bloody Health GbR\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details: https://www.gnu.org/licenses/gpl-3.0.html\n\nYou can contact us by bloodyhealth@mailbox.org." } } } \ No newline at end of file diff --git a/i18n/en/settings.js b/i18n/en/settings.js index cc63775..3f8a5d2 100644 --- a/i18n/en/settings.js +++ b/i18n/en/settings.js @@ -1,7 +1,5 @@ import links from './links' -const currentYear = new Date().getFullYear() - export default { title: 'Settings', menuItems: { @@ -118,14 +116,6 @@ export default { title: 'Remember to think for yourself', text: `drip makes period predictions for you and helps you apply NFP fertility awareness rules. But please remember that this app is made by humans, and humans make mistakes. Always think for yourself: "Does this make sense?" Remember, you don't need an app to understand your cycle! However, drip wants to support you and make period tracking easier, more transparent and secure.`, }, - license: { - title: 'drip is an open-source cycle tracking app', - text: `Copyright (C) ${currentYear} Bloody Health GbR - -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details: https://www.gnu.org/licenses/gpl-3.0.html - -You can contact us by bloodyhealth@mailbox.org.` - }, version: { title: 'Version' }, From 009b6b38e174bcb174b14cc7880ac66cbc6fdd70 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Sat, 26 Mar 2022 10:19:15 +0000 Subject: [PATCH 3/3] Correct email --- i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/en.json b/i18n/en.json index 3db6fa5..ee932d6 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -16,7 +16,7 @@ "settings": { "license": { "title": "drip is an open-source cycle tracking app", - "text": "Copyright (C) {{currentYear}} Bloody Health GbR\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details: https://www.gnu.org/licenses/gpl-3.0.html\n\nYou can contact us by bloodyhealth@mailbox.org." + "text": "Copyright (C) {{currentYear}} Bloody Health GbR\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details: https://www.gnu.org/licenses/gpl-3.0.html\n\nYou can contact us by drip@mailbox.org." } } } \ No newline at end of file