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

Commit

Permalink
[TRANSLATION] Translated appointments section
Browse files Browse the repository at this point in the history
  • Loading branch information
mellisdesigns committed Mar 5, 2016
1 parent 374c1d1 commit 342a777
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 39 deletions.
2 changes: 1 addition & 1 deletion app/appointments/delete/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
updateButtonText=updateButtonText }}
<div class="alert alert-danger">
<span class="glyphicon glyphicon-warning-sign"></span>
Are you sure you wish to delete this appointment?
{{t 'appointments.messages.delete_appointment_message'}}
</div>
{{/modal-dialog}}
6 changes: 4 additions & 2 deletions app/appointments/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 Ember from 'ember';
import PatientListRoute from 'hospitalrun/mixins/patient-list-route';
import { translationMacro as t } from 'ember-i18n';

export default AbstractEditRoute.extend(PatientListRoute, {
editTitle: 'Edit Appointment',
editTitle: t('appointments.edit_title'),
modelName: 'appointment',
newTitle: 'New Appointment',
newTitle: t('appointments.new_title'),

getNewData: function() {
return Ember.RSVP.resolve({
Expand Down
26 changes: 13 additions & 13 deletions app/appointments/edit/template.hbs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{{#edit-panel editPanelProps=editPanelProps}}
{{#em-form model=model submitButton=false }}
{{#if model.selectPatient}}
{{patient-typeahead property="patientTypeAhead" label="Patient" content=patientList selection=selectedPatient class="required test-patient-input"}}
{{patient-typeahead property="patientTypeAhead" label=(t 'labels.patient') content=patientList selection=selectedPatient class="required test-patient-input"}}
{{else}}
{{patient-summary patient=model.patient returnTo='appointments.edit' returnToContext=model.id disablePatientLink=model.isNew }}
{{/if}}
<div class="row">
{{#if isAdmissionAppointment}}
{{date-picker property="startDate" label="Start Date" showTime=showTime class="col-sm-4 required test-appointment-start"}}
{{date-picker property="endDate" label="End Date" showTime=showTime class="col-sm-4 required test-appointment-end"}}
{{date-picker property="startDate" label=(t 'labels.start_date') showTime=showTime class="col-sm-4 required test-appointment-start"}}
{{date-picker property="endDate" label=(t 'labels.end_date') showTime=showTime class="col-sm-4 required test-appointment-end"}}
{{else}}
{{date-picker property="appointmentDate" label="Date" class="col-sm-4 required test-appointment-date"}}
{{date-picker property="appointmentDate" label=(t 'labels.date') class="col-sm-4 required test-appointment-date"}}
{{#unless isAllDay}}
<div class="form-group col-sm-3 required">
<label class="control-label" for="startTime">Start Time</label>
<label class="control-label" for="startTime">{{t 'labels.start_time'}}</label>
<div class="input-group">
{{select-list
content=hourList
Expand All @@ -34,7 +34,7 @@
</div>
</div>
<div class="form-group col-sm-3 required has-feedback {{if endTimeHasError 'has-error'}}">
<label class="control-label" for="endTime">End Time</label>
<label class="control-label" for="endTime">{{t 'labels.end_time'}}</label>
<div class="input-group">
{{select-list
content=hourList
Expand All @@ -54,31 +54,31 @@
}}
</div>
{{#if endTimeHasError}}
<p class="help-block">Please select an end time later than the start time.</p>
<p class="help-block">{{t 'appointments.messages.end_time_later_than_start'}}</p>
{{/if}}
</div>
{{/unless}}
{{/if}}
{{em-checkbox label="All Day" property="allDay" class="col-sm-2"}}
{{em-checkbox label=(t 'labels.all_day') property="allDay" class="col-sm-2"}}
</div>
<div class="row">
{{em-select class="col-sm-6 required test-appointment-type" label="Type"
{{em-select class="col-sm-6 required test-appointment-type" label=(t 'labels.type')
property="appointmentType" content=visitTypes
}}
{{select-or-typeahead className="col-sm-6 test-appointment-with" property="provider"
label="With" list=physicianList
label=(t 'labels.with') list=physicianList
selection=model.provider
}}
</div>
<div class="row">
{{select-or-typeahead className="col-sm-6 required test-appointment-location" property="location"
label="Location" list=locationList
label=(t 'labels.location') list=locationList
selection=model.location
}}
{{em-select class="col-sm-3 test-appointment-status" property="status"
label="Status" content=appointmentStatuses
label=(t 'labels.status') content=appointmentStatuses
}}
</div>
{{em-text label="Notes" property="notes" rows=3 }}
{{em-text label=(t 'labels.notes') property="notes" rows=3 }}
{{/em-form}}
{{/edit-panel}}
4 changes: 3 additions & 1 deletion app/appointments/index/route.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import AbstractIndexRoute from 'hospitalrun/routes/abstract-index-route';
import { translationMacro as t } from 'ember-i18n';

export default AbstractIndexRoute.extend({
editReturn: 'appointments.index',
modelName: 'appointment',
pageTitle: 'Appointments This Week',
pageTitle: t('appointments.this_week'),

_getStartKeyFromItem: function(item) {
var endDate = item.get('endDate'),
Expand Down
10 changes: 5 additions & 5 deletions app/appointments/index/template.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{#item-listing paginationProps=paginationProps }}
<table class="table">
<tr class="table-header">
<th>Date</th>
<th>{{t 'labels.date'}}</th>
<th>{{t 'labels.name'}}</th>
<th>Type</th>
<th>Location</th>
<th>Provider</th>
<th>Status</th>
<th>{{t 'labels.type'}}</th>
<th>{{t 'labels.location'}}</th>
<th>{{t 'labels.provider'}}</th>
<th>{{t 'labels.status'}}</th>
<th>{{t 'labels.actions'}}</th>
</tr>
{{#each model as |appointment|}}
Expand Down
4 changes: 2 additions & 2 deletions app/appointments/item/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<td>{{appointment.displayStatus}}</td>
<td>
{{#if canAddVisit}}
<button class="btn btn-default" {{action 'createVisit' appointment bubbles=false }}>Add Visit</button>
<button class="btn btn-default" {{action 'createVisit' appointment bubbles=false }}>{{t 'buttons.add_visit'}}</button>
{{/if}}
{{#if canEdit}}
<button class="btn btn-default" {{action 'editAppointment' appointment bubbles=false }}>{{t 'labels.edit'}}</button>
{{/if}}
{{#if canDelete}}
<button class="btn btn-default" {{action 'deleteItem' appointment bubbles=false }}>Delete</button>
<button class="btn btn-default" {{action 'deleteItem' appointment bubbles=false }}>{{t 'buttons.delete'}}</button>
{{/if}}
</td>
</tr>
12 changes: 7 additions & 5 deletions app/appointments/route.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import AbstractModuleRoute from 'hospitalrun/routes/abstract-module-route';
import UserSession from 'hospitalrun/mixins/user-session';
import { translationMacro as t } from 'ember-i18n';

export default AbstractModuleRoute.extend(UserSession, {
addCapability: 'add_appointment',
allowSearch: false,
currentScreenTitle: 'Appointment List',
editTitle: 'Edit Appointment',
newTitle: 'New Appointment',
currentScreenTitle: t('appointments.current_screen_title'),
editTitle: t('appointments.edit_title'),
newTitle: t('appointments.new_title'),
moduleName: 'appointments',
newButtonText: '+ new appointment',
sectionTitle: 'Appointments',
newButtonText: t('appointments.buttons.new_button'),
sectionTitle: t('appointments.section_title'),

actions: {
createVisit: function(appointment) {
Expand Down
4 changes: 3 additions & 1 deletion app/appointments/search/route.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import AppointmentIndexRoute from 'hospitalrun/appointments/index/route';
import DateFormat from 'hospitalrun/mixins/date-format';
import Ember from 'ember';
import { translationMacro as t } from 'ember-i18n';

export default AppointmentIndexRoute.extend(DateFormat, {
editReturn: 'appointments.search',
filterParams: ['appointmentType', 'provider', 'status'],
modelName: 'appointment',
pageTitle: 'Search Appointments',
pageTitle: t('appointments.search_title'),

queryParams: {
appointmentType: { refreshModel: true },
Expand Down
12 changes: 6 additions & 6 deletions app/appointments/search/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
{{/em-form}}
</div>
<div class="panel-footer">
<button class="btn btn-default" {{action 'search'}}>Search</button>
<button class="btn btn-default" {{action 'search'}}>{{t 'buttons.search'}}</button>
</div>
</div>
<table class="table">
<tr class="table-header">
{{#sortable-column sortBy='date' sortDesc=sortDesc sortKey=sortKey }}Date{{/sortable-column}}
{{#sortable-column sortBy='date' sortDesc=sortDesc sortKey=sortKey }}{{t 'labels.date'}}{{/sortable-column}}
<th>{{t 'labels.name'}}</th>
{{#sortable-column sortBy='appointmentType' sortDesc=sortDesc sortKey=sortKey }}Type{{/sortable-column}}
{{#sortable-column sortBy='location' sortDesc=sortDesc sortKey=sortKey }}Location{{/sortable-column}}
{{#sortable-column sortBy='provider' sortDesc=sortDesc sortKey=sortKey }}With{{/sortable-column}}
{{#sortable-column sortBy='status' sortDesc=sortDesc sortKey=sortKey }}Status{{/sortable-column}}
{{#sortable-column sortBy='appointmentType' sortDesc=sortDesc sortKey=sortKey }}{{t 'labels.type'}}{{/sortable-column}}
{{#sortable-column sortBy='location' sortDesc=sortDesc sortKey=sortKey }}{{t 'labels.location'}}{{/sortable-column}}
{{#sortable-column sortBy='provider' sortDesc=sortDesc sortKey=sortKey }}{{t 'labels.with'}}{{/sortable-column}}
{{#sortable-column sortBy='status' sortDesc=sortDesc sortKey=sortKey }}{{t 'labels.status'}}{{/sortable-column}}
<th>{{t 'labels.actions'}}</th>
</tr>
{{#each model as |appointment|}}
Expand Down
4 changes: 3 additions & 1 deletion app/appointments/today/route.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import AppointmentIndexRoute from 'hospitalrun/appointments/index/route';
import AbstractModuleRoute from 'hospitalrun/routes/abstract-module-route';
import { translationMacro as t } from 'ember-i18n';
export default AppointmentIndexRoute.extend({
editReturn: 'appointments.today',
modelName: 'appointment',
pageTitle: "Today's Appointments",
pageTitle: t('appointments.today_title'),

_modelQueryParams: function() {
var endOfDay = moment().endOf('day').toDate().getTime(),
Expand Down
28 changes: 26 additions & 2 deletions app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export default {
file_load_successful: 'File To Load Successful',
file_to_Load: 'File Load',
start_time: 'Start Time',
start_date: 'Start Date',
end_time: 'End Time',
end_date: 'End Date',
doc_read: 'Docs Read',
doc_written: 'Docs Written',
display_name: 'Display Name',
Expand All @@ -146,7 +148,12 @@ export default {
bill_to: 'Bill To',
pull_from: 'Pull From',
fulfilled: 'Fulfilled',
delete_request: 'Delete Request'
delete_request: 'Delete Request',
type: 'Type',
location: 'Location',
provider: 'Provider',
with: 'With',
all_day: 'All Day'
},
messages: {
no_items_found: 'No items found.',
Expand Down Expand Up @@ -175,7 +182,8 @@ export default {
load_file: 'Load File',
new_request: 'New Request',
all_requests: 'All Requests',
dispense: 'Dispense'
dispense: 'Dispense',
add_visit: 'Add Visit'
},
login: {
messages: {
Expand Down Expand Up @@ -256,5 +264,21 @@ export default {
saved_message: 'The medication record has been saved.',
fulfilled_title: 'Medication Request Fulfilled'
}
},
appointments: {
current_screen_title: 'Appointment List',
edit_title: 'Edit Appointment',
new_title: 'New Appointment',
section_title: 'Appointments',
this_week: 'Appointments This Week',
search_title: 'Search Appointments',
today_title: 'Today\'s Appointments',
messages: {
delete_appointment_message: 'Are you sure you wish to delete this appointment?',
end_time_later_than_start: 'Please select an end time later than the start time.'
},
buttons: {
new_button: '+ new appointment'
}
}
};

0 comments on commit 342a777

Please sign in to comment.