aboutsummaryrefslogtreecommitdiff
path: root/src/report.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-04-27 00:50:31 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-04-27 00:50:31 +0300
commitfe8f5226e8bc39bdc75e40e1c1ea464e9fc60ad3 (patch)
tree611a7c8505a0eb77a2b84de5dab80b6ca02a14e6 /src/report.c
parentd50fc04ded36255465184a16c70eb4c50acdb199 (diff)
downloadtagr-fe8f5226e8bc39bdc75e40e1c1ea464e9fc60ad3.tar.gz
tagr-fe8f5226e8bc39bdc75e40e1c1ea464e9fc60ad3.tar.bz2
Provide i18n markers
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
@@ -52,9 +52,9 @@ open_db (int flag)
flag == TAGR_DB_WR ? GDBM_WRCREAT : GDBM_READER,
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);
}
}
@@ -90,12 +90,13 @@ _read_db (datum key, struct traffic_record **tr)
datum content;
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
{
@@ -103,9 +104,9 @@ _read_db (datum key, struct traffic_record **tr)
tr_init (*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);
tr_init (*tr);
@@ -135,9 +136,9 @@ write_db (struct monitor *mon, struct traffic_record *tr)
content.dptr = (char *) 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));
}
}
@@ -146,9 +147,11 @@ 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);
printf("%d %g %g\n", count - i, th->inrate, th->outrate);
@@ -174,22 +177,23 @@ 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
list_db ()
@@ -231,9 +235,9 @@ report (Stat *stat, time_t timestamp)
write_db (mon, tr);
free (tr);
}
else
- logmsg (L_WARNING, "%s not found in config", stat->name);
+ logmsg (L_WARNING, _("%s not found in config"), stat->name);
}
int
update_monitor (datum key, time_t timestamp, int force)
@@ -272,9 +276,9 @@ rebuild (int force)
datum key;
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)
{
@@ -283,6 +287,6 @@ rebuild (int force)
free (key.dptr);
key = nextkey;
}
close_db ();
- verbose (1, "rebuild finished");
+ verbose (1, _("rebuild finished"));
}

Return to:

Send suggestions and report system problems to the System administrator.