diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2003-01-24 11:41:34 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2003-01-24 11:41:34 +0000 |
commit | 1344c430fe7852aab13944e6c1831a8c7d2c6bb1 (patch) | |
tree | a04a317febe514afd2f3696fa710f39d19aacb25 /perl-install/common.pm | |
parent | f131284da380e1abcb14c1a37198337ab223c55a (diff) | |
download | drakx-backup-do-not-use-1344c430fe7852aab13944e6c1831a8c7d2c6bb1.tar drakx-backup-do-not-use-1344c430fe7852aab13944e6c1831a8c7d2c6bb1.tar.gz drakx-backup-do-not-use-1344c430fe7852aab13944e6c1831a8c7d2c6bb1.tar.bz2 drakx-backup-do-not-use-1344c430fe7852aab13944e6c1831a8c7d2c6bb1.tar.xz drakx-backup-do-not-use-1344c430fe7852aab13944e6c1831a8c7d2c6bb1.zip |
fix non latin1 post-install perl-gtk2 apps, seems like perl upgrading strings to utf8 is somewhat broken (dunno why), so now we bind the codeset or our textdomains to utf8 and tag the translated strings to utf8, when using gtk
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index 5fa23c479..339e0aa00 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -51,16 +51,23 @@ sub salt { sub makedev { ($_[0] << 8) | $_[1] } sub unmakedev { $_[0] >> 8, $_[0] & 0xff } -sub translate { +sub translate_real { my ($s) = @_; $s or return ''; foreach ('libDrakX', @::textdomains) { - my $s2 = $::isInstall && eval { $::o->isa('interactive::gtk') } ? c::dgettext_utf8($_, $s) : c::dgettext($_, $s); + my $s2 = c::dgettext($_, $s); return $s2 if $s ne $s2; } $s; } +sub translate { + my $s = translate_real(@_); + $::need_utf8_i18n and c::set_tagged_utf8($s); + $s; +} + + sub untranslate { my $s = shift || return; foreach (@_) { translate($_) eq $s and return $_ } |