[rrd-users] Hack for graphics localization and correction of weeks numbers

Thierry Nkaoua tnka at linux-sottises.net
Sun Apr 7 14:55:05 MEST 2002


Hi

I wanted to have french words for week and months (and "Week") in the
graphics, but I did not find anything in the docs.

I do not know if somebody already did this, but here is a way to have
internationalization in the graphics (for linux systems)


Here are the changes to do in src/rrd_graph.c:


------------------------
add:

#include <locale.h>

in the includes at the top of the file
-----------------------------



-----------------------------
add:

setlocale(LC_ALL,"");

just before the strftime call:

strftime(graph_label,99,im->xlab_user.stst,localtime(&tilab));
--------------------------------



--------------------------------
change the word Week to the translation in your language in:

{3600,     TMT_DAY,1,     TMT_WEEK,1,     TMT_WEEK,1,    7*24*3600,"Week 
%W"},{3*3600,   TMT_WEEK,1,      TMT_MONTH,1,     TMT_WEEK,2,    7*24*3600,"Week
 %W"},
--------------------------------


another thing I did not find in the docs is the "bad numbering" of the
weeks... week number 0 is a "computer people" thing :)))) not "everyday
life" usage... so if you want weeks begining at number 1 (as in every
calendar I saw) change %W to %V in the two lines above

after making all the changes, recompile your rrdtool

You can see the results at
http://www.linux-sottises.net/stats_rrd.php

I am also developping "mrtg-style" scripts for making graphics and html
pages, you can test the scripts (still in beta status, only "external
scripts can be graphed at the moment)  at:
http://www.linux-sottises.net/software.php#mrtnk

Regards
-- 
TNK
www.linux-sottises.net
S'il n'y a pas de solution, c'est qu'il n'y a pas de problème!





--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list