[rrd-users] rrdtool::graph and German weekday names

Tobias Oetiker tobi at oetiker.ch
Wed Nov 1 20:19:40 CET 2017


Hi Joachim,

Tobias Oetiker

> On 1 Nov 2017, at 19:17, Joachim Hartmann <joachim.hartmann at gmx-topmail.de> wrote:
> 
> Hello perl experts,
> I run Munin on a Debian server. In the graphs the days of the week are
> displayed in German. Now I monitor the weather data on a raspberry,
> which basically works, but the days of the week are displayed in
> English. How do I get this Perl script to display the weekdays in
> English?

Chances are that the locale when running as a cgi is different than the locale you got when logging into the server interactively.

I would suggest to use

use POSIX qw(locale_h);
use locale;
setlocale(LC_CTYPE, "de_DE.UTF-8");

INSIDE the script

More details on this to be found here https://perldoc.perl.org/perllocale.html

Cheers
Tobi
;
> +++++++++++++++++++++++++++++++++++++++
> 
> The output of locale is the same for both computers:
> 
> +++++++++++++++++++++++++++++++++++++++
> # locale
> LANG=de_DE.UTF-8
> LANGUAGE=
> LC_CTYPE="de_DE.UTF-8"
> LC_NUMERIC="de_DE.UTF-8"
> LC_TIME="de_DE.UTF-8"
> LC_COLLATE="de_DE.UTF-8"
> LC_MONETARY="de_DE.UTF-8"
> LC_MESSAGES="de_DE.UTF-8"
> LC_PAPER="de_DE.UTF-8"
> LC_NAME="de_DE.UTF-8"
> LC_ADDRESS="de_DE.UTF-8"
> LC_TELEPHONE="de_DE.UTF-8"
> LC_MEASUREMENT="de_DE.UTF-8"
> LC_IDENTIFICATION="de_DE.UTF-8"
> LC_ALL=
> ++++++++++++++++++++++++++++++++++++++
> -- 
> Greetings from the home of CeBIT
> Gruß aus der Stadt der CeBIT
> Jochen
> 
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20171101/1d954667/attachment.html>


More information about the rrd-users mailing list