diff options
Diffstat (limited to 'src/report.c')
-rw-r--r-- | src/report.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/report.c b/src/report.c index ed8a34d..ed3a81b 100644 --- a/src/report.c +++ b/src/report.c | |||
@@ -54,5 +54,5 @@ open_db (int flag) | |||
54 | if (dbf == NULL) | 54 | if (dbf == NULL) |
55 | { | 55 | { |
56 | logmsg (L_ERR, "Cannot open database %s: %s", | 56 | logmsg (L_ERR, _("cannot open database %s: %s"), |
57 | dbname, gdbm_strerror (gdbm_errno)); | 57 | dbname, gdbm_strerror (gdbm_errno)); |
58 | exit (1); | 58 | exit (1); |
@@ -92,8 +92,9 @@ _read_db (datum key, struct traffic_record **tr) | |||
92 | content = gdbm_fetch (dbf, key); | 92 | content = gdbm_fetch (dbf, key); |
93 | if (content.dptr == NULL) | 93 | if (content.dptr == NULL) |
94 | logmsg (L_NOTICE, "Record for %*.*s not found", key.dsize, key.dsize, key.dptr); | 94 | logmsg (L_NOTICE, _("record for %*.*s not found"), |
95 | key.dsize, key.dsize, key.dptr); | ||
95 | else if (content.dsize != sizeof **tr) | 96 | else if (content.dsize != sizeof **tr) |
96 | { | 97 | { |
97 | logmsg (L_ERR, "Wrong record size for %*.*s: %lu", | 98 | logmsg (L_ERR, _("wrong record size for %*.*s: %lu"), |
98 | key.dsize, key.dsize, key.dptr, content.dsize); | 99 | key.dsize, key.dsize, key.dptr, content.dsize); |
99 | } | 100 | } |
@@ -105,5 +106,5 @@ _read_db (datum key, struct traffic_record **tr) | |||
105 | } | 106 | } |
106 | 107 | ||
107 | logmsg (L_NOTICE, "Creating record for %*.*s", | 108 | logmsg (L_NOTICE, _("creating record for %*.*s"), |
108 | key.dsize, key.dsize, key.dptr); | 109 | key.dsize, key.dsize, key.dptr); |
109 | *tr = xmalloc (sizeof **tr); | 110 | *tr = xmalloc (sizeof **tr); |
@@ -137,5 +138,5 @@ write_db (struct monitor *mon, struct traffic_record *tr) | |||
137 | if (gdbm_store (dbf, key, content, GDBM_REPLACE)) | 138 | if (gdbm_store (dbf, key, content, GDBM_REPLACE)) |
138 | { | 139 | { |
139 | logmsg (L_ERR, "Failed to write data for %s: %s", | 140 | logmsg (L_ERR, _("failed to write data for %s: %s"), |
140 | mon->id, gdbm_strerror (gdbm_errno)); | 141 | mon->id, gdbm_strerror (gdbm_errno)); |
141 | } | 142 | } |
@@ -148,5 +149,7 @@ print_queue (const char *title, queue_t *q) | |||
148 | 149 | ||
149 | count = queue_count (q); | 150 | count = queue_count (q); |
150 | printf ("%s (%d entries):\n", title, count); | 151 | printf (ngettext ("%s (%d entry):\n", "%s (%d entries):\n", |
152 | count), | ||
153 | title, count); | ||
151 | for (i = count - 1; i >= 0; i--) | 154 | for (i = count - 1; i >= 0; i--) |
152 | { | 155 | { |
@@ -176,18 +179,19 @@ print_tr (datum key, struct traffic_record *tr) | |||
176 | printf ("ID: %*.*s\n", key.dsize, key.dsize, key.dptr); | 179 | printf ("ID: %*.*s\n", key.dsize, key.dsize, key.dptr); |
177 | strftime (buf, sizeof buf, "%c", tm); | 180 | strftime (buf, sizeof buf, "%c", tm); |
178 | printf ("Last sample: %lu (%s) %lu %lu\n", | 181 | printf (_("Last sample: %lu (%s) %lu %lu\n"), |
179 | tr->last.time, buf, tr->last.in, tr->last.out); | 182 | tr->last.time, buf, tr->last.in, tr->last.out); |
180 | 183 | ||
181 | printf ("Last rates: %g %g\n", tr->last_rates.inrate, tr->last_rates.outrate); | 184 | printf (_("Last rates: %g %g\n"), |
182 | print_queue ("Daily rates", &tr->day_hist); | 185 | tr->last_rates.inrate, tr->last_rates.outrate); |
186 | print_queue (_("Daily rates"), &tr->day_hist); | ||
183 | 187 | ||
184 | print_avg ("Weekly average", &tr->week_avg); | 188 | print_avg (_("Weekly average"), &tr->week_avg); |
185 | print_queue ("Weekly rates", &tr->week_hist); | 189 | print_queue (_("Weekly rates"), &tr->week_hist); |
186 | 190 | ||
187 | print_avg ("Monthly average", &tr->month_avg); | 191 | print_avg (_("Monthly average"), &tr->month_avg); |
188 | print_queue ("Monthly rates", &tr->month_hist); | 192 | print_queue (_("Monthly rates"), &tr->month_hist); |
189 | 193 | ||
190 | print_avg ("Yearly average", &tr->year_avg); | 194 | print_avg (_("Yearly average"), &tr->year_avg); |
191 | print_queue ("Yearly rates", &tr->year_hist); | 195 | print_queue (_("Yearly rates"), &tr->year_hist); |
192 | } | 196 | } |
193 | 197 | ||
@@ -233,5 +237,5 @@ report (Stat *stat, time_t timestamp) | |||
233 | } | 237 | } |
234 | else | 238 | else |
235 | logmsg (L_WARNING, "%s not found in config", stat->name); | 239 | logmsg (L_WARNING, _("%s not found in config"), stat->name); |
236 | } | 240 | } |
237 | 241 | ||
@@ -274,5 +278,5 @@ rebuild (int force) | |||
274 | time_t now = time (NULL); | 278 | time_t now = time (NULL); |
275 | 279 | ||
276 | verbose (1, "rebuild initiated"); | 280 | verbose (1, _("rebuild initiated")); |
277 | open_db (TAGR_DB_WR); | 281 | open_db (TAGR_DB_WR); |
278 | key = gdbm_firstkey (dbf); | 282 | key = gdbm_firstkey (dbf); |
@@ -285,4 +289,4 @@ rebuild (int force) | |||
285 | } | 289 | } |
286 | close_db (); | 290 | close_db (); |
287 | verbose (1, "rebuild finished"); | 291 | verbose (1, _("rebuild finished")); |
288 | } | 292 | } |