my $self = shift;
my $text = shift;
+ return $text->translated if (ref($text) || '') eq 'SL::Locale::String';
+
if ($self->{texts}->{$text}) {
$text = $self->{iconv}->convert($self->{texts}->{$text});
} else {
} 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);
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/;
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
=head1 NAME
-Locale - Functions for dealing with locale-dependant information
+Locale - Functions for dealing with locale-dependent information
=head1 SYNOPSIS