]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: translate ctime strings
authorKarel Zak <kzak@redhat.com>
Thu, 16 Sep 2021 10:50:01 +0000 (12:50 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 16 Sep 2021 10:50:01 +0000 (12:50 +0200)
Let's make the date-time strings accessible for translators.

Fixes: https://github.com/karelzak/util-linux/issues/1451
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/dmesg.c

index d301951bbf1e4821332942f8b1fa74529a0de3d0..690a64ec55b9afb3d57e21979b5bdaf7dd3fff02 100644 (file)
@@ -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;
 }