Skip to content

Commit

Permalink
fix: translation only applied on app start
Browse files Browse the repository at this point in the history
* the problem was that with gettext the translations for facets
  have been only calculated on boot time.

* using lazy_gettext instead fixes that, because it calculates
  the translation at the request level

Co-authored-by: Mirek Simek <[email protected]>
  • Loading branch information
mesemus and mesemus committed Oct 23, 2024
1 parent e6c3901 commit 1311758
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion invenio_communities/communities/services/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

"""Facet definitions."""

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

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

"""Facets for the members search."""

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

from ...proxies import current_roles
Expand Down

0 comments on commit 1311758

Please sign in to comment.