Merge branch '613/Use-translation-library-for-symptom-boxes' into 'main'
613 Use translation library for symptom boxes See merge request bloodyhealth/drip!527
This commit is contained in:
@@ -10,7 +10,7 @@ import SymptomEditView from './symptom-edit-view'
|
|||||||
import { isDateInFuture } from '../helpers/cycle-day'
|
import { isDateInFuture } from '../helpers/cycle-day'
|
||||||
|
|
||||||
import { Colors, Sizes, Spacing } from '../../styles'
|
import { Colors, Sizes, Spacing } from '../../styles'
|
||||||
import { headerTitles as symptomTitles } from '../../i18n/en/labels'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const SymptomBox = ({
|
const SymptomBox = ({
|
||||||
date,
|
date,
|
||||||
@@ -20,6 +20,7 @@ const SymptomBox = ({
|
|||||||
editedSymptom,
|
editedSymptom,
|
||||||
setEditedSymptom,
|
setEditedSymptom,
|
||||||
}) => {
|
}) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
const isSymptomEdited = editedSymptom === symptom
|
const isSymptomEdited = editedSymptom === symptom
|
||||||
const isSymptomDisabled = isDateInFuture(date) && symptom !== 'note'
|
const isSymptomDisabled = isDateInFuture(date) && symptom !== 'note'
|
||||||
const isExcluded = symptomData !== null ? symptomData.exclude : false
|
const isExcluded = symptomData !== null ? symptomData.exclude : false
|
||||||
@@ -62,7 +63,7 @@ const SymptomBox = ({
|
|||||||
/>
|
/>
|
||||||
<View style={styles.textContainer}>
|
<View style={styles.textContainer}>
|
||||||
<AppText style={symptomNameStyle}>
|
<AppText style={symptomNameStyle}>
|
||||||
{symptomTitles[symptom].toLowerCase()}
|
{t(`cycleDay.symptomBox.${symptom}`)}
|
||||||
</AppText>
|
</AppText>
|
||||||
{symptomDataToDisplay && (
|
{symptomDataToDisplay && (
|
||||||
<AppText style={textStyle} numberOfLines={4}>
|
<AppText style={textStyle} numberOfLines={4}>
|
||||||
|
|||||||
@@ -1,4 +1,17 @@
|
|||||||
{
|
{
|
||||||
|
"cycleDay": {
|
||||||
|
"symptomBox": {
|
||||||
|
"bleeding": "Bleeding",
|
||||||
|
"temperature": "Temperature",
|
||||||
|
"mucus": "Cervical Mucus",
|
||||||
|
"cervix": "Cervix",
|
||||||
|
"note": "Note",
|
||||||
|
"desire": "Desire",
|
||||||
|
"sex": "Sex",
|
||||||
|
"pain": "Pain",
|
||||||
|
"mood": "Mood"
|
||||||
|
}
|
||||||
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"bleedingPrediction": {
|
"bleedingPrediction": {
|
||||||
"noPrediction": "As soon as you have tracked 3 menstrual cycles, drip. will make predictions for the next ones."
|
"noPrediction": "As soon as you have tracked 3 menstrual cycles, drip. will make predictions for the next ones."
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
import labels from './settings'
|
|
||||||
const settingsTitles = labels.menuItems
|
|
||||||
|
|
||||||
export const home = {
|
export const home = {
|
||||||
unknown: '?',
|
unknown: '?',
|
||||||
phase: (n) => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`,
|
phase: (n) => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`,
|
||||||
@@ -33,30 +30,6 @@ export const shared = {
|
|||||||
learnMore: 'Learn more',
|
learnMore: 'Learn more',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const headerTitles = {
|
|
||||||
Home: 'Home',
|
|
||||||
Calendar: 'Calendar',
|
|
||||||
Chart: 'Chart',
|
|
||||||
Stats: 'Statistics',
|
|
||||||
SettingsMenu: 'Settings',
|
|
||||||
Reminders: settingsTitles.reminders.name,
|
|
||||||
NfpSettings: settingsTitles.nfpSettings.name,
|
|
||||||
DataManagement: settingsTitles.dataManagement.name,
|
|
||||||
Password: settingsTitles.password.name,
|
|
||||||
About: 'About',
|
|
||||||
License: 'License',
|
|
||||||
PrivacyPolicy: 'Privacy Policy',
|
|
||||||
bleeding: 'Bleeding',
|
|
||||||
temperature: 'Temperature',
|
|
||||||
mucus: 'Cervical Mucus',
|
|
||||||
cervix: 'Cervix',
|
|
||||||
note: 'Note',
|
|
||||||
desire: 'Desire',
|
|
||||||
sex: 'Sex',
|
|
||||||
pain: 'Pain',
|
|
||||||
mood: 'Mood',
|
|
||||||
}
|
|
||||||
|
|
||||||
export const stats = {
|
export const stats = {
|
||||||
cycleLengthExplainer: 'Basic statistics about the length of your cycles.',
|
cycleLengthExplainer: 'Basic statistics about the length of your cycles.',
|
||||||
emptyStats: 'At least one completed cycle is needed to display stats.',
|
emptyStats: 'At least one completed cycle is needed to display stats.',
|
||||||
|
|||||||
Reference in New Issue
Block a user