From 000f7bd0f554b5480ccf98d21dfa6b4c68592f64 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 30 Mar 2022 10:30:58 +0100 Subject: [PATCH] Bug 24975: Fix bug --- Koha/I18N.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Koha/I18N.pm b/Koha/I18N.pm index 1de5b60601..d905f4c456 100644 --- a/Koha/I18N.pm +++ b/Koha/I18N.pm @@ -229,10 +229,10 @@ sub _expand { =head2 db_t db_t($group, $key) - db_t('itemtype', $itemtype->itemtype) + db_t('itemtype', $itemtype->translation_key) Search for a translation in l10n_target table and return it if found -Return C<$text> otherwise +Return untranslated original text otherwise. =cut @@ -241,6 +241,7 @@ sub db_t { my $cache = Koha::Caches->get_instance(); unless ($cache->is_cache_active) { + warn "Using Koha::Cache::Memory::Lite"; $cache = Koha::Cache::Memory::Lite->get_instance(); } @@ -263,7 +264,7 @@ sub db_t { }, ); $translations = - { map { $_->{key} => $_->{l10n_target}->{translation} // $_->{text} } + { map { $_->{key} => $_->{l10n_targets}->[0]{translation} //= $_->{text} } @targets }; $cache->set_in_cache($cache_key, $translations); -- 2.20.1