From 4573b939211952af19eb19ab4f7f40f7c1b4fd30 Mon Sep 17 00:00:00 2001 From: Lisa Hillebrand Date: Sun, 23 Oct 2022 11:54:11 +0200 Subject: [PATCH] 624 Use translation library for chart tutorial --- components/chart/tutorial.js | 5 +++-- i18n/en.json | 3 +++ i18n/en/labels.js | 4 ---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/chart/tutorial.js b/components/chart/tutorial.js index 553a4ef..dbb529c 100644 --- a/components/chart/tutorial.js +++ b/components/chart/tutorial.js @@ -6,16 +6,17 @@ import AppText from '../common/app-text' import CloseIcon from '../common/close-icon' import { Containers, Spacing } from '../../styles' -import { chart } from '../../i18n/en/labels' +import { useTranslation } from 'react-i18next' const image = require('../../assets/swipe.png') const Tutorial = ({ onClose }) => { + const { t } = useTranslation() return ( - {chart.tutorial} + {t('chart.tutorial')} diff --git a/i18n/en.json b/i18n/en.json index b67c06d..2f61800 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -4,6 +4,9 @@ "chart": "Chart", "stats": "Stats" }, + "chart": { + "tutorial": "You can swipe the chart to view more dates." + }, "cycleDay": { "symptomBox": { "bleeding": "Bleeding", diff --git a/i18n/en/labels.js b/i18n/en/labels.js index c981ac2..2348e7a 100644 --- a/i18n/en/labels.js +++ b/i18n/en/labels.js @@ -3,10 +3,6 @@ export const home = { phase: (n) => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`, } -export const chart = { - tutorial: 'You can swipe the chart to view more dates.', -} - export const shared = { cancel: 'Cancel', save: 'Save',