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

Commit

Permalink
Refactor patientTypes to use i18n (#936)
Browse files Browse the repository at this point in the history
* Refactor patientTypes to use i18n

* Refactor patientTypes to use i18n, resolve the travis reported erros
  • Loading branch information
rodolfoghi authored and jkleinsc committed Feb 9, 2017
1 parent 901b216 commit a216731
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
4 changes: 3 additions & 1 deletion app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
7 changes: 5 additions & 2 deletions app/locales/pt-br/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
14 changes: 10 additions & 4 deletions app/patients/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit a216731

Please sign in to comment.