Skip to content

Commit

Permalink
Merge pull request #9 from NunopRolo/Fix-generic-field
Browse files Browse the repository at this point in the history
Fixed the generic field in the frontend
  • Loading branch information
NunopRolo authored Jul 31, 2024
2 parents 556cbf7 + ab02654 commit 25b7af5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<ngb-highlight [result]="medicine.dosage" [term]="filter.value" />
</td>
<td>
<ngb-highlight [result]="medicine.generic" [term]="filter.value" />
<ngb-highlight [result]="translateGenericValue(medicine.generic)" [term]="filter.value" />
</td>
<td>
<ngb-highlight [result]="medicine.internationalCommonName" [term]="filter.value" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,8 @@ export class MedicinesTableComponent implements OnInit{
)
}
}

translateGenericValue(generic: string){
return this.translateService.instant("medicine."+generic);
}
}
4 changes: 3 additions & 1 deletion medicines-frontend/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"notification": {
"title": "Medicine",
"medicine-not-found": "Medicine Not Found"
}
},
"false": "No",
"true": "Yes"
},
"medication": {
"add-modal": {
Expand Down
4 changes: 3 additions & 1 deletion medicines-frontend/src/assets/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"notification": {
"title": "Medicamentos",
"medicine-not-found": "Medicamento não encontrado"
}
},
"false": "Não",
"true": "Sim"
},
"medication": {
"add-modal": {
Expand Down

0 comments on commit 25b7af5

Please sign in to comment.