From 7ff6942c0add531c1e694575035271b4910ea751 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 23 Oct 2019 11:48:53 +0200 Subject: [PATCH] =?utf8?q?Form->prepare=5Ffor=5Fprinting:=20Einheiten=20?= =?utf8?q?=C3=BCbersetzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SL/Form.pm b/SL/Form.pm index 59d69c37c..51483e631 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -3407,6 +3407,14 @@ sub prepare_for_printing { $self->reformat_numbers($output_numberformat, $precision, @{ $field_list }); } + # Translate units + if (($self->{language} // '') ne '') { + my $template_arrays = $self->{TEMPLATE_ARRAYS} || $self; + for my $idx (0..scalar(@{ $template_arrays->{unit} }) - 1) { + $template_arrays->{unit}->[$idx] = AM->translate_units($self, $self->{language}, $template_arrays->{unit}->[$idx], $template_arrays->{qty}->[$idx]) + } + } + $self->{template_meta} = { formname => $self->{formname}, language => SL::DB::Manager::Language->find_by_or_create(id => $self->{language_id} || undef), -- 2.20.1