diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-04-27 00:50:31 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-04-27 00:50:31 +0300 |
commit | fe8f5226e8bc39bdc75e40e1c1ea464e9fc60ad3 (patch) | |
tree | 611a7c8505a0eb77a2b84de5dab80b6ca02a14e6 /src | |
parent | d50fc04ded36255465184a16c70eb4c50acdb199 (diff) | |
download | tagr-fe8f5226e8bc39bdc75e40e1c1ea464e9fc60ad3.tar.gz tagr-fe8f5226e8bc39bdc75e40e1c1ea464e9fc60ad3.tar.bz2 |
Provide i18n markers
Diffstat (limited to 'src')
-rw-r--r-- | src/graph.c | 1 | ||||
-rw-r--r-- | src/html.gram.y | 34 | ||||
-rw-r--r-- | src/html.lex.l | 10 | ||||
-rw-r--r-- | src/log.c | 16 | ||||
-rw-r--r-- | src/main.c | 77 | ||||
-rw-r--r-- | src/readconfig.c | 32 | ||||
-rw-r--r-- | src/report.c | 40 | ||||
-rw-r--r-- | src/stat.c | 65 | ||||
-rw-r--r-- | src/tagr.h | 5 |
9 files changed, 149 insertions, 131 deletions
diff --git a/src/graph.c b/src/graph.c index bfd00cb..1464e8b 100644 --- a/src/graph.c +++ b/src/graph.c | |||
@@ -56,2 +56,3 @@ int graph_v_margin[2] = { 14, 35 }; | |||
56 | 56 | ||
57 | /* FIXME: I18N?? */ | ||
57 | char *rate_unit = "Bytes per Second"; | 58 | char *rate_unit = "Bytes per Second"; |
diff --git a/src/html.gram.y b/src/html.gram.y index fae64ff..e488494 100644 --- a/src/html.gram.y +++ b/src/html.gram.y | |||
@@ -115,3 +115,3 @@ expr : value | |||
115 | { | 115 | { |
116 | yyerror ("type mismatch in addition"); | 116 | yyerror (_("type mismatch in addition")); |
117 | init_value (&$$, unspecified_value, NULL); | 117 | init_value (&$$, unspecified_value, NULL); |
@@ -147,3 +147,3 @@ expr : value | |||
147 | { | 147 | { |
148 | yyerror ("type mismatch in subtraction"); | 148 | yyerror (_("type mismatch in subtraction")); |
149 | init_value (&$$, unspecified_value, NULL); | 149 | init_value (&$$, unspecified_value, NULL); |
@@ -152,3 +152,3 @@ expr : value | |||
152 | { | 152 | { |
153 | yyerror ("subtraction not defined for strings"); | 153 | yyerror (_("subtraction not defined for strings")); |
154 | init_value (&$$, unspecified_value, NULL); | 154 | init_value (&$$, unspecified_value, NULL); |
@@ -169,3 +169,3 @@ expr : value | |||
169 | { | 169 | { |
170 | yyerror ("type mismatch in multiplication"); | 170 | yyerror (_("type mismatch in multiplication")); |
171 | init_value (&$$, unspecified_value, NULL); | 171 | init_value (&$$, unspecified_value, NULL); |
@@ -174,3 +174,3 @@ expr : value | |||
174 | { | 174 | { |
175 | yyerror ("multiplication not defined for strings"); | 175 | yyerror (_("multiplication not defined for strings")); |
176 | init_value (&$$, unspecified_value, NULL); | 176 | init_value (&$$, unspecified_value, NULL); |
@@ -191,3 +191,3 @@ expr : value | |||
191 | { | 191 | { |
192 | yyerror ("type mismatch in division"); | 192 | yyerror (_("type mismatch in division")); |
193 | init_value (&$$, unspecified_value, NULL); | 193 | init_value (&$$, unspecified_value, NULL); |
@@ -196,3 +196,3 @@ expr : value | |||
196 | { | 196 | { |
197 | yyerror ("division not defined for strings"); | 197 | yyerror (_("division not defined for strings")); |
198 | init_value (&$$, unspecified_value, NULL); | 198 | init_value (&$$, unspecified_value, NULL); |
@@ -201,3 +201,3 @@ expr : value | |||
201 | { | 201 | { |
202 | yyerror ("division by zero"); | 202 | yyerror (_("division by zero")); |
203 | init_value (&$$, unspecified_value, NULL); | 203 | init_value (&$$, unspecified_value, NULL); |
@@ -217,3 +217,3 @@ expr : value | |||
217 | { | 217 | { |
218 | yyerror ("unary minus not defined for strings"); | 218 | yyerror (_("unary minus not defined for strings")); |
219 | init_value (&$$, unspecified_value, NULL); | 219 | init_value (&$$, unspecified_value, NULL); |
@@ -232,3 +232,3 @@ expr : value | |||
232 | { | 232 | { |
233 | yyerror ("unary plus not defined for strings"); | 233 | yyerror (_("unary plus not defined for strings")); |
234 | init_value (&$$, unspecified_value, NULL); | 234 | init_value (&$$, unspecified_value, NULL); |
@@ -275,3 +275,3 @@ create_html (pp_tab_t *tab, char *file, char *dest) | |||
275 | { | 275 | { |
276 | logmsg (L_ERR, "cannot open output file `%s': %s", | 276 | logmsg (L_ERR, _("cannot open output file `%s': %s"), |
277 | file, strerror (errno)); | 277 | file, strerror (errno)); |
@@ -288,3 +288,3 @@ create_html (pp_tab_t *tab, char *file, char *dest) | |||
288 | { | 288 | { |
289 | logmsg (L_ERR, "cannot unlink file `%s': %s", | 289 | logmsg (L_ERR, _("cannot unlink file `%s': %s"), |
290 | dest, strerror (errno)); | 290 | dest, strerror (errno)); |
@@ -295,3 +295,3 @@ create_html (pp_tab_t *tab, char *file, char *dest) | |||
295 | { | 295 | { |
296 | logmsg (L_ERR, "cannot rename `%s' to `%s': %s", | 296 | logmsg (L_ERR, _("cannot rename `%s' to `%s': %s"), |
297 | tmp_file_name, dest, | 297 | tmp_file_name, dest, |
@@ -496,3 +496,3 @@ read_symtab (pp_tab_t **tab, const char *name) | |||
496 | { | 496 | { |
497 | logmsg (L_ERR, "%s:%u: invalid input: %s", | 497 | logmsg (L_ERR, _("%s:%u: invalid input: %s"), |
498 | name, line, buf); | 498 | name, line, buf); |
@@ -505,3 +505,3 @@ read_symtab (pp_tab_t **tab, const char *name) | |||
505 | { | 505 | { |
506 | logmsg (L_ERR, "%s:%u: invalid input: %s", | 506 | logmsg (L_ERR, _("%s:%u: invalid input: %s"), |
507 | name, line, buf); | 507 | name, line, buf); |
@@ -525,3 +525,3 @@ read_symtab (pp_tab_t **tab, const char *name) | |||
525 | { | 525 | { |
526 | logmsg (L_ERR, "%s:%u: invalid numeric value: %s", | 526 | logmsg (L_ERR, _("%s:%u: invalid numeric value: %s"), |
527 | name, line, value); | 527 | name, line, value); |
@@ -535,3 +535,3 @@ read_symtab (pp_tab_t **tab, const char *name) | |||
535 | default: | 535 | default: |
536 | logmsg (L_NOTICE, "%s:%u: ignoring unknown command %#03o", | 536 | logmsg (L_NOTICE, _("%s:%u: ignoring unknown command %#03o"), |
537 | name, line, cmd); | 537 | name, line, cmd); |
diff --git a/src/html.lex.l b/src/html.lex.l index 931bfc1..0e0d423 100644 --- a/src/html.lex.l +++ b/src/html.lex.l | |||
@@ -45,3 +45,3 @@ N [0-9]+ | |||
45 | { | 45 | { |
46 | yyerror ("unknown identifier"); | 46 | yyerror (_("unknown identifier")); |
47 | init_value (&yylval.value, unspecified_value, NULL); | 47 | init_value (&yylval.value, unspecified_value, NULL); |
@@ -54,3 +54,3 @@ N [0-9]+ | |||
54 | { | 54 | { |
55 | yyerror ("unknown identifier"); | 55 | yyerror (_("unknown identifier")); |
56 | init_value (&yylval.value, unspecified_value, NULL); | 56 | init_value (&yylval.value, unspecified_value, NULL); |
@@ -64,3 +64,3 @@ N [0-9]+ | |||
64 | { | 64 | { |
65 | yyerror ("unknown identifier"); | 65 | yyerror (_("unknown identifier")); |
66 | init_value (&yylval.value, unspecified_value, NULL); | 66 | init_value (&yylval.value, unspecified_value, NULL); |
@@ -79,3 +79,3 @@ N [0-9]+ | |||
79 | { | 79 | { |
80 | yyerror ("unknown identifier"); | 80 | yyerror (_("unknown identifier")); |
81 | init_value (&yylval.value, unspecified_value, NULL); | 81 | init_value (&yylval.value, unspecified_value, NULL); |
@@ -132,3 +132,3 @@ html_open (char *file) | |||
132 | { | 132 | { |
133 | logmsg (L_ERR, "cannot open input file `%s': %s", | 133 | logmsg (L_ERR, _("cannot open input file `%s': %s"), |
134 | file, strerror (errno)); | 134 | file, strerror (errno)); |
@@ -31,3 +31,3 @@ | |||
31 | 31 | ||
32 | int log_facility = LOGFACILITY; | 32 | int log_facility = LOG_FACILITY; |
33 | char *log_tag; | 33 | char *log_tag; |
@@ -53,8 +53,8 @@ int syslog_level[] = { | |||
53 | char *level_str[] = { | 53 | char *level_str[] = { |
54 | "debug", | 54 | N_("debug"), |
55 | "info", | 55 | N_("info"), |
56 | "notice", | 56 | N_("notice"), |
57 | "warning", | 57 | N_("warning"), |
58 | "error", | 58 | N_("error"), |
59 | "CRITICAL", | 59 | N_("CRITICAL"), |
60 | }; | 60 | }; |
@@ -67,3 +67,3 @@ vlogmsg (int level, const char *fmt, va_list ap) | |||
67 | { | 67 | { |
68 | fprintf (stderr, "%s: %s: ", log_tag, level_str[level]); | 68 | fprintf (stderr, "%s: %s: ", log_tag, gettext (level_str[level])); |
69 | vfprintf (stderr, fmt, ap); | 69 | vfprintf (stderr, fmt, ap); |
@@ -82,4 +82,4 @@ static char *html_template_option = NULL; | |||
82 | const char *program_version = "tagr (" PACKAGE_STRING ")"; | 82 | const char *program_version = "tagr (" PACKAGE_STRING ")"; |
83 | static char doc[] = "tagr -- traffic analyzer and grapher"; | 83 | static char doc[] = N_("tagr -- traffic analyzer and grapher"); |
84 | static char args_doc[] = ""; | 84 | static char args_doc[] = "[FILES or DIRS...]"; |
85 | 85 | ||
@@ -114,3 +114,3 @@ static struct argp_option options[] = { | |||
114 | {"read", OPT_READ, NULL, 0, | 114 | {"read", OPT_READ, NULL, 0, |
115 | N_("read statistics from the given file or standard input") }, | 115 | N_("read statistics from given FILEs or standard input") }, |
116 | {"rebuild", 'b', NULL, 0, | 116 | {"rebuild", 'b', NULL, 0, |
@@ -189,8 +189,8 @@ show_defaults () | |||
189 | { | 189 | { |
190 | printf ("Configuration file: %s\n", TAGR_CONFIGFILE); | 190 | printf (_("Configuration file: %s\n"), TAGR_CONFIGFILE); |
191 | printf ("Page template file: %s\n", TAGR_TEMPLATE); | 191 | printf (_("Page template file: %s\n"), TAGR_TEMPLATE); |
192 | printf ("PID file: %s\n", TAGR_PIDFILE); | 192 | printf (_("PID file: %s\n"), TAGR_PIDFILE); |
193 | printf ("DB file name: %s\n", TAGR_DBNAME); | 193 | printf (_("DB file name: %s\n"), TAGR_DBNAME); |
194 | printf ("DB file permissions: %#o\n", TAGR_DBMODE); | 194 | printf (_("DB file permissions: %#o\n"), TAGR_DBMODE); |
195 | printf ("Syslog facility number: %d\n", LOGFACILITY); | 195 | printf (_("Syslog facility number: %d\n"), LOG_FACILITY); |
196 | } | 196 | } |
@@ -337,3 +337,3 @@ change_privs (uid_t uid, gid_t gid) | |||
337 | { | 337 | { |
338 | logmsg (L_ERR, "setgroups(1, %lu) failed: %s", | 338 | logmsg (L_ERR, _("setgroups(1, %lu) failed: %s"), |
339 | (u_long) emptygidset[0], strerror (errno)); | 339 | (u_long) emptygidset[0], strerror (errno)); |
@@ -347,6 +347,7 @@ change_privs (uid_t uid, gid_t gid) | |||
347 | if ((rc = setegid (gid)) < 0) | 347 | if ((rc = setegid (gid)) < 0) |
348 | logmsg (L_ERR, "setegid(%lu) failed: %s", (u_long) gid, strerror (errno)); | 348 | logmsg (L_ERR, _("setegid(%lu) failed: %s"), |
349 | (u_long) gid, strerror (errno)); | ||
349 | #elif defined(HAVE_SETREGID) | 350 | #elif defined(HAVE_SETREGID) |
350 | if ((rc = setregid (gid, gid)) < 0) | 351 | if ((rc = setregid (gid, gid)) < 0) |
351 | logmsg (L_ERR, "setregid(%lu,%lu) failed: %s", | 352 | logmsg (L_ERR, _("setregid(%lu,%lu) failed: %s"), |
352 | (u_long) gid, (u_long) gid, strerror (errno)); | 353 | (u_long) gid, (u_long) gid, strerror (errno)); |
@@ -354,3 +355,3 @@ change_privs (uid_t uid, gid_t gid) | |||
354 | if ((rc = setresgid (gid, gid, gid)) < 0) | 355 | if ((rc = setresgid (gid, gid, gid)) < 0) |
355 | logmsg (L_ERR, "setresgid(%lu,%lu,%lu) failed: %s", | 356 | logmsg (L_ERR, _("setresgid(%lu,%lu,%lu) failed: %s"), |
356 | (u_long) gid, (u_long) gid, (u_long) gid, strerror (errno)); | 357 | (u_long) gid, (u_long) gid, (u_long) gid, strerror (errno)); |
@@ -361,3 +362,3 @@ change_privs (uid_t uid, gid_t gid) | |||
361 | if ((rc = setgid (gid)) < 0 && getegid () != gid) | 362 | if ((rc = setgid (gid)) < 0 && getegid () != gid) |
362 | logmsg (L_ERR, "setgid(%lu) failed: %s", | 363 | logmsg (L_ERR, _("setgid(%lu) failed: %s"), |
363 | (u_long) gid, strerror (errno)); | 364 | (u_long) gid, strerror (errno)); |
@@ -365,3 +366,3 @@ change_privs (uid_t uid, gid_t gid) | |||
365 | { | 366 | { |
366 | logmsg (L_ERR, "cannot set effective gid to %lu: %s", | 367 | logmsg (L_ERR, _("cannot set effective gid to %lu: %s"), |
367 | (u_long) gid, strerror (errno)); | 368 | (u_long) gid, strerror (errno)); |
@@ -387,3 +388,3 @@ change_privs (uid_t uid, gid_t gid) | |||
387 | logmsg (L_ERR, | 388 | logmsg (L_ERR, |
388 | "setreuid(%lu,-1) failed: %s", | 389 | _("setreuid(%lu,-1) failed: %s"), |
389 | (u_long) uid, strerror (errno)); | 390 | (u_long) uid, strerror (errno)); |
@@ -394,3 +395,3 @@ change_privs (uid_t uid, gid_t gid) | |||
394 | logmsg (L_ERR, | 395 | logmsg (L_ERR, |
395 | "second setuid(%lu) failed: %s", | 396 | _("second setuid(%lu) failed: %s"), |
396 | (u_long) uid, strerror (errno)); | 397 | (u_long) uid, strerror (errno)); |
@@ -402,3 +403,3 @@ change_privs (uid_t uid, gid_t gid) | |||
402 |