Here are proposed changes to zdump.c, reflecting suggestions from Robbin Kawabata. --ado ------- zdump.c ------- *** /tmp/geta11896 Thu Dec 22 10:20:54 2005 --- /tmp/getb11896 Thu Dec 22 10:20:54 2005 *************** *** 1,4 **** ! static char elsieid[] = "@(#)zdump.c 7.72"; /* ** This code has been made independent of the rest of the time --- 1,4 ---- ! static char elsieid[] = "@(#)zdump.c 7.73"; /* ** This code has been made independent of the rest of the time *************** *** 212,222 **** while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp)) ++cp; if (cp - abbrp == 0) ! wp = _("lacks alphabetic at start"); ! if (cp - abbrp < 3) ! wp = _("has fewer than 3 alphabetics"); ! if (cp - abbrp > 6) ! wp = _("has more than 6 alphabetics"); if (wp == NULL && (*cp == '+' || *cp == '-')) { ++cp; if (isascii((unsigned char) *cp) && --- 212,222 ---- while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp)) ++cp; if (cp - abbrp == 0) ! wp = "lacks alphabetic at start"; ! else if (cp - abbrp < 3) ! wp = "has fewer than 3 alphabetics"; ! else if (cp - abbrp > 6) ! wp = "has more than 6 alphabetics"; if (wp == NULL && (*cp == '+' || *cp == '-')) { ++cp; if (isascii((unsigned char) *cp) && *************** *** 223,237 **** isdigit((unsigned char) *cp)) if (*cp++ == '1' && *cp >= '0' && *cp <= '4') ++cp; } - if (*cp != '\0') - wp = _("differs from POSIX standard"); if (wp == NULL) return; (void) fflush(stdout); (void) fprintf(stderr, _("%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"), ! progname, zone, abbrp, wp); warned = TRUE; } --- 223,237 ---- isdigit((unsigned char) *cp)) if (*cp++ == '1' && *cp >= '0' && *cp <= '4') ++cp; + if (*cp != '\0') + wp = "differs from POSIX standard"; } if (wp == NULL) return; (void) fflush(stdout); (void) fprintf(stderr, _("%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"), ! progname, zone, abbrp, _(wp)); warned = TRUE; }
On Thu, Dec 22, 2005 at 10:23:39AM -0500, Arthur David Olson wrote:
Here are proposed changes to zdump.c, reflecting suggestions from Robbin Kawabata.
While consolidating the calls to gettext() to one place would otherwise work fine at run-time, it fails to *mark* the text that needs to be extracted for translation, and hence would not be in the translation table. I say: don't make this change. --Ken Pizzini
Ken Pizzini <tz.@explicate.org> writes:
While consolidating the calls to gettext() to one place would otherwise work fine at run-time, it fails to *mark* the text that needs to be extracted for translation, and hence would not be in the translation table.
Yes, that's correct. If it's important to minimize the number of calls to gettext, the right way to do it is to use a gettext_noop macro as described in <http://www.gnu.org/software/gettext/manual/html_node/gettext_19.html>. For zdump I don't see why it'd be worth the trouble to do all that, though.
participants (3)
-
Ken Pizzini -
Olson, Arthur David (NIH/NCI) [E] -
Paul Eggert