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

Translate procedures #516

Merged
merged 1 commit into from
Jun 18, 2016
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
22 changes: 22 additions & 0 deletions app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
};
4 changes: 2 additions & 2 deletions app/procedures/charge/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions app/procedures/charge/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}
<div class="row">
{{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"}}
</div>
{{/em-form}}
Expand Down
16 changes: 8 additions & 8 deletions app/procedures/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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')
}));
}
},
Expand All @@ -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);
}
});
6 changes: 4 additions & 2 deletions app/procedures/edit/route.js
Original file line number Diff line number Diff line change
@@ -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(),

Expand Down
8 changes: 4 additions & 4 deletions app/procedures/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@
<div class="panel detail-section">
<div class="panel-heading">
<h3 class="panel-title">
Medication Used
{{t 'procedures.titles.medication_used'}}
{{#if canAddCharge}}
<button class="btn btn-primary align-right" {{action "showAddMedication" bubbles=false }}>
<span class="octicon octicon-plus"></span>Add Medication
<span class="octicon octicon-plus"></span>{{t 'procedures.buttons.add_medication'}}
</button>
{{/if}}
</h3>
</div>
<div class="panel-body detail-section-content">
<table class="table">
<tr class="table-header">
<th>Item</th>
<th>{{t 'labels.item'}}</th>
<th>{{t 'labels.quantity'}}</th>
<th>{{t 'labels.action'}}</th>
</tr>
Expand All @@ -70,7 +70,7 @@
{{/if}}
{{#if canAddCharge}}
<button class="btn btn-default warning" {{action "showDeleteMedication" charge bubbles=false }}>
<span class="octicon octicon-x"></span>Delete
<span class="octicon octicon-x"></span>{{t 'buttons.delete'}}
</button>
{{/if}}
</td>
Expand Down
4 changes: 2 additions & 2 deletions app/procedures/medication/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions app/procedures/medication/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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}}