aboutsummaryrefslogtreecommitdiff
path: root/src/report.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/report.c')
-rw-r--r--src/report.c40
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)
if (dbf == NULL)
{
- logmsg (L_ERR, "Cannot open database %s: %s",
+ logmsg (L_ERR, _("cannot open database %s: %s"),
dbname, gdbm_strerror (gdbm_errno));
exit (1);
@@ -92,8 +92,9 @@ _read_db (datum key, struct traffic_record **tr)
content = gdbm_fetch (dbf, key);
if (content.dptr == NULL)
- logmsg (L_NOTICE, "Record for %*.*s not found", key.dsize, key.dsize, key.dptr);
+ logmsg (L_NOTICE, _("record for %*.*s not found"),
+ key.dsize, key.dsize, key.dptr);
else if (content.dsize != sizeof **tr)
{
- logmsg (L_ERR, "Wrong record size for %*.*s: %lu",
+ logmsg (L_ERR, _("wrong record size for %*.*s: %lu"),
key.dsize, key.dsize, key.dptr, content.dsize);
}
@@ -105,5 +106,5 @@ _read_db (datum key, struct traffic_record **tr)
}
- logmsg (L_NOTICE, "Creating record for %*.*s",
+ logmsg (L_NOTICE, _("creating record for %*.*s"),
key.dsize, key.dsize, key.dptr);
*tr = xmalloc (sizeof **tr);
@@ -137,5 +138,5 @@ write_db (struct monitor *mon, struct traffic_record *tr)
if (gdbm_store (dbf, key, content, GDBM_REPLACE))
{
- logmsg (L_ERR, "Failed to write data for %s: %s",
+ logmsg (L_ERR, _("failed to write data for %s: %s"),
mon->id, gdbm_strerror (gdbm_errno));
}
@@ -148,5 +149,7 @@ print_queue (const char *title, queue_t *q)
count = queue_count (q);
- printf ("%s (%d entries):\n", title, count);
+ printf (ngettext ("%s (%d entry):\n", "%s (%d entries):\n",
+ count),
+ title, count);
for (i = count - 1; i >= 0; i--)
{
@@ -176,18 +179,19 @@ print_tr (datum key, struct traffic_record *tr)
printf ("ID: %*.*s\n", key.dsize, key.dsize, key.dptr);
strftime (buf, sizeof buf, "%c", tm);
- printf ("Last sample: %lu (%s) %lu %lu\n",
+ printf (_("Last sample: %lu (%s) %lu %lu\n"),
tr->last.time, buf, tr->last.in, tr->last.out);
- printf ("Last rates: %g %g\n", tr->last_rates.inrate, tr->last_rates.outrate);
- print_queue ("Daily rates", &tr->day_hist);
+ printf (_("Last rates: %g %g\n"),
+ tr->last_rates.inrate, tr->last_rates.outrate);
+ print_queue (_("Daily rates"), &tr->day_hist);
- print_avg ("Weekly average", &tr->week_avg);
- print_queue ("Weekly rates", &tr->week_hist);
+ print_avg (_("Weekly average"), &tr->week_avg);
+ print_queue (_("Weekly rates"), &tr->week_hist);
- print_avg ("Monthly average", &tr->month_avg);
- print_queue ("Monthly rates", &tr->month_hist);
+ print_avg (_("Monthly average"), &tr->month_avg);
+ print_queue (_("Monthly rates"), &tr->month_hist);
- print_avg ("Yearly average", &tr->year_avg);
- print_queue ("Yearly rates", &tr->year_hist);
+ print_avg (_("Yearly average"), &tr->year_avg);
+ print_queue (_("Yearly rates"), &tr->year_hist);
}
@@ -233,5 +237,5 @@ report (Stat *stat, time_t timestamp)
}
else
- logmsg (L_WARNING, "%s not found in config", stat->name);
+ logmsg (L_WARNING, _("%s not found in config"), stat->name);
}
@@ -274,5 +278,5 @@ rebuild (int force)
time_t now = time (NULL);
- verbose (1, "rebuild initiated");
+ verbose (1, _("rebuild initiated"));
open_db (TAGR_DB_WR);
key = gdbm_firstkey (dbf);
@@ -285,4 +289,4 @@ rebuild (int force)
}
close_db ();
- verbose (1, "rebuild finished");
+ verbose (1, _("rebuild finished"));
}

Return to:

Send suggestions and report system problems to the System administrator.