[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[debian-devel:12647] Re: now debconf Japanized
- From: Taketoshi Sano <kgh12351@xxxxxxxxxxx>
- Subject: [debian-devel:12647] Re: now debconf Japanized
- Date: Fri, 7 Jul 2000 12:40:45 +0900
- X-dispatcher: imput version 991025(IM133)
- X-fingerprint: DA 00 13 8C 49 BB 60 BE A4 54 3D AF 2E CE 28 DD
- X-ml-info: If you have a question, send e-mail with the body "help" (without quotes) to the address debian-devel-ctl@debian.or.jp; help=<mailto:debian-devel-ctl@debian.or.jp?body=help>
- X-ml-name: debian-devel
- X-mlserver: fml [fml 3.0pl#17]; post only (only members can post)
- References: <20000707010110.7e94c95d.yosshy@xxxxxxxxx>
- Message-id: <y5a8zveiyd6.fsf@xxxxxxxxxxxxxxxxxxxx>
- X-mail-count: 12647
- User-agent: T-gnus/6.13.3 (based on Pterodactyl Gnus v0.98) EMIKO/1.13.9 (Euglena tripteris) FLIM/1.13.2 (Kasanui) APEL/10.2 Emacs/20.7 (i386-debian-linux-gnu) MULE/4.0 (HANANOEN)
佐野@浜松です。
In article <20000707010110.7e94c95d.yosshy@xxxxxxxxx>,
at "Fri, 7 Jul 2000 01:01:57 +0900',
with "[debian-devel:12642] now debconf Japanized",
Akira YOSHIYAMA <yosshy@xxxxxxxxx> さん writes:
> 吉山@品川です。
>
> debconf で日本語が表示されるようになりました。
> …といっても、debconf 自体の設定のみ、つまり、
>
> # dpkg-reconfigure debconf
>
> を実行した時ぐらいですが。
御苦労さまです。_o_
> # 何で debconf の ja.po は機能しないんだろう…
これは debconf 以外のパッケージの設定をした場合ですか ?
あと debconf って中心部分は perl で動いてたと思ってたんですが、
gettext も使ってたんですか ?
と思って
find /usr/lib/perl5/Debian/DebConf/ -type f |xargs grep -i setlocale
したら
/usr/lib/perl5/Debian/DebConf/Template.pm: my $language=setlocale(5); # LC_MESSAGES
と出ました。
=head1 DESCRIPTION
This is an object that represents a Template. Each Template has some associated
data, the fields of the template structure. To get at this data, just use
$template->fieldname to read a field, and $template->fieldname(value) to write
a field. Any field names at all can be used, the convention is to lower-case
their names. All Templates should have a "template" field that is their name.
Most have "default", "type", and "description" fields as well. The field
named "extended_description" holds the extended description, if any.
Templates support internationalization. If LANG or a related environment
variable is set, and you request a field from a template, it will see if
"$ENV{LANG}-field" exists, and if so return that instead.
と書いてありますね。
関係するのは
# Calculate the current locale, with aliases expanded, and normalized.
# May also generate a fallback.
sub _getlangs {
# I really dislike hard-hoding 5 here, but the POSIX module sadly does
# not let us get at the value of LC_MESSAGES in locale.h in a more
# portable way.
my $language=setlocale(5); # LC_MESSAGES
if ($language eq 'C' || $language eq 'POSIX') {
return;
}
# Try to do one level of fallback.
elsif ($language=~m/^(\w\w)_/) {
return $language, $1;
}
return $language;
}
と
=head2 any other method
Set/get a property. This supports internationalization.
=cut
{
my @langs=_getlangs();
sub AUTOLOAD {
my $this=shift;
my $property = $AUTOLOAD;
$property =~ s|.*:||; # strip fully-qualified portion
$this->{$property}=shift if @_;
# Check to see if i18n should be used.
if (@langs) {
foreach my $lang (@langs) {
if (exists $$this{$property.'-'.$lang}) {
$property.='-'.$lang;
last;
}
}
}
return $this->{$property};
}
}
かな。
man perllocale したんですが
LANGUAGE NOTE: LANGUAGE is a GNU extension, it affects
you only if you are using the GNU libc. This
is the case if you are using e.g. Linux. If
you are using "commercial" UNIXes you are most
probably not using GNU libc and you can ignore
LANGUAGE.
However, in the case you are using LANGUAGE:
it affects the language of informational,
warning, and error messages output by commands
(in other words, it's like LC_MESSAGES) but it
has higher priority than the LC_ALL manpage.
Moreover, it's not a single value but instead
a "path" (":"-separated list) of languages
(not locales). See the GNU gettext library
documentation for more information.
しか書いてないみたい。 perl script から gettext を使って *.po の
メッセージを切り替えて使う方法ってどうやるんでしょう ?
find /usr/lib/perl5/Debian/DebConf/ -type f |xargs grep locale
しても Template.pm 以外には FrontEnd/Gtk.pm の set_locale Gtk; だけ
しか無さそう。
--
# (わたしのおうちは浜松市、「夜のお菓子」で有名さ。)
<kgh12351@xxxxxxxxxxx> : Taketoshi Sano (佐野 武俊)