Merge branch '624/Use-translation-library-in-tutorial' into 'main'

624 Use translation library in tutorial

See merge request bloodyhealth/drip!573
This commit is contained in:
Lisa
2022-11-06 14:43:15 +00:00
4 changed files with 7 additions and 7 deletions
@@ -6,16 +6,17 @@ import AppText from '../common/app-text'
import CloseIcon from '../common/close-icon' import CloseIcon from '../common/close-icon'
import { Containers, Spacing } from '../../styles' import { Containers, Spacing } from '../../styles'
import { chart } from '../../i18n/en/labels' import { useTranslation } from 'react-i18next'
const image = require('../../assets/swipe.png') const image = require('../../assets/swipe.png')
const Tutorial = ({ onClose }) => { const Tutorial = ({ onClose }) => {
const { t } = useTranslation()
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Image resizeMode="contain" source={image} style={styles.image} /> <Image resizeMode="contain" source={image} style={styles.image} />
<View style={styles.textContainer}> <View style={styles.textContainer}>
<AppText>{chart.tutorial}</AppText> <AppText>{t('chart.tutorial')}</AppText>
</View> </View>
<CloseIcon onClose={onClose} /> <CloseIcon onClose={onClose} />
</View> </View>
+1 -1
View File
@@ -9,7 +9,7 @@ import HorizontalGrid from './horizontal-grid'
import MainGrid from './main-grid' import MainGrid from './main-grid'
import NoData from './no-data' import NoData from './no-data'
import NoTemperature from './no-temperature' import NoTemperature from './no-temperature'
import Tutorial from './tutorial' import Tutorial from './Tutorial'
import YAxis from './y-axis' import YAxis from './y-axis'
import { getCycleDaysSortedByDate } from '../../db' import { getCycleDaysSortedByDate } from '../../db'
+3
View File
@@ -4,6 +4,9 @@
"chart": "Chart", "chart": "Chart",
"stats": "Stats" "stats": "Stats"
}, },
"chart": {
"tutorial": "You can swipe the chart to view more dates."
},
"cycleDay": { "cycleDay": {
"symptomBox": { "symptomBox": {
"bleeding": "Bleeding", "bleeding": "Bleeding",
-4
View File
@@ -3,10 +3,6 @@ export const home = {
phase: (n) => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`, 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 = { export const shared = {
cancel: 'Cancel', cancel: 'Cancel',
save: 'Save', save: 'Save',