[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: yesno module and i18n
From: |
Paul Eggert |
Subject: |
Re: yesno module and i18n |
Date: |
Sun, 19 Aug 2007 03:31:49 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> + /* First, look in the gnulib message catalog. */
> + const char *translated_pattern = _(english_pattern);
> + if (translated_pattern == english_pattern)
> + {
> + /* The gnulib message catalog provides no translation.
> + Try the system's message catalog. */
> + translated_pattern = nl_langinfo (nl_index);
> + if (translated_pattern == NULL || translated_pattern[0] == '\0')
> + /* Broken system. */
> + translated_pattern = english_pattern;
The overall idea seems sound, but shouldn't the code simply use the
nl_langinfo result, if nl_langinfo exists and returns a nonempty
string? That is, the above implementation would arguably cause 'mv'
to not conform to POSIX, since (if I'm understanding things correctly)
POSIX says that mv's behavior here depends on nl_langinfo's result and
nothing else. On a POSIX-conforming host nl_langinfo must return a
nonempty result for a valid locale, no? So if the code tries
nl_langinfo first and uses its result, that will cause 'mv' to
conform.
Re: yesno module consumes too much input, Jim Meyering, 2007/08/17
Re: yesno module consumes too much input, Paul Eggert, 2007/08/17