Skip to content

Commit

Permalink
feat: [ACI-909] make all user-info string translatable (#151)
Browse files Browse the repository at this point in the history
* feat: [ACI-909] make all user-info string translatable

* feat: [ACI-909] add compiled files & remove redundant .po file

* fix: [ACI-909] remove redundant translations

* refactor: [ACI-909] remove trailing newline

---------

Co-authored-by: Andrii <[email protected]>
  • Loading branch information
andrii-hantkovskyi and Andrii authored Apr 19, 2024
1 parent 2b82941 commit 73e4f08
Show file tree
Hide file tree
Showing 136 changed files with 21,780 additions and 9,881 deletions.
6 changes: 3 additions & 3 deletions credentials/apps/badges/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def delete_model(self, request, obj):
"""
if obj.is_active:
messages.set_level(request, messages.ERROR)
messages.error(request, "Active badge template cannot be deleted.")
messages.error(request, _("Active badge template cannot be deleted."))
return
super().delete_model(request, obj)

Expand All @@ -220,7 +220,7 @@ def delete_queryset(self, request, queryset):
"""
if queryset.filter(is_active=True).exists():
messages.set_level(request, messages.ERROR)
messages.error(request, "Active badge templates cannot be deleted.")
messages.error(request, _("Active badge templates cannot be deleted."))
return
super().delete_queryset(request, queryset)

Expand All @@ -244,7 +244,7 @@ def save_related(self, request, form, formsets, change):
obj = form.instance
if obj.is_active and not obj.requirements.exists():
messages.set_level(request, messages.ERROR)
messages.error(request, "Badge Template must have at least 1 Requirement set.")
messages.error(request, _("Badge Template must have at least 1 Requirement set."))
return
super().save_related(request, form, formsets, change)

Expand Down
2 changes: 1 addition & 1 deletion credentials/apps/badges/admin_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def clean(self):
if requirements and not all(
[requirement.template.id == cleaned_data.get("template").id for requirement in requirements]
):
raise forms.ValidationError("All requirements must belong to the same template.")
raise forms.ValidationError(_("All requirements must belong to the same template."))
return cleaned_data


Expand Down
Binary file modified credentials/conf/locale/ar/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 73e4f08

Please sign in to comment.