Skip to content

Commit

Permalink
Fix sex and gender are not translated properly
Browse files Browse the repository at this point in the history
  • Loading branch information
xispa committed Dec 3, 2023
1 parent 8221633 commit 9f1633b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/senaite/patient/content/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from senaite.patient.catalog import PATIENT_CATALOG
from senaite.patient.config import GENDERS
from senaite.patient.config import SEXES
from senaite.patient.i18n import translate
from senaite.patient.interfaces import IPatient
from six import string_types
from z3c.form.interfaces import NO_VALUE
Expand Down Expand Up @@ -646,7 +647,7 @@ def getSexText(self):
sexes = dict(SEXES)
value = self.getSex()
value = sexes.get(value)
return value.encode("utf-8")
return translate(value)

@security.protected(permissions.ModifyPortalContent)
def setSex(self, value):
Expand All @@ -672,7 +673,7 @@ def getGenderText(self):
genders = dict(GENDERS)
value = self.getGender()
value = genders.get(value)
return value.encode("utf-8")
return translate(value)

@security.protected(permissions.ModifyPortalContent)
def setGender(self, value):
Expand Down

0 comments on commit 9f1633b

Please sign in to comment.