Add another hack to add weekday to date format to more locales

While here only initialize the iconv converter when needed
This commit is contained in:
bapt 2016-07-23 11:24:05 +00:00
parent 067f6948ac
commit 8ea312cccf

View File

@ -201,12 +201,12 @@ sub callback_ampm {
my $s = shift;
my $nl = $callback{data}{l} . "_" . $callback{data}{c};
my $enc = $callback{data}{e};
my $converter = Text::Iconv->new("utf-8", "$enc");
if ($nl eq 'ru_RU') {
if ($enc eq 'UTF-8') {
$s = 'дп;пп';
} else {
my $converter = Text::Iconv->new("utf-8", "$enc");
$s = $converter->convert("дп;пп");
}
}
@ -220,6 +220,7 @@ sub callback_cformat {
$s =~ s/\.,/\./;
$s =~ s/ %Z//;
$s =~ s/ %z//;
$s =~ s/^"%e\./%A %e/;
$s =~ s/^"(%B %e, )/"%A, $1/;
$s =~ s/^"(%e %B )/"%A $1/;
return $s;
@ -241,6 +242,7 @@ sub callback_dtformat {
$s =~ s/(> )(%H)/$1%A $2/;
}
$s =~ s/\.,/\./;
$s =~ s/^"%e\./%A %e/;
$s =~ s/^"(%B %e, )/"%A, $1/;
$s =~ s/^"(%e %B )/"%A $1/;
return $s;