From c61bec5792d6ddcedf44af1b1ce9e08de49599cb Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 23 Jul 2016 11:24:05 +0000 Subject: [PATCH] Add another hack to add weekday to date format to more locales While here only initialize the iconv converter when needed --- tools/tools/locale/tools/cldr2def.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/tools/locale/tools/cldr2def.pl b/tools/tools/locale/tools/cldr2def.pl index 21a88a7d9c3..04de149b390 100755 --- a/tools/tools/locale/tools/cldr2def.pl +++ b/tools/tools/locale/tools/cldr2def.pl @@ -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;