[Debconf-devel] Bug#476873: debconf: displays "codes" from Choices-C instead with LC_ALL=C and ignores LANGUAGE=en
Frans Pop
elendil at planet.nl
Sat Apr 19 19:11:52 UTC 2008
Package: debconf
Version: 1.5.20
Severity: important
Tags: patch
NOTE: there is one issue with the proposed patch; see below!
One issue with debconf is that it will display the "code" values from a
Choices-C field instead of the descriptive values from the default Choices
field.
With the increased usage of Choices-C (e.g. in ucf), this is a real problem
as the "code" values are generally just not descriptive enough.
With current debconf (with 'test' being a script that shows a template using
Choices-C):
# LC_ALL=C ./test
# LANG=C ./test
# LANGUAGE=C ./test
# LANG=nl ./test # invalid
# LC_ALL=<anything invalid> ./test
=> Choices are the values from Choices-C!
Second issue is that LANGUAGE=en is not respected:
# LANG= LANGUAGE=en LC_ALL=nl_NL.UTF-8 ../../test
=> Dialog is displayed in Dutch
@langs = en:nl_nl.utf-8:nl_nl:nl.utf-8:nl
A more extensive description of these issues and a test case can be found in
this thread: http://lists.debian.org/debian-boot/2008/04/msg00019.html.
Attached a patch that solves these two issues.
Note that this patch effectively obsoletes the use of *-C fields as
"translation" values to be used with the C locale or if i18n is disabled.
I doubt this is used (much) currently and I can also not really see a
use-case for it.
If there is some reason this is undesired, the only alternative solution
would seem to be to start a transition from Choices-C to a new special
field, for example Choices-Coded.
The patch also adds a debugging option: by setting DEBCONF_C_VALUES=true, a
developer can make debconf display the values from Choices-C.
I had one problem while implementing this new option, which is why one line
in the patch is commented out in Debconf/Template.pm _getlangs():
#push (@langs, 'c') if Debconf::Config->c_values eq 'true';
If I uncomment this, I get
Can't locate object method "c_values" via package "Debconf::Config"
at /usr/share/perl5/Debconf/Template.pm line 277.
even though Debconf::Config has been loaded and the other use of the same
value works without problems.
I have tried a lot of things to solve that, but had to admit defeat. I hope
that a real perl coder will be able to solve this issue.
Cheers,
FJP
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debconf.patch
Type: text/x-diff
Size: 3766 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/debconf-devel/attachments/20080419/4babe1ff/attachment.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.alioth.debian.org/pipermail/debconf-devel/attachments/20080419/4babe1ff/attachment.pgp
More information about the Debconf-devel
mailing list