From 746de577589d315b472b81c3ee04d800d3833127 Mon Sep 17 00:00:00 2001 From: jgiegeri Date: Wed, 16 Jun 2021 23:16:57 -0400 Subject: [PATCH] fix: Pinned Form Translation bug fix --- components/Cards/SmallCardsCarousel/index.js | 49 +++----------------- domains/DataCollection/FormGallery/index.js | 9 +++- domains/DataCollection/index.js | 18 +++++-- modules/i18n/english/en.json | 6 +++ modules/i18n/spanish/es.json | 6 +++ 5 files changed, 40 insertions(+), 48 deletions(-) diff --git a/components/Cards/SmallCardsCarousel/index.js b/components/Cards/SmallCardsCarousel/index.js index afcff3169..b3d53b756 100644 --- a/components/Cards/SmallCardsCarousel/index.js +++ b/components/Cards/SmallCardsCarousel/index.js @@ -7,9 +7,6 @@ import { Card, Text } from 'react-native-paper'; -import MedEvalSVG from '../../../assets/icons/Heart-Icon.svg'; -import EnvSVG from '../../../assets/icons/Home-icon.svg'; -import NewRecordSVG from '../../../assets/icons/New-Record-icon.svg'; import I18n from '../../../modules/i18n'; import { theme } from '../../../modules/theme'; @@ -49,47 +46,15 @@ const SmallCardsCarousel = ({ }} onLongPress={pinForm ? () => pinForm(form) : null} > - {form.tag === 'id' && ( - - - - - {I18n.t('cards.smallCards.residentID')} - - + + + + + {I18n.t(form.name)} + - )} + - {form.tag === 'env' && ( - - - - - {`${I18n.t('cards.smallCards.environmental')} ${I18n.t('cards.smallCards.history')}`} - - - - )} - {form.tag === 'med-eval' && ( - - - - - {`${I18n.t('cards.smallCards.medical')} ${I18n.t('cards.smallCards.evaluation')}`} - - - - )} - {form.tag === 'vitals' && ( - - - - - {I18n.t('cards.smallCards.vitals')} - - - - )} ))} diff --git a/domains/DataCollection/FormGallery/index.js b/domains/DataCollection/FormGallery/index.js index 0c389a6a1..a302105ec 100644 --- a/domains/DataCollection/FormGallery/index.js +++ b/domains/DataCollection/FormGallery/index.js @@ -21,6 +21,7 @@ const FormGallery = (props) => { navigateToCustomForm, customForms, refreshCustomForms, pinnedForms, pinForm, removePinnedForm } = props; + return ( @@ -36,10 +37,14 @@ const FormGallery = (props) => { }} onLongPress={() => removePinnedForm(form)} > + + {form.image !== undefined && ( + + )} - {form.name} + { form.customForm === false ? I18n.t(form.name) : form.name} @@ -125,4 +130,4 @@ const FormGallery = (props) => { ); }; -export default FormGallery; \ No newline at end of file +export default FormGallery; diff --git a/domains/DataCollection/index.js b/domains/DataCollection/index.js index 356b5f4a0..d24f786e8 100644 --- a/domains/DataCollection/index.js +++ b/domains/DataCollection/index.js @@ -11,6 +11,8 @@ import { import ComingSoonSVG from '../../assets/graphics/static/Adventurer.svg'; import FindRecordSVG from '../../assets/graphics/static/Find-Record-Icon.svg'; import ResearchSVG from '../../assets/graphics/static/Research.svg'; +import MedEvalSVG from '../../assets/icons/Heart-Icon.svg'; +import EnvSVG from '../../assets/icons/Home-icon.svg'; import NewRecordSVG from '../../assets/icons/New-Record-icon.svg'; import FindResidents from '../../components/FindResidents'; import Header from '../../components/Header'; @@ -27,10 +29,18 @@ import Forms from './Forms'; import styles from './index.styles'; const puenteForms = [ - { tag: 'id', name: 'Resident ID' }, - { tag: 'env', name: 'Environmental Health' }, - { tag: 'med-eval', name: 'Medical Evaluation' }, - { tag: 'vitals', name: 'Vitals' } + { + tag: 'id', name: 'puenteForms.ResidentID', customForm: false, image: NewRecordSVG + }, + { + tag: 'env', name: 'puenteForms.EnvironmentalHealth', customForm: false, image: EnvSVG + }, + { + tag: 'med-eval', name: 'puenteForms.MedicalEvaluation', customForm: false, image: MedEvalSVG + }, + { + tag: 'vitals', name: 'puenteForms.Vitals', customForm: false, image: NewRecordSVG + } ]; const DataCollection = ({ navigation }) => { diff --git a/modules/i18n/english/en.json b/modules/i18n/english/en.json index 1a5bf250e..944e7bf55 100644 --- a/modules/i18n/english/en.json +++ b/modules/i18n/english/en.json @@ -519,5 +519,11 @@ }, "assetFormSelect": { "supAssetForms": "Supplementary Asset Forms" + }, + "puenteForms":{ + "ResidentID": "Resident ID", + "EnvironmentalHealth": "Environmental Health", + "MedicalEvaluation": "Medical Evaluation", + "Vitals": "Vitals" } } \ No newline at end of file diff --git a/modules/i18n/spanish/es.json b/modules/i18n/spanish/es.json index 1e1a31cad..f54f1fb24 100644 --- a/modules/i18n/spanish/es.json +++ b/modules/i18n/spanish/es.json @@ -519,5 +519,11 @@ }, "assetFormSelect": { "supAssetForms": "Formularios de activos suplementarios" + }, + "puenteForms":{ + "ResidentID": "Identificación de residente", + "EnvironmentalHealth": "Salud Ambiental", + "MedicalEvaluation": "Evaluación Médica", + "Vitals": "Partes vitales" } } \ No newline at end of file