summaryrefslogtreecommitdiffabout
path: root/src/report.c
Side-by-side diff
Diffstat (limited to 'src/report.c') (more/less context) (ignore whitespace changes)
-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
@@ -53,7 +53,7 @@ open_db (int flag)
TAGR_DBMODE, tagr_db_report);
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);
}
@@ -91,10 +91,11 @@ _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);
}
else
@@ -104,7 +105,7 @@ _read_db (datum key, struct traffic_record **tr)
return;
}
- logmsg (L_NOTICE, "Creating record for %*.*s",
+ logmsg (L_NOTICE, _("creating record for %*.*s"),
key.dsize, key.dsize, key.dptr);
*tr = xmalloc (sizeof **tr);
memset (*tr, 0, sizeof **tr);
@@ -136,7 +137,7 @@ 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));
}
}
@@ -147,7 +148,9 @@ print_queue (const char *title, queue_t *q)
int i, count;
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--)
{
struct traffic_history *th = queue_get_ptr (q, i);
@@ -175,20 +178,21 @@ print_tr (datum key, struct traffic_record *tr)
tm = localtime (&tr->last.time);
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);
}
void
@@ -232,7 +236,7 @@ report (Stat *stat, time_t timestamp)
free (tr);
}
else
- logmsg (L_WARNING, "%s not found in config", stat->name);
+ logmsg (L_WARNING, _("%s not found in config"), stat->name);
}
int
@@ -273,7 +277,7 @@ rebuild (int force)
datum content;
time_t now = time (NULL);
- verbose (1, "rebuild initiated");
+ verbose (1, _("rebuild initiated"));
open_db (TAGR_DB_WR);
key = gdbm_firstkey (dbf);
while (key.dptr)
@@ -284,5 +288,5 @@ rebuild (int force)
key = nextkey;
}
close_db ();
- verbose (1, "rebuild finished");
+ verbose (1, _("rebuild finished"));
}

Return to:

Send suggestions and report system problems to the System administrator.