Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

fix(translations): missing translations values #1939

Merged
merged 2 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/__tests__/patients/allergies/Allergies.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('Allergies', () => {

expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'states.success',
'patient.allergies.successfullyAdded',
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/patients/diagnoses/Diagnoses.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('Diagnoses', () => {

expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'states.success',
'patient.diagnoses.successfullyAdded',
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/patients/new/NewPatient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ describe('New Patient', () => {
expect(history.location.pathname).toEqual(`/patients/${patient.id}`)
expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'states.success',
`patients.successfullyCreated ${patient.fullName}`,
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ describe('Related Persons Tab', () => {

expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'patient.relatedPersons.successfullyAdded',
'states.success',
'patients.successfullyAddedRelatedPerson',
'top-left',
)
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ describe('New Appointment', () => {
expect(history.location.pathname).toEqual(`/appointments/${expectedNewAppointment.id}`)
expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'Success!',
'states.success',
`scheduling.appointment.successfullyCreated ${expectedNewAppointment.id}`,
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ describe('View Appointment', () => {
expect(mockedComponents.Toast).toHaveBeenCalledWith(
'success',
'states.success',
'scheduling.appointments.successfullyDeleted',
'scheduling.appointment.successfullyDeleted',
)
})
})
Expand Down
2 changes: 2 additions & 0 deletions src/locales/enUs/translations/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ export default {
new: 'New',
list: 'List',
search: 'Search',
delete: 'Delete',
confirmDelete: 'Delete Confirmation',
},
}
1 change: 1 addition & 0 deletions src/locales/enUs/translations/patient/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default {
},
allergies: {
label: 'Allergies',
allergyName: 'Allergy Name',
new: 'Add Allergy',
error: {
nameRequired: 'Name is required.',
Expand Down
3 changes: 2 additions & 1 deletion src/locales/enUs/translations/patients/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ export default {
patients: {
label: 'Patients',
viewPatients: 'View Patients',
editPatient: 'Edit Patient',
viewPatient: 'View Patient',
newPatient: 'New Patient',
successfullyCreated: 'Successfully created patient',
successfullyAddedRelatedPerson: 'Successfully added the new related person',
successfullyAddedRelatedPerson: 'Successfully added a new related person',
},
}
4 changes: 4 additions & 0 deletions src/locales/enUs/translations/scheduling/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export default {
label: 'Appointments',
new: 'New Appointment',
deleteAppointment: 'Delete Appointment',
viewAppointment: 'Appointment',
editAppointment: 'Edit Appointment',
},
appointment: {
startDate: 'Start Date',
Expand All @@ -26,6 +28,8 @@ export default {
},
reason: 'Reason',
patient: 'Patient',
successfullyDeleted: 'Appointment successfully deleted.',
deleteConfirmationMessage: 'Are you sure you want to delete this appointment?',
},
},
}
2 changes: 1 addition & 1 deletion src/patients/allergies/Allergies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Allergies = (props: AllergiesProps) => {
useAddBreadcrumbs(breadcrumbs)

const onAddAllergySuccess = () => {
Toast('success', t('Success!'), `${t('patient.allergies.successfullyAdded')}`)
Toast('success', t('states.success'), `${t('patient.allergies.successfullyAdded')}`)
}

const onAddAllergy = (allergy: Allergy) => {
Expand Down
4 changes: 2 additions & 2 deletions src/patients/allergies/NewAllergyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ const NewAllergyModal = (props: NewAllergyModalProps) => {
<form>
<TextInputWithLabelFormGroup
name="name"
label="Name"
label={t('patient.allergies.allergyName')}
isEditable
placeholder="Allergy"
placeholder={t('patient.allergies.allergyName')}
value={allergy.name}
onChange={onNameChange}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/patients/diagnoses/Diagnoses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Diagnoses = (props: Props) => {
}

const onAddDiagnosisSuccess = () => {
Toast('success', t('Success!'), t('patient.diagnoses.successfullyAdded'))
Toast('success', t('states.success'), t('patient.diagnoses.successfullyAdded'))
}

const onDiagnosisSave = (diagnosis: Diagnosis) => {
Expand Down
6 changes: 5 additions & 1 deletion src/patients/edit/EditPatient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ const EditPatient = () => {

const onSuccessfulSave = (updatedPatient: Patient) => {
history.push(`/patients/${updatedPatient.id}`)
Toast('success', t('Success!'), `${t('patients.successfullyUpdated')} ${patient.fullName}`)
Toast(
'success',
t('states.success'),
`${t('patients.successfullyUpdated')} ${patient.fullName}`,
)
}

const onSave = () => {
Expand Down
6 changes: 5 additions & 1 deletion src/patients/new/NewPatient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ const NewPatient = () => {

const onSuccessfulSave = (newPatient: Patient) => {
history.push(`/patients/${newPatient.id}`)
Toast('success', t('Success!'), `${t('patients.successfullyCreated')} ${newPatient.fullName}`)
Toast(
'success',
t('states.success'),
`${t('patients.successfullyCreated')} ${newPatient.fullName}`,
)
}

const onSave = () => {
Expand Down
3 changes: 1 addition & 2 deletions src/patients/related-persons/RelatedPersonTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ const RelatedPersonTab = (props: Props) => {
}

const onAddRelatedPersonSuccess = () => {
Toast('success', t('Success!'), t('patient.relatedPersons.successfullyAdded'))
Toast('success', t('Success!'), t('patients.successfullyAddedRelatedPerson'), 'top-left')
Toast('success', t('states.success'), t('patients.successfullyAddedRelatedPerson'), 'top-left')
}

const onRelatedPersonSave = (relatedPerson: RelatedPerson) => {
Expand Down
2 changes: 1 addition & 1 deletion src/scheduling/appointments/new/NewAppointment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const NewAppointment = () => {
history.push(`/appointments/${newAppointment.id}`)
Toast(
'success',
t('Success!'),
t('states.success'),
`${t('scheduling.appointment.successfullyCreated')} ${newAppointment.id}`,
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/scheduling/appointments/view/ViewAppointment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ViewAppointment = () => {

const onDeleteSuccess = () => {
history.push('/appointments')
Toast('success', t('states.success'), t('scheduling.appointments.successfullyDeleted'))
Toast('success', t('states.success'), t('scheduling.appointment.successfullyDeleted'))
}

const onDeleteConfirmationButtonClick = () => {
Expand Down