[Adduser-devel] Bug#345639: nl_langinfo(YESEXPR) ignores LANGUAGE

Peter Samuelson peter at p12n.org
Sun Feb 12 13:12:48 UTC 2006

reassign 345639 libc6
retitle 345639 nl_langinfo(YESEXPR) ignores LANGUAGE, no apparent workaround

[Claudio Nieder]
> $ env | grep -e LC -e LANG
> LANG=en_GB.UTF-8
> LANGUAGE=de_CH:de_DE:de:en_GB:en

In this setup, a prompt "Is this information correct? [y/N]" does not

- The prompt is localised with gettext, which uses LANGUAGE, so it's in
  German.  The German translator correctly renders it as "[j/N]".

- Parsing the response uses nl_langinfo(YESEXPR), but this uses
  LC_MESSAGES and ignores LANGUAGE, so it assumes en_GB.
  Thus the app checks the response against /^[yY]/.

What is the app (adduser, in this case) supposed to do in this case?
There seems to be no way to ask nl_langinfo for an appropriate string
to display in place of [y/N].  Tollef and I thought YESSTR and NOSTR
might work, but the locales I checked do not define those.  (Chopping
those down to a single character would be problematic anyway, given the
existence of multibyte character sets.)

I appreciate that this seems to be an API deficiency with regard to
handling LANGUAGE consistently, and that makes it a hard problem, but I
also don't see how it can be worked around at the application level.
Except perhaps by explicitly undefining LANGUAGE before calling
setlocale() at the beginning of the program?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/adduser-devel/attachments/20060212/ff9f5910/attachment-0001.pgp

More information about the Adduser-devel mailing list