X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FLocale.pm;h=3216cd2704a5351ab9a043b86166ac8526e8fb90;hb=5e9aaf1c3e83467ed4f6550627f8c7e6ec6fa811;hp=8fa37805d6ce6e1932308185dea702766313d87b;hpb=87b0de4c742e6032bcb6bf8750b1d8144e1a9860;p=kivitendo-erp.git diff --git a/SL/Locale.pm b/SL/Locale.pm index 8fa37805d..3216cd270 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -328,7 +328,7 @@ sub date { } elsif ($myconfig->{dateformat} eq "yyyy-mm-dd") { # Use German syntax with the ISO date style "yyyy-mm-dd" because - # Lx-Office is mainly used in Germany or German speaking countries. + # kivitendo is mainly used in Germany or German speaking countries. if (defined $longformat && $longformat == 0) { $mm++; $dd = "0$dd" if ($dd < 10); @@ -403,8 +403,7 @@ sub format_date_object { my ($self, $datetime, %params) = @_; my $format = $::myconfig{dateformat} || 'yyyy-mm-dd'; - $format =~ s/yyyy/\%Y/; - $format =~ s/yy/\%y/; + $format =~ s/yy(?:yy)?/\%Y/; $format =~ s/mm/\%m/; $format =~ s/dd/\%d/; @@ -540,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