Bug#308853: debconf: should honor LC_MESSAGES for displaying templates

2005-06-28 Thread Tomas Hoger
On Tue, May 17, 2005 at 10:30:38PM -0400, Joey Hess wrote:
> Denis Barbier wrote:
> > See http://www.opengroup.org/onlinepubs/007908799/xbd/locale.html
> >   If different character sets are used by the locale categories, the
> >   results achieved by an application utilising these categories are
> >   undefined.
> 
> Trying to match undefined behavior in glibc seems like a waste of time.
> Unless glibc defines its bahavior somewhere (other than the code), or
> someone finds another reason, I'm inclined not to do it.

Sorry for late reply...

Yes, in that case, I think this bug can be closed.  Main problem showed to
be misconfiguration on my side.

Thanks for your help!

th.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#308853: debconf: should honor LC_MESSAGES for displaying templates

2005-05-17 Thread Joey Hess
Denis Barbier wrote:
> See http://www.opengroup.org/onlinepubs/007908799/xbd/locale.html
>   If different character sets are used by the locale categories, the
>   results achieved by an application utilising these categories are
>   undefined.

Trying to match undefined behavior in glibc seems like a waste of time.
Unless glibc defines its bahavior somewhere (other than the code), or
someone finds another reason, I'm inclined not to do it.

-- 
see shy jo


signature.asc
Description: Digital signature


Bug#308853: debconf: should honor LC_MESSAGES for displaying templates

2005-05-17 Thread Tomas Hoger
Hi Denis!

Thanks for further information!

> See http://www.opengroup.org/onlinepubs/007908799/xbd/locale.html
>   If different character sets are used by the locale categories, the
>   results achieved by an application utilising these categories are
>   undefined.

Ok, it seems I'm entring "undefined behavior" areas here.  So I have to
agree with you, that it's not a bug.

I will keep this bug open to wait for feedback from debconf maintainers
to see if they prefer to keep current state or want to implement language
choosing mechanism, which more closely mimic behavior of libc.
Nevertheless, I have no problem with "wontfix" resolution of this bug.

th.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#308853: debconf: should honor LC_MESSAGES for displaying templates

2005-05-16 Thread Denis Barbier
tags 308853 + patch
thanks

On Mon, May 16, 2005 at 05:48:08PM +0200, Tomas Hoger wrote:
> Hi Denis!
> 
> Thanks for your reply!
> 
> On Sun, May 15, 2005 at 06:42:21PM +0200, Denis Barbier wrote:
> 
> [...]
> 
> > I cannot reproduce this behavior, I guess that you also set LANGUAGE to
> > sk_SK.  You can perform similar checks with 'cp --help', and normally
> > you should see no differences between debconf and libc applications,
> > which demonstrates that there is no bug in debconf.  Can you please
> > make these tests and report your conclusions?
> 
> Yes, this was good guess.  I do have LANGUAGE set to sk_SK.  After
> unsetting LANGUAGE templates are displayed in English as expected.
> 
> Regarding that 'cp --help' tests, when I have locale variables set as
> described in previous mail (LANG set to sk_SK; LC_TIME, LC_COLLATE and
> LC_MESSAGES set to C) and aslo LANGUAGE set to sk_SK, 'cp --help' is
> displayed in English.  I get similar behavior for other programs (e.g. mc,
> mutt, vim, ...).

Hmmm, you are right, LANGUAGE environment variable is ignored when
LC_MESSAGES is set to C.  I usually perform tests with locales different
from C ;)
GNU libc has this comment in dcigettext.c:

  /* Ignore LANGUAGE and its system-dependent analogon if the locale is set
 to "C" because
 1. "C" locale usually uses the ASCII encoding, and most international
messages use non-ASCII characters. These characters get displayed
as question marks (if using glibc's iconv()) or as invalid 8-bit
characters (because other iconv()s refuse to convert most non-ASCII
characters to ASCII). In any case, the output is ugly.
 2. The precise output of some programs in the "C" locale is specified
by POSIX and should not depend on environment variables like
"LANGUAGE" or system-dependent information.  We allow such programs
to use gettext().  */
  if (strcmp (locale, "C") == 0)
return locale;

The first item does not apply here because your LC_CTYPE is not ASCII,
and we do not care about standardized output.  IMO there is no need for
debconf to implement this special casing, and my first intention was to
close this bug.  Debconf maintainers, you can either close this bug
report or apply the attached patch to mimic glibc more closely.

> I did few more tests with debconf.  I've unset all LC_* variables and also
> LANG and LANGUAGE to get clean environment.  Then I tried following
> commands:
> 
>   LC_MESSAGES=sk_SK dpkg-reconfigure 
>   -> Slovak "window" label and button labels, English template text
> 
>   LC_MESSAGES=sk_SK LC_CTYPE=sk_SK dpkg-reconfigure 
>   -> labels and template text in Slovak
> 
> I believe this test and its results should be easily reproducible.  Hope I
> haven't made any mistake now ;).
> 
> As you can see, there is not only difference in interpretation of locale
> settings among debconf and "other libc apps", but also among "parts of
> debconf".

See http://www.opengroup.org/onlinepubs/007908799/xbd/locale.html
  If different character sets are used by the locale categories, the
  results achieved by an application utilising these categories are
  undefined.
So yes, there are some discrepancies here, but these are not bugs.
You will run into trouble whenever you set LC_MESSAGES to a locale
with an encoding different from LC_CTYPE.  On the other hand, setting
LC_CTYPE=sk_SK and LC_MESSAGES=C is safe because iso-8859-2 is a
superset of ASCII.

