Lines 229-238
sub _expand {
Link Here
|
229 |
=head2 db_t |
229 |
=head2 db_t |
230 |
|
230 |
|
231 |
db_t($group, $key) |
231 |
db_t($group, $key) |
232 |
db_t('itemtype', $itemtype->itemtype) |
232 |
db_t('itemtype', $itemtype->translation_key) |
233 |
|
233 |
|
234 |
Search for a translation in l10n_target table and return it if found |
234 |
Search for a translation in l10n_target table and return it if found |
235 |
Return C<$text> otherwise |
235 |
Return untranslated original text otherwise. |
236 |
|
236 |
|
237 |
=cut |
237 |
=cut |
238 |
|
238 |
|
Lines 241-246
sub db_t {
Link Here
|
241 |
|
241 |
|
242 |
my $cache = Koha::Caches->get_instance(); |
242 |
my $cache = Koha::Caches->get_instance(); |
243 |
unless ($cache->is_cache_active) { |
243 |
unless ($cache->is_cache_active) { |
|
|
244 |
warn "Using Koha::Cache::Memory::Lite"; |
244 |
$cache = Koha::Cache::Memory::Lite->get_instance(); |
245 |
$cache = Koha::Cache::Memory::Lite->get_instance(); |
245 |
} |
246 |
} |
246 |
|
247 |
|
Lines 263-269
sub db_t {
Link Here
|
263 |
}, |
264 |
}, |
264 |
); |
265 |
); |
265 |
$translations = |
266 |
$translations = |
266 |
{ map { $_->{key} => $_->{l10n_target}->{translation} // $_->{text} } |
267 |
{ map { $_->{key} => $_->{l10n_targets}->[0]{translation} //= $_->{text} } |
267 |
@targets }; |
268 |
@targets }; |
268 |
|
269 |
|
269 |
$cache->set_in_cache($cache_key, $translations); |
270 |
$cache->set_in_cache($cache_key, $translations); |
270 |
- |
|
|