Ticket #144: rrdtool-6662646-g11n-i18n-ui-head.diff

File rrdtool-6662646-g11n-i18n-ui-head.diff, 17.5 KB (added by human, 4 years ago)

Patch for Makefile.am, configure.ac, po/LINGUAS, po/POTFILES.in, rrdtool.spec, src/Makefile.am, src/getopt.c, src/rrd_i18n.h, src/rrd_tool.c

  • rrdtool-1.2.99908020600/Makefile.am

    old new  
    22RSYNC = rsync --rsh=ssh 
    33 
    44# build the following subdirectories 
    5 SUBDIRS = src examples doc bindings 
     5SUBDIRS = po src examples doc bindings 
    66 
    77 # the following files are not mentioned in any other Makefile 
    88EXTRA_DIST = COPYRIGHT CHANGES WIN32-BUILD-TIPS.txt TODO CONTRIBUTORS THREADS \ 
  • rrdtool-1.2.99908020600/configure.ac

    old new char *strchr (), *strrchr (); 
    287287dnl Process Special Options 
    288288dnl ----------------------------------- 
    289289 
     290dnl gettext 
     291GETTEXT_PACKAGE=rrdtool 
     292AC_SUBST(GETTEXT_PACKAGE) 
     293AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package]) 
     294IT_PROG_INTLTOOL([0.35.0]) 
     295 
     296AM_GLIB_GNU_GETTEXT 
     297 
    290298dnl How the vertical axis label is printed 
    291299AC_ARG_VAR(RRDGRAPH_YLEGEND_ANGLE,  
    292300 [Vertical label angle: -90.0 (default) or 90.0]) 
    CONFIGURE_PART(Checking for Header Files 
    360368dnl Checks for header files. 
    361369AC_HEADER_STDC 
    362370AC_HEADER_DIRENT 
    363 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) 
     371AC_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) 
    364372 
    365373dnl Checks for typedefs, structures, and compiler characteristics. 
    366374AC_C_CONST 
    AC_CONFIG_FILES([examples/4charts.pl]) 
    830838AC_CONFIG_FILES([examples/perftest.pl]) 
    831839AC_CONFIG_FILES([examples/Makefile]) 
    832840AC_CONFIG_FILES([doc/Makefile]) 
     841AC_CONFIG_FILES([po/Makefile.in]) 
    833842AC_CONFIG_FILES([src/Makefile]) 
    834843AC_CONFIG_FILES([bindings/Makefile]) 
    835844AC_CONFIG_FILES([bindings/tcl/Makefile]) 
  • rrdtool-1.2.99908020600/po/LINGUAS

    old new  
     1# 
  • rrdtool-1.2.99908020600/po/POTFILES.in

    old new  
     1src/rrd_getopt.c 
     2src/rrd_tool.c 
  • rrdtool-1.2.99908020600/rrdtool.spec

    old new The %{name}-ruby package includes RRDtoo 
    149149    configure Makefile.in php4/configure php4/ltconfig* 
    150150 
    151151%build 
     152intltoolize --automake -c -f 
     153aclocal 
     154autoheader 
     155autoconf 
     156automake -a -c -f 
    152157%configure \ 
    153158    --with-perl-options='INSTALLDIRS="vendor"' \ 
    154159%if %{with_tcl} 
  • rrdtool-1.2.99908020600/src/Makefile.am

    old new if STATIC_PROGRAMS 
    99AM_LDFLAGS = -all-static 
    1010endif 
    1111 
     12INCLUDES = -DLOCALEDIR="\"$(datadir)/locale\"" 
    1213RRD_DEFAULT_FONT=@RRD_DEFAULT_FONT@ 
    1314AM_CPPFLAGS = -DRRD_DEFAULT_FONT=\"$(RRD_DEFAULT_FONT)\" -DNUMVERS=@NUMVERS@ 
    1415 
    RRD_C_FILES = \ 
    5051noinst_HEADERS = \ 
    5152        unused.h \ 
    5253        rrd_getopt.h parsetime.h \ 
     54        rrd_i18n.h \ 
    5355        rrd_format.h rrd_tool.h rrd_xport.h rrd.h rrd_rpncalc.h \ 
    5456        rrd_hw.h rrd_hw_math.h rrd_hw_update.h \ 
    5557        fnv.h rrd_graph.h \ 
  • rrdtool-1.2.99908020600/src/rrd_getopt.c

    old new  
    3434#include "../rrd_config.h" 
    3535#endif 
    3636 
     37#include "rrd_i18n.h" 
     38 
    3739#if !defined (__STDC__) || !__STDC__ 
    3840/* This is a separate conditional since some stdc systems 
    3941   reject `defined (const)'.  */ 
     
    8587#define getpid() GetCurrentProcessId() 
    8688#endif 
    8789 
    88 #ifndef _ 
    89 /* This is for other GNU distributions with internationalized messages. 
    90    When compiling libc, the _ macro is predefined.  */ 
    91 #ifdef HAVE_LIBINTL_H 
    92 # include <libintl.h> 
    93 # define _(msgid)       gettext (msgid) 
    94 #else 
    95 # define _(msgid)       (msgid) 
    96 #endif 
    97 #endif 
    98  
    9990/* This version of `getopt' appears to the caller like standard Unix `getopt' 
    10091   but it behaves differently for the user, since it allows the user 
    10192   to intersperse the options with the other arguments. 
  • rrdtool-1.2.99908020600/src/rrd_i18n.h

    old new  
     1/***************************************************************************** 
     2 * RRDtool 1.2.19  Copyright by Takao Fujiwara, 2008 
     3 ***************************************************************************** 
     4 * rrd_i18n.h   Common Header File 
     5 *****************************************************************************/ 
     6#ifdef  __cplusplus 
     7extern "C" { 
     8#endif 
     9 
     10 
     11#ifndef _RRD_I18N_H 
     12#define _RRD_I18N_H 
     13 
     14#ifndef _ 
     15/* This is for other GNU distributions with internationalized messages. 
     16   When compiling libc, the _ macro is predefined.  */ 
     17#ifdef HAVE_LIBINTL_H 
     18#  include <libintl.h> 
     19#define _(String) gettext (String) 
     20#else 
     21#define _(String) (String) 
     22#endif 
     23#define N_(String) (String) 
     24#endif 
     25 
     26 
     27#endif 
     28 
     29#ifdef  __cplusplus 
     30} 
     31#endif 
  • rrdtool-1.2.99908020600/src/rrd_tool.c

    old new  
    44 * rrd_tool.c  Startup wrapper 
    55 *****************************************************************************/ 
    66 
     7#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(HAVE_CONFIG_H) 
     8#include "../win32/config.h" 
     9#else 
     10#ifdef HAVE_CONFIG_H 
     11#include "../rrd_config.h" 
     12#endif 
     13#endif 
     14 
    715#include "rrd_tool.h" 
    816#include "rrd_xport.h" 
     17#include "rrd_i18n.h" 
     18 
     19#ifdef HAVE_LOCALE_H 
     20#include <locale.h> 
     21#endif 
    922 
    1023void      PrintUsage( 
    1124    char *cmd); 
    void PrintUsage( 
    3346{ 
    3447 
    3548    char      help_main[] = 
    36         "RRDtool " PACKAGE_VERSION 
     49        N_("RRDtool %s" 
    3750        "  Copyright 1997-2007 by Tobias Oetiker <tobi@oetiker.ch>\n" 
    38         "               Compiled " __DATE__ " " __TIME__ "\n\n" 
    39         "Usage: rrdtool [options] command command_options\n\n"; 
     51        "               Compiled %s %s\n\n" 
     52        "Usage: rrdtool [options] command command_options\n\n"); 
    4053 
    4154    char      help_list[] = 
    42         "Valid commands: create, update, updatev, graph, dump, restore,\n" 
     55        N_("Valid commands: create, update, updatev, graph, dump, restore,\n" 
    4356        "\t\tlast, lastupdate, first, info, fetch, tune,\n" 
    44         "\t\tresize, xport\n\n"; 
     57        "\t\tresize, xport\n\n"); 
    4558 
    4659    char      help_listremote[] = 
    47         "Valid remote commands: quit, ls, cd, mkdir, pwd\n\n"; 
     60        N_("Valid remote commands: quit, ls, cd, mkdir, pwd\n\n"); 
    4861 
    4962 
    5063    char      help_create[] = 
    51         "* create - create a new RRD\n\n" 
     64        N_("* create - create a new RRD\n\n" 
    5265        "\trrdtool create filename [--start|-b start time]\n" 
    5366        "\t\t[--step|-s step]\n" 
    5467        "\t\t[DS:ds-name:DST:dst arguments]\n" 
    55         "\t\t[RRA:CF:cf arguments]\n\n"; 
     68        "\t\t[RRA:CF:cf arguments]\n\n"); 
    5669 
    5770    char      help_dump[] = 
    58         "* dump - dump an RRD to XML\n\n" 
    59         "\trrdtool dump filename.rrd >filename.xml\n\n"; 
     71        N_("* dump - dump an RRD to XML\n\n" 
     72        "\trrdtool dump filename.rrd >filename.xml\n\n"); 
    6073 
    6174    char      help_info[] = 
    62         "* info - returns the configuration and status of the RRD\n\n" 
    63         "\trrdtool info filename.rrd\n\n"; 
     75        N_("* info - returns the configuration and status of the RRD\n\n" 
     76        "\trrdtool info filename.rrd\n\n"); 
    6477 
    6578    char      help_restore[] = 
    66         "* restore - restore an RRD file from its XML form\n\n" 
    67         "\trrdtool restore [--range-check|-r] [--force-overwrite|-f] filename.xml filename.rrd\n\n"; 
     79        N_("* restore - restore an RRD file from its XML form\n\n" 
     80        "\trrdtool restore [--range-check|-r] [--force-overwrite|-f] filename.xml filename.rrd\n\n"); 
    6881 
    6982    char      help_last[] = 
    70         "* last - show last update time for RRD\n\n" 
    71         "\trrdtool last filename.rrd\n\n"; 
     83        N_("* last - show last update time for RRD\n\n" 
     84        "\trrdtool last filename.rrd\n\n"); 
    7285 
    7386    char      help_lastupdate[] = 
    74         "* lastupdate - returns the most recent datum stored for\n" 
    75         "  each DS in an RRD\n\n" "\trrdtool lastupdate filename.rrd\n\n"; 
     87        N_("* lastupdate - returns the most recent datum stored for\n" 
     88        "  each DS in an RRD\n\n" "\trrdtool lastupdate filename.rrd\n\n"); 
    7689 
    7790    char      help_first[] = 
    78         "* first - show first update time for RRA within an RRD\n\n" 
    79         "\trrdtool first filename.rrd [--rraindex number]\n\n"; 
     91        N_("* first - show first update time for RRA within an RRD\n\n" 
     92        "\trrdtool first filename.rrd [--rraindex number]\n\n"); 
    8093 
    8194    char      help_update[] = 
    82         "* update - update an RRD\n\n" 
     95        N_("* update - update an RRD\n\n" 
    8396        "\trrdtool update filename\n" 
    8497        "\t\t--template|-t ds-name:ds-name:...\n" 
    8598        "\t\ttime|N:value[:value...]\n\n" 
    8699        "\t\tat-time@value[:value...]\n\n" 
    87         "\t\t[ time:value[:value...] ..]\n\n"; 
     100        "\t\t[ time:value[:value...] ..]\n\n"); 
    88101 
    89102    char      help_updatev[] = 
    90         "* updatev - a verbose version of update\n" 
     103        N_("* updatev - a verbose version of update\n" 
    91104        "\treturns information about values, RRAs, and datasources updated\n\n" 
    92105        "\trrdtool updatev filename\n" 
    93106        "\t\t--template|-t ds-name:ds-name:...\n" 
    94107        "\t\ttime|N:value[:value...]\n\n" 
    95108        "\t\tat-time@value[:value...]\n\n" 
    96         "\t\t[ time:value[:value...] ..]\n\n"; 
     109        "\t\t[ time:value[:value...] ..]\n\n"); 
    97110 
    98111    char      help_fetch[] = 
    99         "* fetch - fetch data out of an RRD\n\n" 
     112        N_("* fetch - fetch data out of an RRD\n\n" 
    100113        "\trrdtool fetch filename.rrd CF\n" 
    101114        "\t\t[-r|--resolution resolution]\n" 
    102         "\t\t[-s|--start start] [-e|--end end]\n\n"; 
     115        "\t\t[-s|--start start] [-e|--end end]\n\n"); 
    103116 
    104117/* break up very large strings (help_graph, help_tune) for ISO C89 compliance*/ 
    105118 
    106119    char      help_graph1[] = 
    107         "* graph - generate a graph from one or several RRD\n\n" 
     120        N_("* graph - generate a graph from one or several RRD\n\n" 
    108121        "\trrdtool graph filename [-s|--start seconds] [-e|--end seconds]\n" 
    109122        "\t\t[-x|--x-grid x-axis grid and label]\n" 
    110123        "\t\t[-Y|--alt-y-grid]\n" 
    void PrintUsage( 
    114127        "\t\t[-u|--upper-limit value] [-z|--lazy]\n" 
    115128        "\t\t[-l|--lower-limit value] [-r|--rigid]\n" 
    116129        "\t\t[-g|--no-legend]\n" 
    117         "\t\t[-F|--force-rules-legend]\n" "\t\t[-j|--only-graph]\n"; 
     130        "\t\t[-F|--force-rules-legend]\n" "\t\t[-j|--only-graph]\n"); 
    118131    char      help_graph2[] = 
    119132        "\t\t[-n|--font FONTTAG:size:font]\n" 
    120133        "\t\t[-m|--zoom factor]\n" 
    void PrintUsage( 
    148161        "\t\t[STACK:vname[#rrggbb[aa][:legend]]] (deprecated)\n\n"; 
    149162 
    150163    char      help_tune1[] = 
    151         " * tune -  Modify some basic properties of an RRD\n\n" 
     164        N_(" * tune -  Modify some basic properties of an RRD\n\n" 
    152165        "\trrdtool tune filename\n" 
    153166        "\t\t[--heartbeat|-h ds-name:heartbeat]\n" 
    154167        "\t\t[--data-source-type|-d ds-name:DST]\n" 
    void PrintUsage( 
    157170        "\t\t[--deltapos scale-value] [--deltaneg scale-value]\n" 
    158171        "\t\t[--failure-threshold integer]\n" 
    159172        "\t\t[--window-length integer]\n" 
    160         "\t\t[--alpha adaptation-parameter]\n"; 
     173        "\t\t[--alpha adaptation-parameter]\n"); 
    161174    char      help_tune2[] = 
    162         " * tune -  Modify some basic properties of an RRD\n\n" 
     175        N_(" * tune -  Modify some basic properties of an RRD\n\n" 
    163176        "\t\t[--beta adaptation-parameter]\n" 
    164177        "\t\t[--gamma adaptation-parameter]\n" 
    165178        "\t\t[--gamma-deviation adaptation-parameter]\n" 
    166         "\t\t[--aberrant-reset ds-name]\n\n"; 
     179        "\t\t[--aberrant-reset ds-name]\n\n"); 
    167180 
    168181    char      help_resize[] = 
    169         " * resize - alter the length of one of the RRAs in an RRD\n\n" 
    170         "\trrdtool resize filename rranum GROW|SHRINK rows\n\n"; 
     182        N_(" * resize - alter the length of one of the RRAs in an RRD\n\n" 
     183        "\trrdtool resize filename rranum GROW|SHRINK rows\n\n"); 
    171184 
    172185    char      help_xport[] = 
    173         "* xport - generate XML dump from one or several RRD\n\n" 
     186        N_("* xport - generate XML dump from one or several RRD\n\n" 
    174187        "\trrdtool xport [-s|--start seconds] [-e|--end seconds]\n" 
    175188        "\t\t[-m|--maxrows rows]\n" 
    176189        "\t\t[--step seconds]\n" 
    177190        "\t\t[--enumds]\n" 
    178191        "\t\t[DEF:vname=rrd:ds-name:CF]\n" 
    179         "\t\t[CDEF:vname=rpn-expression]\n" "\t\t[XPORT:vname:legend]\n\n"; 
     192        "\t\t[CDEF:vname=rpn-expression]\n" "\t\t[XPORT:vname:legend]\n\n"); 
    180193 
    181194    char      help_quit[] = 
    182         " * quit - closing a session in remote mode\n\n" "\trrdtool quit\n\n"; 
     195        N_(" * quit - closing a session in remote mode\n\n" "\trrdtool quit\n\n"); 
    183196 
    184197    char      help_ls[] = 
    185         " * ls - lists all *.rrd files in current directory\n\n" 
    186         "\trrdtool ls\n\n"; 
     198        N_(" * ls - lists all *.rrd files in current directory\n\n" 
     199        "\trrdtool ls\n\n"); 
    187200 
    188201    char      help_cd[] = 
    189         " * cd - changes the current directory\n\n" 
    190         "\trrdtool cd new directory\n\n"; 
     202        N_(" * cd - changes the current directory\n\n" 
     203        "\trrdtool cd new directory\n\n"); 
    191204 
    192205    char      help_mkdir[] = 
    193         " * mkdir - creates a new directory\n\n" 
    194         "\trrdtool mkdir newdirectoryname\n\n"; 
     206        N_(" * mkdir - creates a new directory\n\n" 
     207        "\trrdtool mkdir newdirectoryname\n\n"); 
    195208 
    196209    char      help_pwd[] = 
    197         " * pwd - returns the current working directory\n\n" 
    198         "\trrdtool pwd\n\n"; 
     210        N_(" * pwd - returns the current working directory\n\n" 
     211        "\trrdtool pwd\n\n"); 
    199212 
    200213    char      help_lic[] = 
    201         "RRDtool is distributed under the Terms of the GNU General\n" 
     214        N_("RRDtool is distributed under the Terms of the GNU General\n" 
    202215        "Public License Version 2. (www.gnu.org/copyleft/gpl.html)\n\n" 
    203         "For more information read the RRD manpages\n\n"; 
     216        "For more information read the RRD manpages\n\n"); 
    204217 
    205218    enum { C_NONE, C_CREATE, C_DUMP, C_INFO, C_RESTORE, C_LAST, 
    206219        C_LASTUPDATE, C_FIRST, C_UPDATE, C_FETCH, C_GRAPH, C_TUNE, 
    void PrintUsage( 
    250263        else if (!strcmp(cmd, "pwd")) 
    251264            help_cmd = C_PWD; 
    252265    } 
    253     fputs(help_main, stdout); 
     266    fprintf (stdout, _(help_main), PACKAGE_VERSION, __DATE__, __TIME__); 
     267    fflush (stdout); 
    254268    switch (help_cmd) { 
    255269    case C_NONE: 
    256         fputs(help_list, stdout); 
     270        fputs(_(help_list), stdout); 
    257271        if (RemoteMode) { 
    258             fputs(help_listremote, stdout); 
     272            fputs(_(help_listremote), stdout); 
    259273        } 
    260274        break; 
    261275    case C_CREATE: 
    262         fputs(help_create, stdout); 
     276        fputs(_(help_create), stdout); 
    263277        break; 
    264278    case C_DUMP: 
    265         fputs(help_dump, stdout); 
     279        fputs(_(help_dump), stdout); 
    266280        break; 
    267281    case C_INFO: 
    268         fputs(help_info, stdout); 
     282        fputs(_(help_info), stdout); 
    269283        break; 
    270284    case C_RESTORE: 
    271         fputs(help_restore, stdout); 
     285        fputs(_(help_restore), stdout); 
    272286        break; 
    273287    case C_LAST: 
    274         fputs(help_last, stdout); 
     288        fputs(_(help_last), stdout); 
    275289        break; 
    276290    case C_LASTUPDATE: 
    277         fputs(help_lastupdate, stdout); 
     291        fputs(_(help_lastupdate), stdout); 
    278292        break; 
    279293    case C_FIRST: 
    280         fputs(help_first, stdout); 
     294        fputs(_(help_first), stdout); 
    281295        break; 
    282296    case C_UPDATE: 
    283         fputs(help_update, stdout); 
     297        fputs(_(help_update), stdout); 
    284298        break; 
    285299    case C_UPDATEV: 
    286         fputs(help_updatev, stdout); 
     300        fputs(_(help_updatev), stdout); 
    287301        break; 
    288302    case C_FETCH: 
    289         fputs(help_fetch, stdout); 
     303        fputs(_(help_fetch), stdout); 
    290304        break; 
    291305    case C_GRAPH: 
    292         fputs(help_graph1, stdout); 
     306        fputs(_(help_graph1), stdout); 
    293307        fputs(help_graph2, stdout); 
    294308        fputs(help_graph3, stdout); 
    295309        break; 
    296310    case C_TUNE: 
    297         fputs(help_tune1, stdout); 
    298         fputs(help_tune2, stdout); 
     311        fputs(_(help_tune1), stdout); 
     312        fputs(_(help_tune2), stdout); 
    299313        break; 
    300314    case C_RESIZE: 
    301         fputs(help_resize, stdout); 
     315        fputs(_(help_resize), stdout); 
    302316        break; 
    303317    case C_XPORT: 
    304         fputs(help_xport, stdout); 
     318        fputs(_(help_xport), stdout); 
    305319        break; 
    306320    case C_QUIT: 
    307         fputs(help_quit, stdout); 
     321        fputs(_(help_quit), stdout); 
    308322        break; 
    309323    case C_LS: 
    310         fputs(help_ls, stdout); 
     324        fputs(_(help_ls), stdout); 
    311325        break; 
    312326    case C_CD: 
    313         fputs(help_cd, stdout); 
     327        fputs(_(help_cd), stdout); 
    314328        break; 
    315329    case C_MKDIR: 
    316         fputs(help_mkdir, stdout); 
     330        fputs(_(help_mkdir), stdout); 
    317331        break; 
    318332    case C_PWD: 
    319         fputs(help_pwd, stdout); 
     333        fputs(_(help_pwd), stdout); 
    320334        break; 
    321335    } 
    322     fputs(help_lic, stdout); 
     336    fputs(_(help_lic), stdout); 
    323337} 
    324338 
    325339static char *fgetslong( 
    int main( 
    364378#ifdef MUST_DISABLE_FPMASK 
    365379    fpsetmask(0); 
    366380#endif 
     381#ifdef HAVE_LOCALE_H 
     382    setlocale (LC_ALL, ""); 
     383#endif 
     384#ifdef HAVE_LIBINTL_H 
     385    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); 
     386    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 
     387    textdomain (GETTEXT_PACKAGE); 
     388#endif 
    367389    if (argc == 1) { 
    368390        PrintUsage(""); 
    369391        return 0; 

NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example. It may also be that you are looking at a mirror page which did not copy the CSS for this page. Or if some pictu res are missing, then the mirror may not have picked up the contents of the inc directory.