summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ae24e4)
raw | patch | inline | side by side (parent: 7ae24e4)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 18 Feb 2008 15:04:42 +0000 (15:04 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 18 Feb 2008 15:04:42 +0000 (15:04 +0000) |
MakeMakefile | patch | blob | history | |
Makefile.am | patch | blob | history | |
configure.ac | patch | blob | history | |
rrdtool.spec | patch | blob | history | |
src/Makefile.am | patch | blob | history | |
src/rrd_getopt.c | patch | blob | history | |
src/rrd_tool.c | patch | blob | history |
diff --git a/MakeMakefile b/MakeMakefile
index c936d002201e0fcb923e36afa59aff7f35ecc269..026f0a9d7d24a50a2ff06bf8a7f5efb975f6f93f 100755 (executable)
--- a/MakeMakefile
+++ b/MakeMakefile
find . -name .libs | xargs rm -r
find . -name .debs | xargs rm -r
+intltoolize --automake -c -f
$aclocal
libtoolize --copy --force
autoheader --force
diff --git a/Makefile.am b/Makefile.am
index 98698d6c8c29e38c37f130525ec07c3bb2f2067c..654f18bac3dfb44a62db5f2c70f9a78fed2aef3d 100644 (file)
--- a/Makefile.am
+++ b/Makefile.am
RSYNC = rsync --rsh=ssh
# build the following subdirectories
-SUBDIRS = src examples doc bindings
+SUBDIRS = po src examples doc bindings
# the following files are not mentioned in any other Makefile
EXTRA_DIST = COPYRIGHT CHANGES WIN32-BUILD-TIPS.txt TODO CONTRIBUTORS THREADS \
diff --git a/configure.ac b/configure.ac
index 5845512ad12c66e186edc11a1fa4afe085d4d8c2..6ee7b2f9c9915607f1a53f974cc551293a054685 100644 (file)
--- a/configure.ac
+++ b/configure.ac
dnl Process Special Options
dnl -----------------------------------
+dnl gettext
+GETTEXT_PACKAGE=rrdtool
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package])
+IT_PROG_INTLTOOL([0.35.0])
+
+AM_GLIB_GNU_GETTEXT
+
dnl How the vertical axis label is printed
AC_ARG_VAR(RRDGRAPH_YLEGEND_ANGLE,
[Vertical label angle: -90.0 (default) or 90.0])
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
-AC_CHECK_HEADERS(features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h)
+AC_CHECK_HEADERS(features.h sys/stat.h sys/types.h fcntl.h libintl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_CONFIG_FILES([examples/perftest.pl])
AC_CONFIG_FILES([examples/Makefile])
AC_CONFIG_FILES([doc/Makefile])
+AC_CONFIG_FILES([po/Makefile.in])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([bindings/Makefile])
AC_CONFIG_FILES([bindings/tcl/Makefile])
diff --git a/rrdtool.spec b/rrdtool.spec
index a03e0ee04f4efa96b3756792bea26827265e2c02..a3cc275618deb9e2ec61b09da5da50f572f81200 100644 (file)
--- a/rrdtool.spec
+++ b/rrdtool.spec
configure Makefile.in php4/configure php4/ltconfig*
%build
+intltoolize --automake -c -f
+aclocal
+autoheader
+autoconf
+automake -a -c -f
%configure \
--with-perl-options='INSTALLDIRS="vendor"' \
%if %{with_tcl}
diff --git a/src/Makefile.am b/src/Makefile.am
index 73a312de5a7c807d86f181af36519052317d74b4..088de0d80ac004a8a7d1f7ba1a0efc9873199fff 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
AM_LDFLAGS = -all-static
endif
+INCLUDES = -DLOCALEDIR="\"$(datadir)/locale\""
RRD_DEFAULT_FONT=@RRD_DEFAULT_FONT@
AM_CPPFLAGS = -DRRD_DEFAULT_FONT=\"$(RRD_DEFAULT_FONT)\" -DNUMVERS=@NUMVERS@
noinst_HEADERS = \
unused.h \
rrd_getopt.h parsetime.h \
+ rrd_i18n.h \
rrd_format.h rrd_tool.h rrd_xport.h rrd.h rrd_rpncalc.h \
rrd_hw.h rrd_hw_math.h rrd_hw_update.h \
fnv.h rrd_graph.h \
diff --git a/src/rrd_getopt.c b/src/rrd_getopt.c
index 706a67ab8b3ec3fbd8f781ec85bf0639ef2109db..b389aaa53391281f49daba5df73c0918ac358bc9 100644 (file)
--- a/src/rrd_getopt.c
+++ b/src/rrd_getopt.c
#include "../rrd_config.h"
#endif
+#include "rrd_i18n.h"
+
#if !defined (__STDC__) || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#define getpid() GetCurrentProcessId()
#endif
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
- When compiling libc, the _ macro is predefined. */
-#ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# define _(msgid) gettext (msgid)
-#else
-# define _(msgid) (msgid)
-#endif
-#endif
-
/* This version of `getopt' appears to the caller like standard Unix `getopt'
but it behaves differently for the user, since it allows the user
to intersperse the options with the other arguments.
diff --git a/src/rrd_tool.c b/src/rrd_tool.c
index f88c4005c66626e98f6c5e14c7d4a5990ad02891..cdb87e82bffa7fed7a197d587a8b8d4a9cdca21c 100644 (file)
--- a/src/rrd_tool.c
+++ b/src/rrd_tool.c
* rrd_tool.c Startup wrapper
*****************************************************************************/
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(HAVE_CONFIG_H)
+#include "../win32/config.h"
+#else
+#ifdef HAVE_CONFIG_H
+#include "../rrd_config.h"
+#endif
+#endif
+
#include "rrd_tool.h"
#include "rrd_xport.h"
+#include "rrd_i18n.h"
+
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
void PrintUsage(
char *cmd);
{
char help_main[] =
- "RRDtool " PACKAGE_VERSION
+ N_("RRDtool %s"
" Copyright 1997-2007 by Tobias Oetiker <tobi@oetiker.ch>\n"
- " Compiled " __DATE__ " " __TIME__ "\n\n"
- "Usage: rrdtool [options] command command_options\n\n";
+ " Compiled %s %s\n\n"
+ "Usage: rrdtool [options] command command_options\n\n");
char help_list[] =
- "Valid commands: create, update, updatev, graph, dump, restore,\n"
+ N_("Valid commands: create, update, updatev, graph, dump, restore,\n"
"\t\tlast, lastupdate, first, info, fetch, tune,\n"
- "\t\tresize, xport\n\n";
+ "\t\tresize, xport\n\n");
char help_listremote[] =
- "Valid remote commands: quit, ls, cd, mkdir, pwd\n\n";
+ N_("Valid remote commands: quit, ls, cd, mkdir, pwd\n\n");
char help_create[] =
- "* create - create a new RRD\n\n"
+ N_("* create - create a new RRD\n\n"
"\trrdtool create filename [--start|-b start time]\n"
"\t\t[--step|-s step]\n"
"\t\t[DS:ds-name:DST:dst arguments]\n"
- "\t\t[RRA:CF:cf arguments]\n\n";
+ "\t\t[RRA:CF:cf arguments]\n\n");
char help_dump[] =
- "* dump - dump an RRD to XML\n\n"
- "\trrdtool dump filename.rrd >filename.xml\n\n";
+ N_("* dump - dump an RRD to XML\n\n"
+ "\trrdtool dump filename.rrd >filename.xml\n\n");
char help_info[] =
- "* info - returns the configuration and status of the RRD\n\n"
- "\trrdtool info filename.rrd\n\n";
+ N_("* info - returns the configuration and status of the RRD\n\n"
+ "\trrdtool info filename.rrd\n\n");
char help_restore[] =
- "* restore - restore an RRD file from its XML form\n\n"
- "\trrdtool restore [--range-check|-r] [--force-overwrite|-f] filename.xml filename.rrd\n\n";
+ N_("* restore - restore an RRD file from its XML form\n\n"
+ "\trrdtool restore [--range-check|-r] [--force-overwrite|-f] filename.xml filename.rrd\n\n");
char help_last[] =
- "* last - show last update time for RRD\n\n"
- "\trrdtool last filename.rrd\n\n";
+ N_("* last - show last update time for RRD\n\n"
+ "\trrdtool last filename.rrd\n\n");
char help_lastupdate[] =
- "* lastupdate - returns the most recent datum stored for\n"
- " each DS in an RRD\n\n" "\trrdtool lastupdate filename.rrd\n\n";
+ N_("* lastupdate - returns the most recent datum stored for\n"
+ " each DS in an RRD\n\n" "\trrdtool lastupdate filename.rrd\n\n");
char help_first[] =
- "* first - show first update time for RRA within an RRD\n\n"
- "\trrdtool first filename.rrd [--rraindex number]\n\n";
+ N_("* first - show first update time for RRA within an RRD\n\n"
+ "\trrdtool first filename.rrd [--rraindex number]\n\n");
char help_update[] =
- "* update - update an RRD\n\n"
+ N_("* update - update an RRD\n\n"
"\trrdtool update filename\n"
"\t\t--template|-t ds-name:ds-name:...\n"
"\t\ttime|N:value[:value...]\n\n"
"\t\tat-time@value[:value...]\n\n"
- "\t\t[ time:value[:value...] ..]\n\n";
+ "\t\t[ time:value[:value...] ..]\n\n");
char help_updatev[] =
- "* updatev - a verbose version of update\n"
+ N_("* updatev - a verbose version of update\n"
"\treturns information about values, RRAs, and datasources updated\n\n"
"\trrdtool updatev filename\n"
"\t\t--template|-t ds-name:ds-name:...\n"
"\t\ttime|N:value[:value...]\n\n"
"\t\tat-time@value[:value...]\n\n"
- "\t\t[ time:value[:value...] ..]\n\n";
+ "\t\t[ time:value[:value...] ..]\n\n");
char help_fetch[] =
- "* fetch - fetch data out of an RRD\n\n"
+ N_("* fetch - fetch data out of an RRD\n\n"
"\trrdtool fetch filename.rrd CF\n"
"\t\t[-r|--resolution resolution]\n"
- "\t\t[-s|--start start] [-e|--end end]\n\n";
+ "\t\t[-s|--start start] [-e|--end end]\n\n");
/* break up very large strings (help_graph, help_tune) for ISO C89 compliance*/
char help_graph1[] =
- "* graph - generate a graph from one or several RRD\n\n"
+ N_("* graph - generate a graph from one or several RRD\n\n"
"\trrdtool graph filename [-s|--start seconds] [-e|--end seconds]\n"
"\t\t[-x|--x-grid x-axis grid and label]\n"
"\t\t[-Y|--alt-y-grid]\n"
"\t\t[-u|--upper-limit value] [-z|--lazy]\n"
"\t\t[-l|--lower-limit value] [-r|--rigid]\n"
"\t\t[-g|--no-legend]\n"
- "\t\t[-F|--force-rules-legend]\n" "\t\t[-j|--only-graph]\n";
+ "\t\t[-F|--force-rules-legend]\n" "\t\t[-j|--only-graph]\n");
char help_graph2[] =
"\t\t[-n|--font FONTTAG:size:font]\n"
"\t\t[-m|--zoom factor]\n"
"\t\t[STACK:vname[#rrggbb[aa][:legend]]] (deprecated)\n\n";
char help_tune1[] =
- " * tune - Modify some basic properties of an RRD\n\n"
+ N_(" * tune - Modify some basic properties of an RRD\n\n"
"\trrdtool tune filename\n"
"\t\t[--heartbeat|-h ds-name:heartbeat]\n"
"\t\t[--data-source-type|-d ds-name:DST]\n"
"\t\t[--deltapos scale-value] [--deltaneg scale-value]\n"
"\t\t[--failure-threshold integer]\n"
"\t\t[--window-length integer]\n"
- "\t\t[--alpha adaptation-parameter]\n";
+ "\t\t[--alpha adaptation-parameter]\n");
char help_tune2[] =
- " * tune - Modify some basic properties of an RRD\n\n"
+ N_(" * tune - Modify some basic properties of an RRD\n\n"
"\t\t[--beta adaptation-parameter]\n"
"\t\t[--gamma adaptation-parameter]\n"
"\t\t[--gamma-deviation adaptation-parameter]\n"
- "\t\t[--aberrant-reset ds-name]\n\n";
+ "\t\t[--aberrant-reset ds-name]\n\n");
char help_resize[] =
- " * resize - alter the length of one of the RRAs in an RRD\n\n"
- "\trrdtool resize filename rranum GROW|SHRINK rows\n\n";
+ N_(" * resize - alter the length of one of the RRAs in an RRD\n\n"
+ "\trrdtool resize filename rranum GROW|SHRINK rows\n\n");
char help_xport[] =
- "* xport - generate XML dump from one or several RRD\n\n"
+ N_("* xport - generate XML dump from one or several RRD\n\n"
"\trrdtool xport [-s|--start seconds] [-e|--end seconds]\n"
"\t\t[-m|--maxrows rows]\n"
"\t\t[--step seconds]\n"
"\t\t[--enumds]\n"
"\t\t[DEF:vname=rrd:ds-name:CF]\n"
- "\t\t[CDEF:vname=rpn-expression]\n" "\t\t[XPORT:vname:legend]\n\n";
+ "\t\t[CDEF:vname=rpn-expression]\n" "\t\t[XPORT:vname:legend]\n\n");
char help_quit[] =
- " * quit - closing a session in remote mode\n\n" "\trrdtool quit\n\n";
+ N_(" * quit - closing a session in remote mode\n\n" "\trrdtool quit\n\n");
char help_ls[] =
- " * ls - lists all *.rrd files in current directory\n\n"
- "\trrdtool ls\n\n";
+ N_(" * ls - lists all *.rrd files in current directory\n\n"
+ "\trrdtool ls\n\n");
char help_cd[] =
- " * cd - changes the current directory\n\n"
- "\trrdtool cd new directory\n\n";
+ N_(" * cd - changes the current directory\n\n"
+ "\trrdtool cd new directory\n\n");
char help_mkdir[] =
- " * mkdir - creates a new directory\n\n"
- "\trrdtool mkdir newdirectoryname\n\n";
+ N_(" * mkdir - creates a new directory\n\n"
+ "\trrdtool mkdir newdirectoryname\n\n");
char help_pwd[] =
- " * pwd - returns the current working directory\n\n"
- "\trrdtool pwd\n\n";
+ N_(" * pwd - returns the current working directory\n\n"
+ "\trrdtool pwd\n\n");
char help_lic[] =
- "RRDtool is distributed under the Terms of the GNU General\n"
+ N_("RRDtool is distributed under the Terms of the GNU General\n"
"Public License Version 2. (www.gnu.org/copyleft/gpl.html)\n\n"
- "For more information read the RRD manpages\n\n";
+ "For more information read the RRD manpages\n\n");
enum { C_NONE, C_CREATE, C_DUMP, C_INFO, C_RESTORE, C_LAST,
C_LASTUPDATE, C_FIRST, C_UPDATE, C_FETCH, C_GRAPH, C_TUNE,
else if (!strcmp(cmd, "pwd"))
help_cmd = C_PWD;
}
- fputs(help_main, stdout);
+ fprintf (stdout, _(help_main), PACKAGE_VERSION, __DATE__, __TIME__);
+ fflush (stdout);
switch (help_cmd) {
case C_NONE:
- fputs(help_list, stdout);
+ fputs(_(help_list), stdout);
if (RemoteMode) {
- fputs(help_listremote, stdout);
+ fputs(_(help_listremote), stdout);
}
break;
case C_CREATE:
- fputs(help_create, stdout);
+ fputs(_(help_create), stdout);
break;
case C_DUMP:
- fputs(help_dump, stdout);
+ fputs(_(help_dump), stdout);
break;
case C_INFO:
- fputs(help_info, stdout);
+ fputs(_(help_info), stdout);
break;
case C_RESTORE:
- fputs(help_restore, stdout);
+ fputs(_(help_restore), stdout);
break;
case C_LAST:
- fputs(help_last, stdout);
+ fputs(_(help_last), stdout);
break;
case C_LASTUPDATE:
- fputs(help_lastupdate, stdout);
+ fputs(_(help_lastupdate), stdout);
break;
case C_FIRST:
- fputs(help_first, stdout);
+ fputs(_(help_first), stdout);
break;
case C_UPDATE:
- fputs(help_update, stdout);
+ fputs(_(help_update), stdout);
break;
case C_UPDATEV:
- fputs(help_updatev, stdout);
+ fputs(_(help_updatev), stdout);
break;
case C_FETCH:
- fputs(help_fetch, stdout);
+ fputs(_(help_fetch), stdout);
break;
case C_GRAPH:
- fputs(help_graph1, stdout);
+ fputs(_(help_graph1), stdout);
fputs(help_graph2, stdout);
fputs(help_graph3, stdout);
break;
case C_TUNE:
- fputs(help_tune1, stdout);
- fputs(help_tune2, stdout);
+ fputs(_(help_tune1), stdout);
+ fputs(_(help_tune2), stdout);
break;
case C_RESIZE:
- fputs(help_resize, stdout);
+ fputs(_(help_resize), stdout);
break;
case C_XPORT:
- fputs(help_xport, stdout);
+ fputs(_(help_xport), stdout);
break;
case C_QUIT:
- fputs(help_quit, stdout);
+ fputs(_(help_quit), stdout);
break;
case C_LS:
- fputs(help_ls, stdout);
+ fputs(_(help_ls), stdout);
break;
case C_CD:
- fputs(help_cd, stdout);
+ fputs(_(help_cd), stdout);
break;
case C_MKDIR:
- fputs(help_mkdir, stdout);
+ fputs(_(help_mkdir), stdout);
break;
case C_PWD:
- fputs(help_pwd, stdout);
+ fputs(_(help_pwd), stdout);
break;
}
- fputs(help_lic, stdout);
+ fputs(_(help_lic), stdout);
}
static char *fgetslong(
#endif
#ifdef MUST_DISABLE_FPMASK
fpsetmask(0);
+#endif
+#ifdef HAVE_LOCALE_H
+ setlocale (LC_ALL, "");
+#endif
+#ifdef HAVE_LIBINTL_H
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
#endif
if (argc == 1) {
PrintUsage("");