From a21673142c93545efb2a63c16ef24038ac9149b9 Mon Sep 17 00:00:00 2001 From: Rodolfo Ghiggi Date: Thu, 9 Feb 2017 19:40:20 -0200 Subject: [PATCH] Refactor patientTypes to use i18n (#936) * Refactor patientTypes to use i18n * Refactor patientTypes to use i18n, resolve the travis reported erros --- app/locales/en/translations.js | 4 +++- app/locales/pt-br/translations.js | 7 +++++-- app/patients/edit/controller.js | 14 ++++++++++---- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js index 472bfa93c7..10cb731278 100644 --- a/app/locales/en/translations.js +++ b/app/locales/en/translations.js @@ -1010,7 +1010,9 @@ export default { parent: 'Parent/Guardian', contacts: 'Contacts', sexNotEntered: 'Sex Not Entered', - operativePlan: 'Operative Plan' + operativePlan: 'Operative Plan', + patientTypeCharity: 'Charity', + patientTypePrivate: 'Private' }, notes: { newNote: 'New Note for', diff --git a/app/locales/pt-br/translations.js b/app/locales/pt-br/translations.js index f781fb31d0..99896749b2 100755 --- a/app/locales/pt-br/translations.js +++ b/app/locales/pt-br/translations.js @@ -708,7 +708,8 @@ export default { addDiagnosis: 'Adicionar Diagnóstico', newImaging: 'Nova Imagem', newMedication: 'Nova Medicação', - newVitals: 'Novos Sinais Vitais' + newVitals: 'Novos Sinais Vitais', + checkIn: 'Entrada' }, labels: { diagnosis: 'Diagnósticos', @@ -842,7 +843,9 @@ export default { referredBy: 'Indicado Por', referredDate: 'Data de Indicação', religion: 'Religião', - parent: 'Responsável Legal' + parent: 'Responsável Legal', + patientTypeCharity: 'Caridade', + patientTypePrivate: 'Privado' }, notes: { newNote: 'Nova Nota para', diff --git a/app/patients/edit/controller.js b/app/patients/edit/controller.js index 93560580ae..0e7eacddc9 100644 --- a/app/patients/edit/controller.js +++ b/app/patients/edit/controller.js @@ -81,10 +81,16 @@ export default AbstractEditController.extend(BloodTypes, DiagnosisActions, Retur return this.currentUserCan('delete_visit'); }.property(), - patientTypes: [ - 'Charity', - 'Private' - ], + patientTypes: Ember.computed(function() { + let i18n = get(this, 'i18n'); + let types = [ + 'Charity', + 'Private' + ]; + return types.map((type) => { + return i18n.t(`patients.labels.patientType${type}`); + }); + }), config: Ember.inject.service(), filesystem: Ember.inject.service(),