Use gettext plural features
Make use of the plural features of gettext to handle plural forms correctly instead of using the plural form even if the singular form should be used. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
e121ded3a5
commit
a232c9af33
@ -194,8 +194,9 @@ dmon_start (int parent_exit_status)
|
|||||||
DMON_LOG (_("error while sending notification\n"));
|
DMON_LOG (_("error while sending notification\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
DMON_LOG (_("sleeping at %s for %d seconds\n"), nowstr (),
|
DMON_LOG (ngettext ("sleeping at %s for %d second\n",
|
||||||
DMON_SLEEP_TIME);
|
"sleeping at %s for %d seconds\n",
|
||||||
|
DMON_SLEEP_TIME), nowstr (), DMON_SLEEP_TIME);
|
||||||
psleep (DMON_SLEEP_TIME);
|
psleep (DMON_SLEEP_TIME);
|
||||||
DMON_LOG (_("awakened at %s\n"), nowstr ());
|
DMON_LOG (_("awakened at %s\n"), nowstr ());
|
||||||
}
|
}
|
||||||
|
14
src/io.c
14
src/io.c
@ -2754,8 +2754,7 @@ io_import_data (enum import_type type, struct conf *conf, char *stream_name)
|
|||||||
const struct string vevent = STRING_BUILD ("BEGIN:VEVENT");
|
const struct string vevent = STRING_BUILD ("BEGIN:VEVENT");
|
||||||
const struct string vtodo = STRING_BUILD ("BEGIN:VTODO");
|
const struct string vtodo = STRING_BUILD ("BEGIN:VTODO");
|
||||||
char *proc_report = _("Import process report: %04d lines read ");
|
char *proc_report = _("Import process report: %04d lines read ");
|
||||||
char *stats_fmt[] = { "%d apps", "%d events", "%d todos", "%d skipped" };
|
char stats_str[4][BUFSIZ];
|
||||||
char stats_str[sizeof (stats_fmt) / sizeof (char *)][BUFSIZ];
|
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
FILE *stream = NULL;
|
FILE *stream = NULL;
|
||||||
struct io_file *log;
|
struct io_file *log;
|
||||||
@ -2817,10 +2816,13 @@ io_import_data (enum import_type type, struct conf *conf, char *stream_name)
|
|||||||
if (stream != stdin)
|
if (stream != stdin)
|
||||||
file_close (stream, __FILE_POS__);
|
file_close (stream, __FILE_POS__);
|
||||||
|
|
||||||
snprintf (stats_str[0], BUFSIZ, _(stats_fmt[0]), stats.apoints);
|
snprintf (stats_str[0], BUFSIZ,
|
||||||
snprintf (stats_str[1], BUFSIZ, _(stats_fmt[1]), stats.events);
|
ngettext ("%d app", "%d apps", stats.apoints), stats.apoints);
|
||||||
snprintf (stats_str[2], BUFSIZ, _(stats_fmt[2]), stats.todos);
|
snprintf (stats_str[1], BUFSIZ,
|
||||||
snprintf (stats_str[3], BUFSIZ, _(stats_fmt[3]), stats.skipped);
|
ngettext ("%d event", "%d events", stats.events), stats.events);
|
||||||
|
snprintf (stats_str[2], BUFSIZ,
|
||||||
|
ngettext ("%d todo", "%d todos", stats.todos), stats.todos);
|
||||||
|
snprintf (stats_str[3], BUFSIZ, _("%d skipped"), stats.skipped);
|
||||||
|
|
||||||
if (ui_mode == UI_CURSES && !conf->skip_system_dialogs)
|
if (ui_mode == UI_CURSES && !conf->skip_system_dialogs)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user