Denis
--- Debconf.orig/Template.pm2005-05-05 01:22:56.0 +0200
+++ Debconf/Template.pm 2005-05-16 21:38:08.704550568 +0200
@@ -408,7 +408,7 @@
my $language=setlocale(5); # LC_MESSAGES
my @langs = ();
# LANGUAGE has a higher precedence than LC_MESSAGES
-   if (exists $ENV{LANGUAGE} && $ENV{LANGUAGE} ne '') {
+   if ($language ne 'C' && exists $ENV{LANGUAGE} && $ENV{LANGUAGE} ne '') {
foreach (split(/:/, $ENV{LANGUAGE})) {
push (@langs, _getlocalelist($_));
}


Bug#308853: debconf: should honor LC_MESSAGES for displaying templates

2005-05-16 Thread Tomas Hoger
Hi Denis!

Thanks for your reply!

On Sun, May 15, 2005 at 06:42:21PM +0200, Denis Barbier wrote:

[...]

> I cannot reproduce this behavior, I guess that you also set LANGUAGE to
> sk_SK.  You can perform similar checks with 'cp --help', and normally
> you should see no differences between debconf and libc applications,
> which demonstrates that there is no bug in debconf.  Can you please
> make these tests and report your conclusions?

Yes, this was good guess.  I do have LANGUAGE set to sk_SK.  After
unsetting LANGUAGE templates are displayed in English as expected.

Regarding that 'cp --help' tests, when I have locale variables set as
described in previous mail (LANG set to sk_SK; LC_TIME, LC_COLLATE and
LC_MESSAGES set to C) and aslo LANGUAGE set to sk_SK, 'cp --help' is
displayed in English.  I get similar behavior for other programs (e.g. mc,
mutt, vim, ...).

I did few more tests with debconf.  I've unset all LC_* variables and also
LANG and LANGUAGE to get clean environment.  Then I tried following
commands:

  LC_MESSAGES=sk_SK dpkg-reconfigure 
  -> Slovak "window" label and button labels, English template text

  LC_MESSAGES=sk_SK LC_CTYPE=sk_SK dpkg-reconfigure 
  -> labels and template text in Slovak

I believe this test and its results should be easily reproducible.  Hope I
haven't made any mistake now ;).

As you can see, there is not only difference in interpretation of locale
settings among debconf and "other libc apps", but also among "parts of
debconf".

th.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#308853: debconf: should honor LC_MESSAGES for displaying templates

2005-05-15 Thread Denis Barbier
On Thu, May 12, 2005 at 08:08:02PM +0200, Tomas Hoger wrote:
> Package: debconf
> Version: 1.4.30.13
> Severity: minor
> 
> Hi!
> 
> I have following locale settings on my system:
> 
> LANG=sk_SK
> LC_CTYPE="sk_SK"
> LC_NUMERIC="sk_SK"
> LC_TIME=C
> LC_COLLATE=C
> LC_MONETARY="sk_SK"
> LC_MESSAGES=C
> LC_PAPER="sk_SK"
> LC_NAME="sk_SK"
> LC_ADDRESS="sk_SK"
> LC_TELEPHONE="sk_SK"
> LC_MEASUREMENT="sk_SK"
> LC_IDENTIFICATION="sk_SK"
> LC_ALL=
> 
> Environment variables LANG, LC_TIME, LC_COLLATE and LC_MESSAGES are set.
> 
> Despite of LC_MESSAGES settings, debconf displays slovak templates (if
> available).

I cannot reproduce this behavior, I guess that you also set LANGUAGE to
sk_SK.  You can perform similar checks with 'cp --help', and normally
you should see no differences between debconf and libc applications,
which demonstrates that there is no bug in debconf.  Can you please
make these tests and report your conclusions?

Denis


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#308853: debconf: should honor LC_MESSAGES for displaying templates

2005-05-12 Thread Tomas Hoger
Package: debconf
Version: 1.4.30.13
Severity: minor

Hi!

I have following locale settings on my system:

LANG=sk_SK
LC_CTYPE="sk_SK"
LC_NUMERIC="sk_SK"
LC_TIME=C
LC_COLLATE=C
LC_MONETARY="sk_SK"
LC_MESSAGES=C
LC_PAPER="sk_SK"
LC_NAME="sk_SK"
LC_ADDRESS="sk_SK"
LC_TELEPHONE="sk_SK"
LC_MEASUREMENT="sk_SK"
LC_IDENTIFICATION="sk_SK"
LC_ALL=

Environment variables LANG, LC_TIME, LC_COLLATE and LC_MESSAGES are set.

Despite of LC_MESSAGES settings, debconf displays slovak templates (if
available).  However, buttons like "yes" and "no" are shown correctly, they
are not translated.  After setting LC_MESSAGES to sk_SK, those buttons have
slovak labels too.

Experiment with LANG set to C and LC_MESSAGES to sk_SK results in not
translated template and translated buttons (some characters not displayed
correctly, due to LC_CTYPE being C too).

Further experiments showed that debconf is probably using LC_CTYPE instead
of LC_MESSAGES to choose template langauge, which (I believe) is not
correct:

LANG=C LC_MESSAGES=sk_SK LC_CTYPE=sk_SK dpkg-reconfigure 
 -> slovak template and button labels

LANG=C LC_CTYPE=sk_SK dpkg-reconfigure 
 -> slovak template, english button labels

I also tried with sk_SK.ISO-8859-2 instead of sk_SK with same results.  So
this problem does not seem to be related to locale aliases problem
described in #232044.

HTH

th.


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27
Locale: LANG=sk_SK, LC_CTYPE=sk_SK (charmap=ISO-8859-2)

Versions of packages debconf depends on:
ii  debconf-i18n  1.4.30.13  full internationalization support
ii  perl-base 5.8.4-8The Pathologically Eclectic Rubbis

-- debconf information:
* debconf/frontend: Dialog
* debconf/priority: medium



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]