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

Refactor patientTypes to use i18n #936

Merged
merged 2 commits into from
Feb 9, 2017
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
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