diff options
author | P. J. McDermott <pj@pehjota.net> | 2023-10-06 09:00:18 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2023-10-06 11:33:29 (EDT) |
commit | 20377a29d1f274802fce5c728d1a5d7f5a7e8c2a (patch) | |
tree | eb7748ced4f23471f07fdb0c16a56f32e8a91176 /src/datetime.c | |
parent | 4c487f3f0a377f15636a3041a0dda9b04d851c77 (diff) | |
download | atsign-20377a29d1f274802fce5c728d1a5d7f5a7e8c2a.zip atsign-20377a29d1f274802fce5c728d1a5d7f5a7e8c2a.tar.gz atsign-20377a29d1f274802fce5c728d1a5d7f5a7e8c2a.tar.bz2 |
datetime, main: Translate strings
Diffstat (limited to 'src/datetime.c')
-rw-r--r-- | src/datetime.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/datetime.c b/src/datetime.c index 0bba344..72f0219 100644 --- a/src/datetime.c +++ b/src/datetime.c @@ -32,6 +32,7 @@ #include <time.h> #include "datetime.h" #include "formats.h" +#include "i18n.h" static void _datetime_buf_cpy_p(char *dst, const char *src) @@ -164,7 +165,7 @@ datetime_parse(struct tm *now_tm, const char *input, } fmt_buf = calloc(fmt_len + 1, sizeof(*fmt_buf)); if (fmt_buf == NULL) { - fprintf(stderr, "Failed to allocate buffer: %s\n", + fprintf(stderr, _("Failed to allocate buffer: %s\n"), strerror(errno)); return -1; } @@ -249,7 +250,7 @@ datetime_parse(struct tm *now_tm, const char *input, free(fmt_buf); return 0; } else { - fputs("Unknown date format\n", stderr); + fputs(_("Unknown date format\n"), stderr); free(fmt_buf); return -1; } @@ -294,13 +295,13 @@ _datetime_strftime(const char *fmts[], const struct tm *tm, char **out, *buf_sz = strlen(fmts[0]) + 1; *buf = calloc(*buf_sz, sizeof(**buf)); if (*buf == NULL) { - fprintf(stderr, "Failed to allocate buffer: %s\n", + fprintf(stderr, _("Failed to allocate buffer: %s\n"), strerror(errno)); return -1; } *out = calloc(*buf_sz, sizeof(**out)); if (*out == NULL) { - fprintf(stderr, "Failed to allocate buffer: %s\n", + fprintf(stderr, _("Failed to allocate buffer: %s\n"), strerror(errno)); return -1; } @@ -320,7 +321,7 @@ _datetime_strftime(const char *fmts[], const struct tm *tm, char **out, ++*buf_sz; *buf = realloc(*buf, *buf_sz * sizeof(**buf)); if (*buf == NULL) { - fprintf(stderr, "Failed to allocate buffer: %s\n", + fprintf(stderr, _("Failed to allocate buffer: %s\n"), strerror(errno)); return -1; } @@ -329,7 +330,7 @@ _datetime_strftime(const char *fmts[], const struct tm *tm, char **out, if (resized > 0) { *out = realloc(*out, *buf_sz * sizeof(**out)); if (*out == NULL) { - fprintf(stderr, "Failed to allocate buffer: %s\n", + fprintf(stderr, _("Failed to allocate buffer: %s\n"), strerror(errno)); return -1; } |