i18n: improve translations across horilla (#1014)

- Added trans() / _() translations to models, forms and templates.
- Updated Spanish locale (django.po).
- Fixed missing verbose_name translations.

Known issues:
- "Leave Type" label in horilla/leave/forms.py not translating.
- "Performance" and "Mails automations" still pending.
This commit is contained in:
elchimeneas
2025-12-23 05:40:04 +00:00
committed by GitHub
parent 836fa4df12
commit 641a4d4842
21 changed files with 779 additions and 615 deletions

View File

@@ -15,7 +15,8 @@ from django.core.exceptions import ValidationError
from django.db.models import Q
from django.forms.widgets import TextInput
from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as _
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy as trans
from base.forms import ModelForm as BaseModelForm
from base.methods import filtersubordinatesemployeemodel, reload_queryset
@@ -707,8 +708,8 @@ class AssignLeaveForm(HorillaForm):
attrs={"class": "oh-select oh-select-2 mb-2", "required": True}
),
empty_label=None,
label="Leave Type",
required=False,
label=trans("Leave Type"),
)
employee_id = HorillaMultiSelectField(
queryset=Employee.objects.all(),
@@ -719,7 +720,7 @@ class AssignLeaveForm(HorillaForm):
filter_template_path="employee_filters.html",
required=True,
),
label="Employee",
label=trans("Employee"),
)
def clean(self):