@@ -, +, @@ --- Koha/I18N.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/Koha/I18N.pm +++ a/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); --