From a0e041be8f27b1dc81e88f75668f31bcf26ce836 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 23 Apr 2024 13:42:08 +0100 Subject: [PATCH] Bug 33237: (follow-up) Restore final fallback This restores the final fallback to 'en' as mentioned by Jonathan Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer (cherry picked from commit 45e4d9a04aaddc24ae625246950cb0b8d886b51b) Signed-off-by: Fridolin Somers --- C4/Letters.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 237f05916f..148c80b5f3 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -1667,20 +1667,23 @@ sub _process_tt { my $content = $params->{content}; my $tables = $params->{tables}; my $loops = $params->{loops}; - my $objects = $params->{objects} || {}; + my $objects = $params->{objects} || {}; my $substitute = $params->{substitute} || {}; - my $lang = 'en'; my $interface = C4::Context->interface; + my $lang; if ( defined( $params->{lang} ) && $params->{lang} ne 'default' ) { $lang = $params->{lang}; } elsif ( $interface eq 'intranet' || $interface eq 'opac' ) { + #use interface language $lang = C4::Languages::getlanguage(); } else { + # Pick the first selected syspref language my @languages = split /,/, C4::Context->preference('language'); $lang = shift @languages; } + $lang //= 'en'; my ($theme, $availablethemes); my $htdocs = C4::Context->config('intrahtdocs'); -- 2.39.5