X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FLocale.pm;h=3216cd2704a5351ab9a043b86166ac8526e8fb90;hb=2f6e7625957d22de1008f2c6828835295b468fb7;hp=5503c1b9595b5c93c9ea4e96ebd5f8da7d840bc3;hpb=aa8fc8ca2a7f9bc51e934054b088afc151ce4bb8;p=kivitendo-erp.git diff --git a/SL/Locale.pm b/SL/Locale.pm index 5503c1b95..3216cd270 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -539,7 +539,20 @@ sub get_local_time_zone { return $self->{local_time_zone}; } +sub language_join { + my ($self, $items, %params) = @_; + + $items ||= []; + $params{conjunction} ||= $::locale->text('and'); + my $num = scalar @{ $items }; + + return 0 == $num ? '' + : 1 == $num ? $items->[0] + : join(', ', @{ $items }[0..$num - 2]) . ' ' . $params{conjunction} . ' ' . $items->[$num - 1]; +} + 1; + __END__ =pod