diff --git a/care/facility/api/serializers/patient_consultation.py b/care/facility/api/serializers/patient_consultation.py index ac2fdf5d00..8defb80443 100644 --- a/care/facility/api/serializers/patient_consultation.py +++ b/care/facility/api/serializers/patient_consultation.py @@ -4,6 +4,7 @@ from django.db import transaction from django.utils import timezone from django.utils.timezone import localtime, make_aware, now +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from rest_framework.exceptions import ValidationError @@ -159,14 +160,14 @@ class PatientConsultationSerializer(serializers.ModelSerializer): many=True, write_only=True, required=False, - help_text="Bulk create diagnoses for the consultation upon creation", + help_text=_("Bulk create diagnoses for the consultation upon creation"), ) diagnoses = ConsultationDiagnosisSerializer(many=True, read_only=True) create_symptoms = EncounterCreateSymptomSerializer( many=True, write_only=True, required=False, - help_text="Bulk create symptoms for the consultation upon creation", + help_text=_("Bulk create symptoms for the consultation upon creation"), ) symptoms = EncounterSymptomSerializer(many=True, read_only=True) medico_legal_case = serializers.BooleanField(default=False, required=False) @@ -222,7 +223,7 @@ def update(self, instance, validated_data): if instance.discharge_date: if "medico_legal_case" not in validated_data: raise ValidationError( - {"consultation": ["Discharged Consultation data cannot be updated"]} + {"consultation": [_("Discharged Consultation data cannot be updated")]} ) instance.medico_legal_case = validated_data.pop("medico_legal_case") instance.save() @@ -309,7 +310,7 @@ def create(self, validated_data): # noqa: PLR0915 PLR0912 raise ValidationError( { "transferred_from_location": [ - "This field is required as the patient has been transferred from another location." + _("This field is required as the patient has been transferred from another location.") ] } ) @@ -323,7 +324,7 @@ def create(self, validated_data): # noqa: PLR0915 PLR0912 raise ValidationError( { "referred_from_facility": [ - "This field is required as the patient has been referred from another facility." + _("This field is required as the patient has been referred from another facility.") ] } ) @@ -334,15 +335,15 @@ def create(self, validated_data): # noqa: PLR0915 PLR0912 raise ValidationError( { "referred_from_facility": [ - "Only one of referred_from_facility and referred_from_facility_external can be set" + _("Only one of referred_from_facility and referred_from_facility_external can be set") ], "referred_from_facility_external": [ - "Only one of referred_from_facility and referred_from_facility_external can be set" + _("Only one of referred_from_facility and referred_from_facility_external can be set") ], } ) else: - raise ValidationError({"route_to_facility": "This field is required"}) + raise ValidationError({"route_to_facility": _("This field is required")}) create_diagnosis = validated_data.pop("create_diagnoses") create_symptoms = validated_data.pop("create_symptoms") @@ -358,7 +359,7 @@ def create(self, validated_data): # noqa: PLR0915 PLR0912 id=self.validated_data["patient"].facility_id ).exists(): raise ValidationError( - {"facility": "Consultation creates are only allowed in home facility"} + {"facility": _("Consultation creates are only allowed in home facility")} ) # End Authorisation Checks @@ -372,13 +373,13 @@ def create(self, validated_data): # noqa: PLR0915 PLR0912 if patient.last_consultation.assigned_to == user: raise ValidationError( { - "Permission Denied": "Only Facility Staff can create consultation for a Patient" + "Permission Denied": _("Only Facility Staff can create consultation for a Patient") }, ) if not patient.last_consultation.discharge_date: raise ValidationError( - {"consultation": "Exists please Edit Existing Consultation"} + {"consultation": _("Exists please Edit Existing Consultation")} ) if validated_data.get("is_kasp"): @@ -482,17 +483,17 @@ def create(self, validated_data): # noqa: PLR0915 PLR0912 def validate_create_diagnoses(self, value): # Reject if create_diagnoses is present for edits if self.instance and value: - msg = "Bulk create diagnoses is not allowed on update" + msg = _("Bulk create diagnoses is not allowed on update") raise ValidationError(msg) # Reject if no diagnoses are provided if len(value) == 0: - msg = "Atleast one diagnosis is required" + msg = _("Atleast one diagnosis is required") raise ValidationError(msg) # Reject if duplicate diagnoses are provided if len(value) != len({obj["diagnosis"].id for obj in value}): - msg = "Duplicate diagnoses are not allowed" + msg = _("Duplicate diagnoses are not allowed") raise ValidationError(msg) principal_diagnosis, confirmed_diagnoses = None, [] @@ -503,7 +504,7 @@ def validate_create_diagnoses(self, value): # Reject if there are more than one principal diagnosis if obj["is_principal"]: if principal_diagnosis: - msg = "Only one diagnosis can be set as principal diagnosis" + msg = _("Only one diagnosis can be set as principal diagnosis") raise ValidationError(msg) principal_diagnosis = obj @@ -514,14 +515,14 @@ def validate_create_diagnoses(self, value): and principal_diagnosis["verification_status"] != ConditionVerificationStatus.CONFIRMED ): - msg = "Only confirmed diagnosis can be set as principal diagnosis if it is present" + msg = _("Only confirmed diagnosis can be set as principal diagnosis if it is present") raise ValidationError(msg) return value def validate_create_symptoms(self, value): if self.instance: - msg = "Bulk create symptoms is not allowed on update" + msg = _("Bulk create symptoms is not allowed on update") raise ValidationError(msg) counter: set[int | str] = set() @@ -532,13 +533,13 @@ def validate_create_symptoms(self, value): if not other_symptom: raise ValidationError( { - "other_symptom": "Other symptom should not be empty when symptom type is OTHERS" + "other_symptom": _("Other symptom should not be empty when symptom type is OTHERS") } ) item: str = other_symptom.strip().lower() if item in counter: # Reject if duplicate symptoms are provided - msg = "Duplicate symptoms are not allowed" + msg = _("Duplicate symptoms are not allowed") raise ValidationError(msg) if not obj.get("cure_date"): # skip duplicate symptom check for ones that has cure date @@ -548,13 +549,13 @@ def validate_create_symptoms(self, value): for obj in value: if obj["onset_date"] > current_time: raise ValidationError( - {"onset_date": "Onset date cannot be in the future"} + {"onset_date": _("Onset date cannot be in the future")} ) if cure_date := obj.get("cure_date"): if cure_date < obj["onset_date"]: raise ValidationError( - {"cure_date": "Cure date should be after onset date"} + {"cure_date": _("Cure date should be after onset date")} ) obj["clinical_impression_status"] = ClinicalImpressionStatus.COMPLETED else: @@ -567,13 +568,13 @@ def validate_encounter_date(self, value): raise ValidationError( { "encounter_date": [ - f"This field value must be greater than {MIN_ENCOUNTER_DATE.strftime('%Y-%m-%d')}" + _("This field value must be greater than {date}").format(date=MIN_ENCOUNTER_DATE.strftime('%Y-%m-%d')) ] } ) if value > now(): raise ValidationError( - {"encounter_date": "This field value cannot be in the future."} + {"encounter_date": _("This field value cannot be in the future.")} ) return value @@ -594,7 +595,7 @@ def validate(self, attrs): # noqa: PLR0912 if suggestion == SuggestionChoices.A and not patient_no: raise ValidationError( - {"patient_no": "This field is required for admission."} + {"patient_no": _("This field is required for admission.")} ) if "suggestion" in validated and validated["suggestion"] not in [ @@ -606,12 +607,12 @@ def validate(self, attrs): # noqa: PLR0912 raise ValidationError( { "treating_physician": [ - "This field is required as the suggestion is not 'Declared Death'" + _("This field is required as the suggestion is not 'Declared Death'") ] } ) if treating_physician.user_type != User.TYPE_VALUE_MAP["Doctor"]: - msg = "Only Doctors can verify a Consultation" + msg = _("Only Doctors can verify a Consultation") raise ValidationError(msg) facility = ( @@ -621,14 +622,14 @@ def validate(self, attrs): # noqa: PLR0912 ) # Check if the Doctor is associated with the Facility (.facilities) if not treating_physician.facilities.filter(id=facility.id).exists(): - msg = "The treating doctor is no longer linked to this facility. Please update the respective field in the form before proceeding." + msg = _("The treating doctor is no longer linked to this facility. Please update the respective field in the form before proceeding.") raise ValidationError(msg) if ( treating_physician.home_facility and treating_physician.home_facility != facility ): - msg = "Home Facility of the Doctor must be the same as the Consultation Facility" + msg = _("Home Facility of the Doctor must be the same as the Consultation Facility") raise ValidationError(msg) if "suggestion" in validated and validated["suggestion"] is SuggestionChoices.R: @@ -638,7 +639,7 @@ def validate(self, attrs): # noqa: PLR0912 raise ValidationError( { "referred_to": [ - f"This field is required as the suggestion is {SuggestionChoices.R}." + _("This field is required as the suggestion is {suggestion}.").format(suggestion=SuggestionChoices.R) ] } ) @@ -655,20 +656,20 @@ def validate(self, attrs): # noqa: PLR0912 raise ValidationError( { "review_interval": [ - "This field is required as the patient has been requested Review." + _("This field is required as the patient has been requested Review.") ] } ) if validated["review_interval"] <= 0: raise ValidationError( - {"review_interval": ["This field value is must be greater than 0."]} + {"review_interval": [_("This field value is must be greater than 0.")]} ) if not self.instance and "create_diagnoses" not in validated: - raise ValidationError({"create_diagnoses": ["This field is required."]}) + raise ValidationError({"create_diagnoses": [_("This field is required.")]}) if not self.instance and "create_symptoms" not in validated: - raise ValidationError({"create_symptoms": ["This field is required."]}) + raise ValidationError({"create_symptoms": [_("This field is required.")]}) return validated @@ -731,10 +732,10 @@ def validate(self, attrs): raise ValidationError( { "referred_to": [ - "Only one of referred_to and referred_to_external can be set" + _("Only one of referred_to and referred_to_external can be set") ], "referred_to_external": [ - "Only one of referred_to and referred_to_external can be set" + _("Only one of referred_to and referred_to_external can be set") ], } ) @@ -744,32 +745,32 @@ def validate(self, attrs): if attrs.get("new_discharge_reason") == NewDischargeReasonEnum.EXPIRED: if not attrs.get("death_datetime"): - raise ValidationError({"death_datetime": "This field is required"}) + raise ValidationError({"death_datetime": _("This field is required")}) if attrs.get("death_datetime") > now(): raise ValidationError( - {"death_datetime": "This field value cannot be in the future."} + {"death_datetime": _("This field value cannot be in the future.")} ) if attrs.get("death_datetime") < self.instance.encounter_date: raise ValidationError( { - "death_datetime": "This field value cannot be before the encounter date." + "death_datetime": _("This field value cannot be before the encounter date.") } ) if not attrs.get("death_confirmed_doctor"): raise ValidationError( - {"death_confirmed_doctor": "This field is required"} + {"death_confirmed_doctor": _("This field is required")} ) attrs["discharge_date"] = attrs["death_datetime"] elif not attrs.get("discharge_date"): - raise ValidationError({"discharge_date": "This field is required"}) + raise ValidationError({"discharge_date": _("This field is required")}) elif attrs.get("discharge_date") > now(): raise ValidationError( - {"discharge_date": "This field value cannot be in the future."} + {"discharge_date": _("This field value cannot be in the future.")} ) elif attrs.get("discharge_date") < self.instance.encounter_date: raise ValidationError( { - "discharge_date": "This field value cannot be before the encounter date." + "discharge_date": _("This field value cannot be before the encounter date.") } ) return attrs @@ -805,7 +806,7 @@ class Meta: class EmailDischargeSummarySerializer(serializers.Serializer): email = serializers.EmailField( required=False, - help_text=( + help_text=_( "Email address to send the discharge summary to. If not provided, " "the email address of the current user will be used." ), @@ -871,7 +872,7 @@ def get_files(self, obj): def validate_patient_code_status(self, value): if value == PatientCodeStatusType.NOT_SPECIFIED: - msg = "Specify a correct Patient Code Status for the Consent" + msg = _("Specify a correct Patient Code Status for the Consent") raise ValidationError(msg) return value @@ -881,7 +882,7 @@ def validate(self, attrs): user.user_type < User.TYPE_VALUE_MAP["DistrictAdmin"] and self.context["consultation"].facility_id != user.home_facility_id ): - msg = "Only Home Facility Staff can create consent for a Consultation" + msg = _("Only Home Facility Staff can create consent for a Consultation") raise ValidationError(msg) if ( @@ -892,7 +893,7 @@ def validate(self, attrs): raise ValidationError( { "patient_code_status": [ - "This field is required for Patient Code Status Consent" + _("This field is required for Patient Code Status Consent") ] } ) @@ -905,7 +906,7 @@ def validate(self, attrs): raise ValidationError( { "patient_code_status": [ - "This field is not required for this type of Consent" + _("This field is not required for this type of Consent") ] } ) diff --git a/care/facility/models/encounter_symptom.py b/care/facility/models/encounter_symptom.py index f7b1d6dd63..572fbfce5a 100644 --- a/care/facility/models/encounter_symptom.py +++ b/care/facility/models/encounter_symptom.py @@ -1,5 +1,5 @@ from django.db import models -from django.utils.translation import gettext_lazy as _ +from django.utils.translation import gettext_lazy as _, gettext_lazy from care.facility.models.mixins.permissions.patient import ( ConsultationRelatedPermissionMixin, @@ -19,38 +19,38 @@ class ClinicalImpressionStatus(models.TextChoices): class Symptom(models.IntegerChoices): - OTHERS = 9 - FEVER = 2 - SORE_THROAT = 3 - COUGH = 4 - BREATHLESSNESS = 5 - MYALGIA = 6 - ABDOMINAL_DISCOMFORT = 7 - VOMITING = 8 - SPUTUM = 11 - NAUSEA = 12 - CHEST_PAIN = 13 - HEMOPTYSIS = 14 - NASAL_DISCHARGE = 15 - BODY_ACHE = 16 - DIARRHOEA = 17 - PAIN = 18 - PEDAL_EDEMA = 19 - WOUND = 20 - CONSTIPATION = 21 - HEADACHE = 22 - BLEEDING = 23 - DIZZINESS = 24 - CHILLS = 25 - GENERAL_WEAKNESS = 26 - IRRITABILITY = 27 - CONFUSION = 28 - ABDOMINAL_PAIN = 29 - JOINT_PAIN = 30 - REDNESS_OF_EYES = 31 - ANOREXIA = 32 - NEW_LOSS_OF_TASTE = 33 - NEW_LOSS_OF_SMELL = 34 + OTHERS = 9, gettext_lazy("Others") + FEVER = 2, gettext_lazy("Fever") + SORE_THROAT = 3, gettext_lazy("Sore Throat") + COUGH = 4, gettext_lazy("Cough") + BREATHLESSNESS = 5, gettext_lazy("Breathlessness") + MYALGIA = 6, gettext_lazy("Myalgia") + ABDOMINAL_DISCOMFORT = 7, gettext_lazy("Abdominal Discomfort") + VOMITING = 8, gettext_lazy("Vomiting") + SPUTUM = 11, gettext_lazy("Sputum") + NAUSEA = 12, gettext_lazy("Nausea") + CHEST_PAIN = 13, gettext_lazy("Chest Pain") + HEMOPTYSIS = 14, gettext_lazy("Hemoptysis") + NASAL_DISCHARGE = 15, gettext_lazy("Nasal Discharge") + BODY_ACHE = 16, gettext_lazy("Body Ache") + DIARRHOEA = 17, gettext_lazy("Diarrhoea") + PAIN = 18, gettext_lazy("Pain") + PEDAL_EDEMA = 19, gettext_lazy("Pedal Edema") + WOUND = 20, gettext_lazy("Wound") + CONSTIPATION = 21, gettext_lazy("Constipation") + HEADACHE = 22, gettext_lazy("Headache") + BLEEDING = 23, gettext_lazy("Bleeding") + DIZZINESS = 24, gettext_lazy("Dizziness") + CHILLS = 25, gettext_lazy("Chills") + GENERAL_WEAKNESS = 26, gettext_lazy("General Weakness") + IRRITABILITY = 27, gettext_lazy("Irritability") + CONFUSION = 28, gettext_lazy("Confusion") + ABDOMINAL_PAIN = 29, gettext_lazy("Abdominal Pain") + JOINT_PAIN = 30, gettext_lazy("Joint Pain") + REDNESS_OF_EYES = 31, gettext_lazy("Redness of Eyes") + ANOREXIA = 32, gettext_lazy("Anorexia") + NEW_LOSS_OF_TASTE = 33, gettext_lazy("New Loss of Taste") + NEW_LOSS_OF_SMELL = 34, gettext_lazy("New Loss of Smell") class EncounterSymptom(BaseModel, ConsultationRelatedPermissionMixin): diff --git a/care/facility/models/patient_consultation.py b/care/facility/models/patient_consultation.py index f21d4f6a4d..3a7796d067 100644 --- a/care/facility/models/patient_consultation.py +++ b/care/facility/models/patient_consultation.py @@ -3,6 +3,7 @@ from django.db import models from django.db.models import JSONField from django.utils import timezone +from django.utils.translation import gettext_lazy as _ from care.facility.models import ( CATEGORY_CHOICES, @@ -27,21 +28,21 @@ class ConsentType(models.IntegerChoices): - CONSENT_FOR_ADMISSION = 1, "Consent for Admission" - PATIENT_CODE_STATUS = 2, "Patient Code Status" - CONSENT_FOR_PROCEDURE = 3, "Consent for Procedure" - HIGH_RISK_CONSENT = 4, "High Risk Consent" - OTHERS = 5, "Others" + CONSENT_FOR_ADMISSION = 1, _("Consent for Admission") + PATIENT_CODE_STATUS = 2, _("Patient Code Status") + CONSENT_FOR_PROCEDURE = 3, _("Consent for Procedure") + HIGH_RISK_CONSENT = 4, _("High Risk Consent") + OTHERS = 5, _("Others") class PatientConsultation(PatientBaseModel, ConsultationRelatedPermissionMixin): SUGGESTION_CHOICES = [ - (SuggestionChoices.HI, "HOME ISOLATION"), - (SuggestionChoices.A, "ADMISSION"), - (SuggestionChoices.R, "REFERRAL"), - (SuggestionChoices.OP, "OP CONSULTATION"), - (SuggestionChoices.DC, "DOMICILIARY CARE"), - (SuggestionChoices.DD, "DECLARE DEATH"), + (SuggestionChoices.HI, _("HOME ISOLATION")), + (SuggestionChoices.A, _("ADMISSION")), + (SuggestionChoices.R, _("REFERRAL")), + (SuggestionChoices.OP, _("OP CONSULTATION")), + (SuggestionChoices.DC, _("DOMICILIARY CARE")), + (SuggestionChoices.DD, _("DECLARE DEATH")), ] REVERSE_SUGGESTION_CHOICES = reverse_choices(SUGGESTION_CHOICES) @@ -56,7 +57,7 @@ class PatientConsultation(PatientBaseModel, ConsultationRelatedPermissionMixin): default=None, null=True, blank=True, - help_text=( + help_text=_( "Patient's unique number in the facility. " "IP number for inpatients and OP number for outpatients." ), @@ -199,13 +200,13 @@ class PatientConsultation(PatientBaseModel, ConsultationRelatedPermissionMixin): height = models.FloatField( default=None, null=True, - verbose_name="Patient's Height in CM", + verbose_name=_("Patient's Height in CM"), validators=[MinValueValidator(0)], ) weight = models.FloatField( default=None, null=True, - verbose_name="Patient's Weight in KG", + verbose_name=_("Patient's Weight in KG"), validators=[MinValueValidator(0)], ) @@ -227,14 +228,14 @@ def get_related_consultation(self): return self CSV_MAPPING = { - "consultation_created_date": "Date of Consultation", - "encounter_date": "Date of Admission", - "deprecated_symptoms_onset_date": "Date of Onset of Symptoms", - "deprecated_symptoms": "Symptoms at time of consultation", - "deprecated_covid_category": "Covid Category", - "category": "Category", - "examination_details": "Examination Details", - "suggestion": "Suggestion", + "consultation_created_date": _("Date of Consultation"), + "encounter_date": _("Date of Admission"), + "deprecated_symptoms_onset_date": _("Date of Onset of Symptoms"), + "deprecated_symptoms": _("Symptoms at time of consultation"), + "deprecated_covid_category": _("Covid Category"), + "category": _("Category"), + "examination_details": _("Examination Details"), + "suggestion": _("Suggestion"), } CSV_MAKE_PRETTY = { @@ -323,11 +324,11 @@ def has_object_generate_discharge_summary_permission(self, request): class PatientCodeStatusType(models.IntegerChoices): - NOT_SPECIFIED = 0, "Not Specified" - DNH = 1, "Do Not Hospitalize" - DNR = 2, "Do Not Resuscitate" - COMFORT_CARE = 3, "Comfort Care Only" - ACTIVE_TREATMENT = 4, "Active Treatment" + NOT_SPECIFIED = 0, _("Not Specified") + DNH = 1, _("Do Not Hospitalize") + DNR = 2, _("Do Not Resuscitate") + COMFORT_CARE = 3, _("Comfort Care Only") + ACTIVE_TREATMENT = 4, _("Active Treatment") class ConsultationClinician(models.Model): @@ -366,7 +367,7 @@ class PatientConsent(BaseModel, ConsultationRelatedPermissionMixin): ) is_migrated = models.BooleanField( default=False, - help_text="This field is to throw caution to data that was previously ported over", + help_text=_("This field is to throw caution to data that was previously ported over"), ) class Meta: @@ -401,7 +402,7 @@ def save(self, *args, **kwargs): files.update( is_archived=True, archived_datetime=timezone.now(), - archive_reason="Consent Archived", + archive_reason=_("Consent Archived"), archived_by=self.archived_by, ) diff --git a/care/users/models.py b/care/users/models.py index 9ea5d0cf43..fe189f6aa1 100644 --- a/care/users/models.py +++ b/care/users/models.py @@ -30,24 +30,24 @@ def reverse_choices(choices): return output -GENDER_CHOICES = [(1, "Male"), (2, "Female"), (3, "Non-binary")] +GENDER_CHOICES = [(1, _("Male")), (2, _("Female")), (3, _("Non-binary"))] REVERSE_GENDER_CHOICES = reverse_choices(GENDER_CHOICES) DISTRICT_CHOICES = [ - (1, "Thiruvananthapuram"), - (2, "Kollam"), - (3, "Pathanamthitta"), - (4, "Alappuzha"), - (5, "Kottayam"), - (6, "Idukki"), - (7, "Ernakulam"), - (8, "Thrissur"), - (9, "Palakkad"), - (10, "Malappuram"), - (11, "Kozhikode"), - (12, "Wayanad"), - (13, "Kannur"), - (14, "Kasargode"), + (1, _("Thiruvananthapuram")), + (2, _("Kollam")), + (3, _("Pathanamthitta")), + (4, _("Alappuzha")), + (5, _("Kottayam")), + (6, _("Idukki")), + (7, _("Ernakulam")), + (8, _("Thrissur")), + (9, _("Palakkad")), + (10, _("Malappuram")), + (11, _("Kozhikode")), + (12, _("Wayanad")), + (13, _("Kannur")), + (14, _("Kasargode")), ] @@ -68,16 +68,16 @@ def __str__(self): LOCAL_BODY_CHOICES = ( # Panchayath levels - (1, "Grama Panchayath"), - (2, "Block Panchayath"), - (3, "District Panchayath"), - (4, "Nagar Panchayath"), + (1, _("Grama Panchayath")), + (2, _("Block Panchayath")), + (3, _("District Panchayath")), + (4, _("Nagar Panchayath")), # Municipality levels - (10, "Municipality"), + (10, _("Municipality")), # Corporation levels - (20, "Corporation"), + (20, _("Corporation")), # Unknown - (50, "Others"), + (50, _("Others")), ) @@ -104,8 +104,8 @@ class Meta: "body_type", "name", ) - verbose_name = "Local Body" - verbose_name_plural = "Local Bodies" + verbose_name = _("Local Body") + verbose_name_plural = _("Local Bodies") def __str__(self): return f"{self.name} ({self.body_type})" @@ -247,7 +247,7 @@ class User(AbstractUser): TYPE_VALUE_MAP["StateReadOnlyAdmin"], ) - TYPE_CHOICES = [(value, name) for name, value in TYPE_VALUE_MAP.items()] + TYPE_CHOICES = [(value, _(name)) for name, value in TYPE_VALUE_MAP.items()] REVERSE_TYPE_MAP = reverse_choices(TYPE_CHOICES) @@ -335,17 +335,17 @@ class User(AbstractUser): ] CSV_MAPPING = { - "username": "Username", - "first_name": "First Name", - "last_name": "Last Name", - "phone_number": "Phone Number", - "gender": "Gender", - "date_of_birth": "Date of Birth", - "verified": "verified", - "local_body__name": "Local Body", - "district__name": "District", - "state__name": "State", - "user_type": "User Type", + "username": _("Username"), + "first_name": _("First Name"), + "last_name": _("Last Name"), + "phone_number": _("Phone Number"), + "gender": _("Gender"), + "date_of_birth": _("Date of Birth"), + "verified": _("verified"), + "local_body__name": _("Local Body"), + "district__name": _("District"), + "state__name": _("State"), + "user_type": _("User Type"), } CSV_MAKE_PRETTY = {"user_type": (lambda x: User.REVERSE_TYPE_MAP[x])} @@ -463,7 +463,7 @@ def __str__(self): return f"User Flag: {self.user.get_full_name()} - {self.flag}" class Meta: - verbose_name = "User Flag" + verbose_name = _("User Flag") constraints = [ models.UniqueConstraint( fields=["user", "flag"],