2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-26 17:04:59 +00:00

98_SVG.pm: add german month names (Forum #110274)

git-svn-id: https://svn.fhem.de/fhem/trunk@21763 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-04-23 12:05:28 +00:00
parent 2172d7d3cf
commit 0fd5358c3e

View File

@ -53,6 +53,11 @@ my $SVG_hdr = 'version="1.1" xmlns="http://www.w3.org/2000/svg" '.
'xmlns:xlink="http://www.w3.org/1999/xlink" '. 'xmlns:xlink="http://www.w3.org/1999/xlink" '.
'data-origin="FHEM"'; 'data-origin="FHEM"';
my $isDE;
my %monthNamesDE = (
Jan=>"Jan", Feb=>"Feb", Mar=>"Mrz", Apr=>"Apr", May=>"Mai", Jun=>"Jun",
Jul=>"Jul", Aug=>"Aug", Sep=>"Sep", Oct=>"Okt", Nov=>"Nov", Dec=>"Dez"
);
##################################### #####################################
sub sub
@ -1669,6 +1674,7 @@ SVG_render($$$$$$$$$$)
# then the text and the grid # then the text and the grid
$off1 = $x; $off1 = $x;
$off2 = $y+$h+$th; $off2 = $y+$h+$th;
$isDE = (AttrVal("global", "language","EN") eq "DE");
my $t = SVG_fmtTime($first_tag, $fromsec); my $t = SVG_fmtTime($first_tag, $fromsec);
SVG_pO "<text x=\"0\" y=\"$off2\" class=\"ylabel\">$t</text>" SVG_pO "<text x=\"0\" y=\"$off2\" class=\"ylabel\">$t</text>"
if(!$conf{xrange}); if(!$conf{xrange});
@ -2369,7 +2375,7 @@ SVG_fmtTime($$)
$fmt = "" if(!defined($fmt)); $fmt = "" if(!defined($fmt));
for my $f (split(" ", $fmt)) { for my $f (split(" ", $fmt)) {
$ret .= $sep if($ret); $ret .= $sep if($ret);
$ret .= $tarr[$f]; $ret .= ($isDE && $f==1) ? $monthNamesDE{$tarr[$f]} : $tarr[$f];
} }
return $ret; return $ret;
} }