Skip to content

Commit

Permalink
i18n: Fix untranslated strings in facets
Browse files Browse the repository at this point in the history
User and domain translations are not working, even though they are wrapped
in `_(...)`. The reason is `gettext` is used which performs the translation
during module initialization and not when the facets are rendered.

This commit fixes this by using `lazy_gettext` instead.

Co-authored-by: Miroslav Simek <miroslav.simek@cesnet.cz>
  • Loading branch information
mesemus and mesemus committed Dec 10, 2024
1 parent 08589f9 commit 2320dcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion invenio_users_resources/services/domains/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

"""Domains search facets definitions."""

from invenio_i18n import gettext as _
from invenio_i18n import lazy_gettext as _
from invenio_records_resources.services.records.facets import TermsFacet

status = TermsFacet(
Expand Down
2 changes: 1 addition & 1 deletion invenio_users_resources/services/users/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

"""Users search facets definitions."""

from invenio_i18n import gettext as _
from invenio_i18n import lazy_gettext as _
from invenio_records_resources.services.records.facets import TermsFacet

domain = TermsFacet(
Expand Down

0 comments on commit 2320dcc

Please sign in to comment.