Re: Bug#160284: ITP: po-debconf -- Manage translated Debconf templates files with gettext
On Wed, Sep 11, 2002 at 09:33:40AM -0500, Steve Langasek wrote:
> On Wed, Sep 11, 2002 at 06:55:48PM +0900, Tomohiro KUBOTA wrote:
>
> > However, I have one concern. Debconf is one of softwares which is
> > used in early stage of Debian installation. Thus, Debconf should
> > not depend on many/large packages/data.
>
> > Encoding conversion is a relatively heavy process. I mean, collection
> > of conversion tables is large.
>
> > I don't know if iconv (I can use "libtext-iconv-perl" package) or
> > encoding conversion in gettext work well without "locales" package
> > or not. Do you have any idea?
>
> iconv works fine in the absence of locale data; iconv is merely a tool
> for converting text between two encodings.
$ du -sh /usr/lib/gconv
4.4M /usr/lib/gconv
$ dpkg -S /usr/lib/gconv
libc6: /usr/lib/gconv
Aah! I always thought this was in locales package.
> However, iconv DOES need
> locale definitions to know what the user's preferred encoding is.
Either way, we can use such pseudo-code:
: @specials = qw(C en_US); # anything else?
: $locale = $ENV{'LC_CTYPE'} || $ENV{'LANG'};
: if (grep $locale =~ /^$_/ @specials) {
: eval 'use Text::Iconv';
: if ($@) {
: just_copy_the_strings();
: } else {
: recode_the_strings_nicely();
: }
: } else {
: just_copy_the_strings();
: }
Since users who need to set a locale which isn't in @specials, will have
locales installed anyway, this will work in most cases _and_ won't
require debconf to Depend: on locales/libtext-iconv-perl
Marcin
--
Marcin Owsiany <porridge@debian.org> http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216 FE67 DA2D 0ACA FC5E 3F75 D6F6 3A0D 8AA0 60F4 1216
Reply to: