From f45c8180046fee206d727f0e68cb6eee464ba596 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 16 Sep 2021 12:50:01 +0200 Subject: [PATCH] dmesg: translate ctime strings Let's make the date-time strings accessible for translators. Fixes: https://github.com/karelzak/util-linux/issues/1451 Signed-off-by: Karel Zak --- sys-utils/dmesg.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index d301951bbf..690a64ec55 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -849,14 +849,21 @@ static char *record_ctime(struct dmesg_control *ctl, record_localtime(ctl, rec, &tm); - if (strftime(buf, bufsiz, "%a %b %e %H:%M:%S %Y", &tm) == 0) + /* TRANSLATORS: dmesg uses strftime() fo generate date-time string + where %a is abbreviated name of the day, %b is abbreviated month + name and %e is day of the month as a decimal number. Please, set + proper month/day order here */ + if (strftime(buf, bufsiz, _("%a %b %e %H:%M:%S %Y"), &tm) == 0) *buf = '\0'; return buf; } static char *short_ctime(struct tm *tm, char *buf, size_t bufsiz) { - if (strftime(buf, bufsiz, "%b%e %H:%M", tm) == 0) + /* TRANSLATORS: dmesg uses strftime() fo generate date-time string + where: %b is abbreviated month and %e is day of the month as a + decimal number. Please, set proper month/day order here. */ + if (strftime(buf, bufsiz, _("%b%e %H:%M"), tm) == 0) *buf = '\0'; return buf; } -- 2.47.2