From 0b5b052b5473052da6590f9a135f549032c80f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Puiggen=C3=A9?= Date: Wed, 15 Nov 2023 10:36:47 +0100 Subject: [PATCH] Localize death dagger symbol --- src/senaite/patient/browser/patientfolder.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/senaite/patient/browser/patientfolder.py b/src/senaite/patient/browser/patientfolder.py index 2a901b5..c2e5daf 100644 --- a/src/senaite/patient/browser/patientfolder.py +++ b/src/senaite/patient/browser/patientfolder.py @@ -20,14 +20,13 @@ import collections from bika.lims import api -from bika.lims import senaiteMessageFactory as _ from bika.lims.interfaces import IClient from bika.lims.utils import get_email_link from bika.lims.utils import get_image from bika.lims.utils import get_link from senaite.app.listing.view import ListingView from senaite.core.api import dtime -from senaite.patient import messageFactory as _sp +from senaite.patient import messageFactory as _ from senaite.patient.api import to_identifier_type_name from senaite.patient.api import tuplify_identifiers from senaite.patient.catalog import PATIENT_CATALOG @@ -67,7 +66,7 @@ def __init__(self, context, request): self.icon = "{}/{}".format( self.portal_url, "senaite_theme/icon/patientfolder") - self.title = _sp("Patients") + self.title = _("Patients") self.description = self.context.Description() self.show_select_column = True self.pagesize = 25 @@ -164,7 +163,7 @@ def folderitem(self, obj, item, index): mrn = obj.getMRN() if not mrn: item["before"]["mrn"] = get_image("info", width=16) - mrn = t(_sp("mrn_not_defined", default="Not defined")) + mrn = t(_("mrn_not_defined", default="Not defined")) item["mrn"] = self.to_utf8(mrn) item["replace"]["mrn"] = get_link(url, value=mrn) @@ -175,15 +174,18 @@ def folderitem(self, obj, item, index): self.get_identifier_tags(identifiers)) # Fullname - fullname_nd = t(_sp("fullname_not_defined", default="Not defined")) + fullname_nd = t(_("fullname_not_defined", default="Not defined")) fullname = obj.getFullname() or fullname_nd fullname = api.safe_unicode(fullname).encode("utf8") + item["fullname"] = fullname # Death dagger if obj.getDeceased(): - fullname = "{} ".format(fullname) - - item["fullname"] = fullname + fullname = t(_( + "patient_fullname_deceased_html", + default="${fullname} ", + mapping={"fullname": fullname} + )) item["replace"]["fullname"] = get_link(url, value=fullname) # Email