From c25ec715821dcc06467647f46e57b48fbdeb4b99 Mon Sep 17 00:00:00 2001 From: Mitch Ellis Date: Sat, 5 Mar 2016 23:23:37 +0800 Subject: [PATCH] [TRANSLATION] Translated appointments section --- app/appointments/delete/template.hbs | 2 +- app/appointments/edit/route.js | 6 ++++-- app/appointments/edit/template.hbs | 26 ++++++++++++------------- app/appointments/index/route.js | 4 +++- app/appointments/index/template.hbs | 10 +++++----- app/appointments/item/template.hbs | 4 ++-- app/appointments/route.js | 12 +++++++----- app/appointments/search/route.js | 4 +++- app/appointments/search/template.hbs | 12 ++++++------ app/appointments/today/route.js | 3 ++- app/locales/en/translations.js | 29 ++++++++++++++++++++++++++-- 11 files changed, 73 insertions(+), 39 deletions(-) diff --git a/app/appointments/delete/template.hbs b/app/appointments/delete/template.hbs index 5683883911..a6d0c9a054 100644 --- a/app/appointments/delete/template.hbs +++ b/app/appointments/delete/template.hbs @@ -5,6 +5,6 @@ updateButtonText=updateButtonText }}
- Are you sure you wish to delete this appointment? + {{t 'appointments.messages.delete_appointment_message'}}
{{/modal-dialog}} diff --git a/app/appointments/edit/route.js b/app/appointments/edit/route.js index d5f3a054e9..1fb59c5656 100644 --- a/app/appointments/edit/route.js +++ b/app/appointments/edit/route.js @@ -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({ diff --git a/app/appointments/edit/template.hbs b/app/appointments/edit/template.hbs index 9b8694548a..0c93575c6d 100644 --- a/app/appointments/edit/template.hbs +++ b/app/appointments/edit/template.hbs @@ -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}}
{{#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}}
- +
{{select-list content=hourList @@ -34,7 +34,7 @@
- +
{{select-list content=hourList @@ -54,31 +54,31 @@ }}
{{#if endTimeHasError}} -

Please select an end time later than the start time.

+

{{t 'appointments.messages.end_time_later_than_start'}}

{{/if}}
{{/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"}}
- {{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 }}
{{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 }}
- {{em-text label="Notes" property="notes" rows=3 }} + {{em-text label=(t 'labels.notes') property="notes" rows=3 }} {{/em-form}} {{/edit-panel}} diff --git a/app/appointments/index/route.js b/app/appointments/index/route.js index 5568033e2d..79dbf2df61 100644 --- a/app/appointments/index/route.js +++ b/app/appointments/index/route.js @@ -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'), diff --git a/app/appointments/index/template.hbs b/app/appointments/index/template.hbs index 88c3352e9d..092239d10a 100644 --- a/app/appointments/index/template.hbs +++ b/app/appointments/index/template.hbs @@ -1,12 +1,12 @@ {{#item-listing paginationProps=paginationProps }} - + - - - - + + + + {{#each model as |appointment|}} diff --git a/app/appointments/item/template.hbs b/app/appointments/item/template.hbs index dae64f4805..f8d4487102 100644 --- a/app/appointments/item/template.hbs +++ b/app/appointments/item/template.hbs @@ -9,13 +9,13 @@ diff --git a/app/appointments/route.js b/app/appointments/route.js index b5532a3d12..0000df0c6b 100644 --- a/app/appointments/route.js +++ b/app/appointments/route.js @@ -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) { diff --git a/app/appointments/search/route.js b/app/appointments/search/route.js index d0ca6eb747..8435caec9e 100644 --- a/app/appointments/search/route.js +++ b/app/appointments/search/route.js @@ -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 }, diff --git a/app/appointments/search/template.hbs b/app/appointments/search/template.hbs index fff0f67473..9ad4d188c4 100644 --- a/app/appointments/search/template.hbs +++ b/app/appointments/search/template.hbs @@ -19,17 +19,17 @@ {{/em-form}}
Date{{t 'labels.date'}} {{t 'labels.name'}}TypeLocationProviderStatus{{t 'labels.type'}}{{t 'labels.location'}}{{t 'labels.provider'}}{{t 'labels.status'}} {{t 'labels.actions'}}
{{appointment.displayStatus}} {{#if canAddVisit}} - + {{/if}} {{#if canEdit}} {{/if}} {{#if canDelete}} - + {{/if}}
- {{#sortable-column sortBy='date' sortDesc=sortDesc sortKey=sortKey }}Date{{/sortable-column}} + {{#sortable-column sortBy='date' sortDesc=sortDesc sortKey=sortKey }}{{t 'labels.date'}}{{/sortable-column}} - {{#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}} {{#each model as |appointment|}} diff --git a/app/appointments/today/route.js b/app/appointments/today/route.js index 21a803f704..0d349e7725 100644 --- a/app/appointments/today/route.js +++ b/app/appointments/today/route.js @@ -1,8 +1,9 @@ import AppointmentIndexRoute from 'hospitalrun/appointments/index/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(), diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js index 6c48f877ad..4e73eb5137 100644 --- a/app/locales/en/translations.js +++ b/app/locales/en/translations.js @@ -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', @@ -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.', @@ -175,7 +182,9 @@ export default { load_file: 'Load File', new_request: 'New Request', all_requests: 'All Requests', - dispense: 'Dispense' + dispense: 'Dispense', + add_visit: 'Add Visit', + search: 'Search' }, login: { messages: { @@ -256,5 +265,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' + } } };
{{t 'labels.name'}}{{t 'labels.actions'}}