From 2320dccbe35e73f9bac55f1a0b34ce3fe40b33c6 Mon Sep 17 00:00:00 2001 From: Mirek Simek Date: Tue, 10 Dec 2024 14:30:41 +0100 Subject: [PATCH] i18n: Fix untranslated strings in facets 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 --- invenio_users_resources/services/domains/facets.py | 2 +- invenio_users_resources/services/users/facets.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/invenio_users_resources/services/domains/facets.py b/invenio_users_resources/services/domains/facets.py index b2d9bd2..50b2da5 100644 --- a/invenio_users_resources/services/domains/facets.py +++ b/invenio_users_resources/services/domains/facets.py @@ -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( diff --git a/invenio_users_resources/services/users/facets.py b/invenio_users_resources/services/users/facets.py index 598bdfe..4df7e06 100644 --- a/invenio_users_resources/services/users/facets.py +++ b/invenio_users_resources/services/users/facets.py @@ -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(