Skip to content

Commit

Permalink
Add minor gettext fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
apragacz committed Dec 5, 2022
1 parent 5a4121a commit 4767044
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions fzw/main/admin_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
Group,
User
)
from django.utils.translation import ugettext_lazy
from django.utils.translation import gettext_lazy


class FZWAdminSite(admin.AdminSite):
# Text to put at the end of each page's <title>.
site_title = ugettext_lazy('Fajnie ze wiesz admin')
site_title = gettext_lazy('Fajnie ze wiesz admin')

# Text to put in each page's <h1> (and above login form).
site_header = ugettext_lazy('Fajnie ze wiesz administration')
site_header = gettext_lazy('Fajnie ze wiesz administration')

# Text to put at the top of the admin index page.
index_title = ugettext_lazy('Site administration')
index_title = gettext_lazy('Site administration')


admin_site = FZWAdminSite()
Expand Down
3 changes: 2 additions & 1 deletion fzw/news/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _


Expand All @@ -18,7 +19,7 @@ def field_choices(cls) -> Tuple[Tuple[str, str], ...]:
def verbose_name(self) -> str:
name = str(self.name)
display_name = name.replace('_', ' ').capitalize()
return _(display_name)
return gettext(display_name)

def __str__(self) -> str:
return str(self.value)
Expand Down

0 comments on commit 4767044

Please sign in to comment.