From 883236f5d7f80f14fe8b2914a9017f4f794bc8df Mon Sep 17 00:00:00 2001 From: billybonks Date: Sat, 18 Jun 2016 16:04:36 +0200 Subject: [PATCH] Translate procedures --- app/locales/en/translations.js | 22 ++++++++++++++++++++++ app/procedures/charge/controller.js | 4 ++-- app/procedures/charge/template.hbs | 4 ++-- app/procedures/edit/controller.js | 16 ++++++++-------- app/procedures/edit/route.js | 6 ++++-- app/procedures/edit/template.hbs | 8 ++++---- app/procedures/medication/controller.js | 4 ++-- app/procedures/medication/template.hbs | 4 ++-- 8 files changed, 46 insertions(+), 22 deletions(-) diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js index 8f0913ac37..0d910a7b5f 100644 --- a/app/locales/en/translations.js +++ b/app/locales/en/translations.js @@ -756,5 +756,27 @@ export default { discount_amount: 'Discount Amount', discount_percentage: 'Discount Percentage' } + }, + procedures: { + titles: { + add_charge_item: 'Add Charge Item', + delete_charge_item: 'Edit Charge Item', + medication_used: 'Medication Used', + delete_medication_used: 'Delete Medication Used', + add_medication_used: 'Add Medication Used', + edit_medication_used: 'Edit Medication Used', + edit: 'Edit Procedure', + saved: 'Procedure Saved', + new: 'New Procedure' + }, + lables: { + medication_used: 'Medication Used' + }, + messages: { + delete_medication: 'Are you sure you want to delete this medication?' + }, + buttons: { + add_medication: 'Add Medication' + } } }; diff --git a/app/procedures/charge/controller.js b/app/procedures/charge/controller.js index 5db2e4ec69..d8a645f62d 100644 --- a/app/procedures/charge/controller.js +++ b/app/procedures/charge/controller.js @@ -38,9 +38,9 @@ export default AbstractEditController.extend({ title: function() { var isNew = this.get('model.isNew'); if (isNew) { - return 'Add Charge Item'; + return this.get('i18n').t('procedures.titles.add_charge_item'); } - return 'Edit Charge Item'; + return this.get('i18n').t('procedures.titles.edit_charge_item'); }.property('model.isNew'), beforeUpdate: function() { diff --git a/app/procedures/charge/template.hbs b/app/procedures/charge/template.hbs index bc78cc2529..95893b705e 100644 --- a/app/procedures/charge/template.hbs +++ b/app/procedures/charge/template.hbs @@ -5,9 +5,9 @@ updateButtonAction=updateButtonAction updateButtonText=updateButtonText }} {{#em-form model=model submitButton=false }} - {{pricing-typeahead property="itemName" label="Item" content=pricingList selection=selectedItem class="required"}} + {{pricing-typeahead property="itemName" label=(t 'labels.item') content=pricingList selection=selectedItem class="required"}}
- {{em-input label="Quantity" property="quantity" class="col-xs-3 required"}} + {{em-input label=(t 'labels.quantity') property="quantity" class="col-xs-3 required"}} {{date-picker property="dateCharged" label="Date Charged" class="col-xs-4 required"}}
{{/em-form}} diff --git a/app/procedures/edit/controller.js b/app/procedures/edit/controller.js index b6a06889ae..6ae1e9090f 100644 --- a/app/procedures/edit/controller.js +++ b/app/procedures/edit/controller.js @@ -58,9 +58,9 @@ export default AbstractEditController.extend(ChargeActions, PatientSubmodule, { title: function() { var isNew = this.get('model.isNew'); if (isNew) { - return 'Add Procedure'; + return this.get('i18n').t('procedures.titles.add'); } - return 'Edit Procedure'; + return this.get('i18n').t('procedures.titles.edit');; }.property('model.isNew'), updateCapability: 'add_charge', @@ -82,11 +82,11 @@ export default AbstractEditController.extend(ChargeActions, PatientSubmodule, { showDeleteMedication: function(charge) { this.send('openModal', 'dialog', Ember.Object.create({ confirmAction: 'deleteCharge', - title: 'Delete Medication Used', - message: 'Are you sure you want to delete this medication?', + title: this.get('i18n').t('procedures.titles.delete_medication_used'), + message: this.get('i18n').t('procedures.messages.delete_medication'), chargeToDelete: charge, - updateButtonAction: 'confirm', - updateButtonText: 'Ok' + updateButtonAction: this.get('i18n').t('buttons.confirm'), + updateButtonText: this.get('i18n').t('buttons.ok') })); } }, @@ -104,8 +104,8 @@ export default AbstractEditController.extend(ChargeActions, PatientSubmodule, { }, afterUpdate: function() { - var alertTitle = 'Procedure Saved', - alertMessage = 'The procedure record has been saved.'; + var alertTitle = this.get('i18n').t('procedures.titles.saved'), + alertMessage = this.get('i18n').t('procedures.messages.saved'); this.saveVisitIfNeeded(alertTitle, alertMessage); } }); diff --git a/app/procedures/edit/route.js b/app/procedures/edit/route.js index 09441f9081..0b0ab6b578 100644 --- a/app/procedures/edit/route.js +++ b/app/procedures/edit/route.js @@ -1,10 +1,12 @@ import AbstractEditRoute from 'hospitalrun/routes/abstract-edit-route'; import ChargeRoute from 'hospitalrun/mixins/charge-route'; import Ember from 'ember'; +import { translationMacro as t } from 'ember-i18n'; + export default AbstractEditRoute.extend(ChargeRoute, { - editTitle: 'Edit Procedure', + editTitle: t('procedure.titles.edit'), modelName: 'procedure', - newTitle: 'New Procedure', + newTitle: t('procedure.titles.new'), pricingCategory: 'Procedure', database: Ember.inject.service(), diff --git a/app/procedures/edit/template.hbs b/app/procedures/edit/template.hbs index 9701720e85..77aeed475e 100644 --- a/app/procedures/edit/template.hbs +++ b/app/procedures/edit/template.hbs @@ -44,10 +44,10 @@

- Medication Used + {{t 'procedures.titles.medication_used'}} {{#if canAddCharge}} {{/if}}

@@ -55,7 +55,7 @@
- + @@ -70,7 +70,7 @@ {{/if}} {{#if canAddCharge}} {{/if}} diff --git a/app/procedures/medication/controller.js b/app/procedures/medication/controller.js index eed546a74c..456c173190 100644 --- a/app/procedures/medication/controller.js +++ b/app/procedures/medication/controller.js @@ -13,9 +13,9 @@ export default AbstractEditController.extend(InventorySelection, { title: function() { var isNew = this.get('model.isNew'); if (isNew) { - return 'Add Medication Used'; + return this.get('i18n').t('procedures.titles.add_medication_used'); } - return 'Edit Medication Used'; + return this.get('i18n').t('procedures.titles.edit_medication_used'); }.property('model.isNew'), beforeUpdate: function() { diff --git a/app/procedures/medication/template.hbs b/app/procedures/medication/template.hbs index 0a390a8500..3d0525b2c3 100644 --- a/app/procedures/medication/template.hbs +++ b/app/procedures/medication/template.hbs @@ -5,7 +5,7 @@ updateButtonAction=updateButtonAction updateButtonText=updateButtonText }} {{#em-form model=model submitButton=false }} - {{inventory-typeahead property="itemName" label="Medication Used" content=medicationList selection=selectedInventoryItem }} - {{em-input label="Quantity" property="quantity" class="required"}} + {{inventory-typeahead property="itemName" label=(t 'procedures.labels.medication_used') content=medicationList selection=selectedInventoryItem }} + {{em-input label=(t 'labels.quantity') property="quantity" class="required"}} {{/em-form}} {{/modal-dialog}}
Item{{t 'labels.item'}} {{t 'labels.quantity'}} {{t 'labels.action'}}