diff --git a/app/admin/custom-forms/index/route.js b/app/admin/custom-forms/index/route.js index bfada2526e..7b1310e047 100644 --- a/app/admin/custom-forms/index/route.js +++ b/app/admin/custom-forms/index/route.js @@ -25,10 +25,10 @@ export default AbstractIndexRoute.extend(ModalHelper, UserSession, { actions: { deleteItem(item) { let i18n = this.get('i18n'); - let message = i18n.t('admin.customForms.messages.deleteForm'); let model = Ember.Object.create({ itemToDelete: item }); + let message = i18n.t('messages.delete', { name: item.get('name') }); let title = i18n.t('admin.customForms.titles.deleteForm'); this.displayConfirm(title, message, 'deleteCustomForm', model); }, diff --git a/app/admin/lookup/controller.js b/app/admin/lookup/controller.js index 34f10039b6..070db7b997 100644 --- a/app/admin/lookup/controller.js +++ b/app/admin/lookup/controller.js @@ -348,7 +348,7 @@ export default Ember.Controller.extend(BillingCategories, EKMixin, confirmDeleteValue(value) { let i18n = this.get('i18n'); let title = i18n.t('admin.lookup.titles.deleteLookupValue'); - let message = i18n.t('admin.lookup.messages.deleteLookupValue', { value }); + let message = i18n.t('messages.delete', { name: value }); this.displayConfirm(title, message, 'deleteValue', Ember.Object.create({ valueToDelete: value })); diff --git a/app/appointments/delete/template.hbs b/app/appointments/delete/template.hbs index 5a5e5a4aff..16dbd15aef 100644 --- a/app/appointments/delete/template.hbs +++ b/app/appointments/delete/template.hbs @@ -5,6 +5,7 @@ updateButtonText=updateButtonText }}
- {{t 'appointments.messages.deleteAppointmentMessage'}} + + {{t 'messages.delete_singular' name= (t 'models.appointment.names.singular') }}
{{/modal-dialog}} diff --git a/app/imaging/delete/template.hbs b/app/imaging/delete/template.hbs index 67c0414c49..d32e5f252d 100644 --- a/app/imaging/delete/template.hbs +++ b/app/imaging/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- {{t 'imaging.messages.delete'}} + {{t 'messages.delete_singular' name=(t models.imaging.request.singular) }}
{{/modal-dialog}} diff --git a/app/inc-category/delete/template.hbs b/app/inc-category/delete/template.hbs index 423bc10579..8c05448025 100644 --- a/app/inc-category/delete/template.hbs +++ b/app/inc-category/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- {{t 'incident.messages.deleteCategory' name=model.incidentCategoryName}} + {{t 'messages.delete' name=model.incidentCategoryName}}
{{/modal-dialog}} diff --git a/app/inc-category/edit/controller.js b/app/inc-category/edit/controller.js index a703c6c104..fd887cdf29 100644 --- a/app/inc-category/edit/controller.js +++ b/app/inc-category/edit/controller.js @@ -36,7 +36,8 @@ export default AbstractEditController.extend({ showDeleteItem(item) { let i18n = get(this, 'i18n'); - let message = i18n.t('incident.messages.deleteItem'); + let modelName = i18n.t('models.item.names.singular'); + let message = i18n.t('messages.delete_singular', { name: modelName }); let title = i18n.t('incident.titles.deleteItem'); this.displayConfirm(title, message, 'deleteItem', Ember.Object.create({ itemToDelete: item diff --git a/app/incident/delete/template.hbs b/app/incident/delete/template.hbs index d04c76ffae..4489e1c5b6 100644 --- a/app/incident/delete/template.hbs +++ b/app/incident/delete/template.hbs @@ -4,6 +4,6 @@ updateButtonAction=updateButtonAction updateButtonText=updateButtonText}}
- {{t 'incident.messages.deleteIncident' name=name}} + {{t 'messages.delete_singular' name=(t 'models.incident.names.singular')}}
{{/modal-dialog}} diff --git a/app/incident/edit/controller.js b/app/incident/edit/controller.js index d32b177d3b..3c33da8306 100644 --- a/app/incident/edit/controller.js +++ b/app/incident/edit/controller.js @@ -205,7 +205,8 @@ export default AbstractEditController.extend(IncidentStatuses, FriendlyId, Patie showDeleteAttachment(attachment) { let i18n = get(this, 'i18n'); - let message = i18n.t('incident.messages.deleteAttachment'); + let modelName = i18n.t('models.attachment.names.singular'); + let message = i18n.t('messages.delete_singular', { name: modelName }); let model = Ember.Object.create({ itemToDelete: attachment }); diff --git a/app/incident/note/delete/template.hbs b/app/incident/note/delete/template.hbs index 231d3b91da..4b4f2862a6 100644 --- a/app/incident/note/delete/template.hbs +++ b/app/incident/note/delete/template.hbs @@ -1,6 +1,6 @@ {{#modal-dialog isUpdateDisabled=isUpdateDisabled title=title updateButtonAction=updateButtonAction updateButtonText=updateButtonText}}
- {{t 'incident.messages.deleteNote'}} + {{t 'messages.delete_singular' name=(t 'models.note.names.singular')}}
{{/modal-dialog}} diff --git a/app/inventory/delete/template.hbs b/app/inventory/delete/template.hbs index 50c96c396f..a06fa1ba91 100644 --- a/app/inventory/delete/template.hbs +++ b/app/inventory/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
  - {{t 'inventory.messages.delete' name=model.name}} + {{t 'messages.delete' name=model.name}}
{{/modal-dialog}} diff --git a/app/invoices/delete/template.hbs b/app/invoices/delete/template.hbs index 2adb704a9d..4ddde84f38 100644 --- a/app/invoices/delete/template.hbs +++ b/app/invoices/delete/template.hbs @@ -6,6 +6,6 @@ {{#em-form model=model submitButton=false }}{{/em-form}}
- {{t 'billing.alerts.deleteItem' item=model.displayInvoiceNumber}} + {{t 'messages.delete' name=model.displayInvoiceNumber}}
{{/modal-dialog}} diff --git a/app/labs/delete/template.hbs b/app/labs/delete/template.hbs index c4545f9077..823a5e2285 100644 --- a/app/labs/delete/template.hbs +++ b/app/labs/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- {{t 'labs.messages.confirmDeletion'}} + {{t 'messages.delete_singular' name=(t 'models.lab.request.singular')}}
{{/modal-dialog}} diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js index bd0c908b59..a264c24633 100644 --- a/app/locales/en/translations.js +++ b/app/locales/en/translations.js @@ -178,7 +178,6 @@ export default { dischargeReportFormType: 'Discharge Report' }, messages: { - deleteForm: 'Are you sure you want to delete this custom form?', formSaved: 'The {{name}} form has been saved.' }, titles: { @@ -244,9 +243,6 @@ export default { visitLocationList: 'Visit Locations', visitTypes: 'Visit Types', wardPricingTypes: 'Ward Pricing Types', - messages: { - deleteLookupValue: 'Are you sure you want to delete the {{value}} value?' - }, titles: { deleteLookupValue: 'Delete Value' } @@ -467,7 +463,6 @@ export default { createNewRecord: 'Create a new record?', createNewUser: 'Create a new user?', noUsersFound: 'No users found.', - areYouSureDelete: 'Are you sure you wish to delete the user {{user}}?', userHasBeenSaved: 'The user has been saved.', userSaved: 'User Saved', onBehalfOf: 'on behalf of', @@ -477,7 +472,10 @@ export default { forAuthorizedPersons: 'This report is for authorized persons only.', requiredFieldsCorrectErrors: 'Please fill in required fields (marked with *) and correct the errors before saving.', saveActionException: 'An error occurred while attempting to save: {{message}}', - reportError: 'An error was encountered while generating the requested report. Please let your system administrator know that you have encountered an error.' + reportError: 'An error was encountered while generating the requested report. Please let your system administrator know that you have encountered an error.', + delete: 'Are you sure you wish to delete {{name}}?', + delete_singular: 'Are you sure you wish to delete this {{name}}?', + delete_plural: 'Are you sure you wish to delete these {{name}}?' }, alerts: { pleaseWait: 'Please Wait', @@ -655,7 +653,6 @@ export default { messages: { adjust: 'Please adjust the quantities on the appropriate location(s) to account for the difference of {{difference}}.', createRequest: 'Create a new request?', - delete: 'Are you sure you wish to delete {{name}}?', itemNotFound: 'The inventory item {{item}} could not be found.
If you would like to create a new inventory item, fill in the information below.
Otherwise, press the Cancel button to return.', loading: 'Loading transactions ...', purchaseSaved: 'The inventory purchases have been successfully saved.', @@ -743,7 +740,6 @@ export default { addNewVisit: '--Add New Visit--' }, messages: { - delete: 'Are you sure you wish to delete this imaging request?', noCompleted: 'No completed items found.' }, titles: { @@ -812,11 +808,6 @@ export default { attachmentFileRequired: 'Please upload a file or take a picture or before saving this attachment.', createNew: 'Create a new incident?', createNewIncidentCategory: 'Create a new Incident Category?', - deleteAttachment: 'Are you sure you wish to delete this attachment?', - deleteCategory: 'Are you sure you wish to delete {{name}}?', - deleteIncident: 'Are you sure you wish to delete this incident?', - deleteItem: 'Are you sure you want to delete this item?', - deleteNote: 'Are you sure you wish to delete this note?', fillIn: 'Fill in the above options to calculate score', incidentCategorySaved: 'The {{name}} category has been saved.', noClosedIncidents: 'No closed incidents found.', @@ -872,8 +863,7 @@ export default { newMedicationRequest: 'New Medication Request' }, messages: { - createNew: 'Create a new medication request?', - confirmDeletion: 'Are you sure you wish to delete this medication request?' + createNew: 'Create a new medication request?' }, labels: { refills: 'Refills', @@ -907,7 +897,6 @@ export default { calendarTitle: 'Appointments Calendar', messages: { appointmentSaved: 'The appointment for {{patient}} has been saved.', - deleteAppointmentMessage: 'Are you sure you wish to delete this appointment?', endTimeLaterThanStart: 'Please select an end time later than the start time.' }, buttons: { @@ -926,9 +915,6 @@ export default { } }, vitals: { - messages: { - delete: 'Are you sure you wish to delete these vitals?' - }, labels: { dateRecorded: 'Date Recorded', temperature: 'Temperature', @@ -953,7 +939,6 @@ export default { visitSaved: 'Visit Saved' }, messages: { - delete: 'Are you sure you wish to delete this visit?', checkOut: 'Are you sure you wish to check out {{patientName}}?', checkedOut: '{{patientName}} has been checked out.', discharged: '{{patientName}} has been discharged.', @@ -1022,7 +1007,6 @@ export default { messages: { noItemsFound: 'No labs found.', createNewRecord: 'Create a new record?', - confirmDeletion: 'Are you sure you wish to delete this lab request?', noCompleted: 'No completed items found.' }, buttons: { @@ -1085,7 +1069,6 @@ export default { }, messages: { areYouSureDelete: 'Are you sure you want to delete this {{object}}?', - deletePatient: 'Are you sure you wish to delete {{firstName}} {{lastName}}?', noPatientsFound: 'No patients found.', savedPatient: 'The patient record for {{displayName}} has been saved.', notFoundQuickAdd: 'The patient {{patientFullName}} could not be found. If you would like to create a new patient, fill in the information below. Otherwise press the Cancel button to return.', @@ -1168,7 +1151,6 @@ export default { billing: { alerts: { noInvoiceFound: 'No invoices found', - deleteItem: 'Are you sure you wish to delete {{item}}?', noPricingItems: 'No pricing items found.', noPricingProfiles: 'No pricing profiles found.' }, @@ -1232,8 +1214,6 @@ export default { medicationUsed: 'Medication Used' }, messages: { - deleteMedication: 'Are you sure you want to delete this medication?', - delete: 'Are you sure you wish to delete this procedure?', saved: 'The procedure record has been saved.' }, buttons: { @@ -1476,6 +1456,91 @@ export default { type: 'Type', notes: 'Notes', appointmentDate: 'Date' + }, + names: { + singular: 'appointment', + plural: 'appointments' + } + }, + attachment: { + names: { + singular: 'attachment', + plural: 'attachments' + } + }, + form: { + names: { + singular: 'form', + plural: 'forms' + } + }, + incident: { + names: { + singular: 'incident', + plural: 'incidents' + } + }, + item: { + names: { + singular: 'item', + plural: 'items' + } + }, + imaging: { + request: { + singular: 'imaging request', + plural: 'imaging requests' + }, + names: 'imaging' + }, + medication: { + request: { + singular: 'medication request', + plural: 'medication requests' + }, + names: { + singular: 'medication', + plural: 'medications' + } + }, + note: { + names: { + singular: 'note', + plural: 'notes' + } + }, + lab: { + request: { + singular: 'lab request', + plural: 'lab requests' + }, + names: { + singular: 'lab', + plural: 'labs' + } + }, + procedure: { + names: { + singular: 'procedure', + plural: 'procedures' + } + }, + user: { + names: { + singular: 'user', + plural: 'users' + } + }, + visit: { + names: { + singular: 'visit', + plural: 'visits' + } + }, + vital: { + names: { + singular: 'vital', + plural: 'vitals' } }, patient: { diff --git a/app/medication/delete/template.hbs b/app/medication/delete/template.hbs index 9a074340fb..83e4a046d2 100644 --- a/app/medication/delete/template.hbs +++ b/app/medication/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- {{t 'medication.messages.confirmDeletion'}} + {{t 'messages.delete_singular' name=(t 'models.medication.request.singular')}}
{{/modal-dialog}} diff --git a/app/patients/delete/template.hbs b/app/patients/delete/template.hbs index fad91fb92b..b24642caaa 100644 --- a/app/patients/delete/template.hbs +++ b/app/patients/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- {{t 'patients.messages.deletePatient' firstName=model.firstName lastName=model.lastName}} + {{t 'messages.delete' name=model.shortDisplayName}}
{{/modal-dialog}} diff --git a/app/pricing/delete/template.hbs b/app/pricing/delete/template.hbs index 8606bb6000..3b288441b6 100644 --- a/app/pricing/delete/template.hbs +++ b/app/pricing/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- {{t 'billing.alerts.deleteItem' item=model.name}} + {{t 'messages.delete' name=model.name}}
{{/modal-dialog}} diff --git a/app/procedures/edit/controller.js b/app/procedures/edit/controller.js index 7e38db1f11..5c734addf6 100644 --- a/app/procedures/edit/controller.js +++ b/app/procedures/edit/controller.js @@ -83,7 +83,8 @@ export default AbstractEditController.extend(ChargeActions, PatientSubmodule, { closeModalOnConfirm: false, confirmAction: 'deleteCharge', title: this.get('i18n').t('procedures.titles.deleteMedicationUsed'), - message: this.get('i18n').t('procedures.messages.deleteMedication'), + name: this.get('i18n').t('models.medication.names.singular'), + message: this.get('i18n').t('messages.delete_singular', { name: this.name }), chargeToDelete: charge, updateButtonAction: 'confirm', updateButtonText: this.get('i18n').t('buttons.ok') diff --git a/app/users/delete/template.hbs b/app/users/delete/template.hbs index 2b740fb8d7..dad2024aef 100644 --- a/app/users/delete/template.hbs +++ b/app/users/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- {{t 'messages.areYouSureDelete' user=model.name}} + {{t 'messages.delete'}}
{{/modal-dialog}} diff --git a/app/visits/delete/template.hbs b/app/visits/delete/template.hbs index b0405e164a..b0094bd6af 100644 --- a/app/visits/delete/template.hbs +++ b/app/visits/delete/template.hbs @@ -5,7 +5,7 @@ updateButtonText=updateButtonText }}
- {{t 'visits.messages.delete'}} + {{t 'messages.delete_singular' name=(t 'models.visit.names.singular')}}
diff --git a/app/visits/procedures/delete/template.hbs b/app/visits/procedures/delete/template.hbs index 77ae629918..31093a0dc0 100644 --- a/app/visits/procedures/delete/template.hbs +++ b/app/visits/procedures/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- {{t "procedures.messages.delete"}} + {{t "messages.delete_singular" name=(t 'models.procedure.names.singular')}}
{{/modal-dialog}} diff --git a/app/visits/vitals/delete/template.hbs b/app/visits/vitals/delete/template.hbs index 3d6eeb7efb..5c2f331010 100644 --- a/app/visits/vitals/delete/template.hbs +++ b/app/visits/vitals/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- {{t "vitals.messages.delete"}} + {{t "messages.delete_plural" name=(t 'models.vital.names.plural')}}
{{/modal-dialog}} diff --git a/tests/acceptance/users-test.js b/tests/acceptance/users-test.js index 2fe3d4e189..da8984d9f5 100644 --- a/tests/acceptance/users-test.js +++ b/tests/acceptance/users-test.js @@ -166,7 +166,7 @@ test('delete user', function(assert) { click('button:contains(Delete):last'); waitToAppear('.modal-dialog'); andThen(() => { - assert.equal(find('.alert').text().trim(), 'Are you sure you wish to delete the user joe@donuts.com?', 'User is displayed for deletion'); + assert.equal(find('.alert').text().trim(), 'Are you sure you wish to delete ?', 'User is displayed for deletion'); }); click('button:contains(Delete):last'); andThen(() => {