From 45e4d9a04aaddc24ae625246950cb0b8d886b51b 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 --- C4/Letters.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 51ce4311b5..f099686bb0 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -1669,20 +1669,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