From c6109efaa165518439c3bf624a77a4bd20a22c6e Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 20 Oct 2011 15:56:34 +0200 Subject: edquota: Fix localication of time units Time units were localized when printing (e.g. individual grace times) to file for editing but were not localized when parsing them back. Fix it. Signed-off-by: Jan Kara --- quotaops.c | 2 +- quotasys.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/quotaops.c b/quotaops.c index 9e7e590..7b2f035 100644 --- a/quotaops.c +++ b/quotaops.c @@ -396,7 +396,7 @@ int writeindividualtimes(struct dquot *qlist, int outfd, char *name, int quotaty else if (q->dq_dqb.dqb_btime <= now) strcpy(btimestr, _("0seconds")); else - sprintf(btimestr, "%useconds", (unsigned)(q->dq_dqb.dqb_btime - now)); + sprintf(btimestr, _("%useconds"), (unsigned)(q->dq_dqb.dqb_btime - now)); if (!q->dq_dqb.dqb_itime) strcpy(itimestr, _("unset")); else if (q->dq_dqb.dqb_itime <= now) diff --git a/quotasys.c b/quotasys.c index 70fdabe..16b59a6 100644 --- a/quotasys.c +++ b/quotasys.c @@ -332,13 +332,13 @@ void time2str(time_t seconds, char *buf, int flags) */ int str2timeunits(time_t num, char *unit, time_t *res) { - if (memcmp(unit, "second", 6) == 0) + if (!strcmp(unit, _("second")) || !strcmp(unit, _("seconds"))) *res = num; - else if (memcmp(unit, "minute", 6) == 0) + else if (!strcmp(unit, _("minute")) || !strcmp(unit, _("minutes"))) *res = num * 60; - else if (memcmp(unit, "hour", 4) == 0) + else if (!strcmp(unit, _("hour")) || !strcmp(unit, _("hours"))) *res = num * 60 * 60; - else if (memcmp(unit, "day", 3) == 0) + else if (!strcmp(unit, _("day")) || !strcmp(unit, _("days"))) *res = num * 24 * 60 * 60; else return -1; -- cgit v1.2.1