diff options
author | Norbert Preining <preining@logic.at> | 2008-01-19 15:59:56 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-01-19 15:59:56 +0000 |
commit | a275fb3249cbb60046ca9e46869a3c60c3d9696a (patch) | |
tree | 7a6fa51a4c6b0c6a495f5ec240101fa1195e4c20 /Master | |
parent | b53b2d5ddb5fe24cc67049c95169c6f893562cb6 (diff) |
encoding support for installer GUI, now needs utf8 translations
git-svn-id: svn://tug.org/texlive/trunk@6317 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/installer/install-menu-perltk.pl | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index 5c7212cb2ec..ab58318be37 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -10,7 +10,6 @@ # TODO: # - does the DoOneEvent *NEVER* hang??? # - translation into other languages -# - dynamic computation of column sizes? how could that be done? my $svnrev = '$Revision$'; $svnrev =~ m/: ([0-9]+) /; @@ -37,6 +36,7 @@ my $return = $MENU_INSTALL; require Tk; require Tk::Dialog; require Tk::PNG; +require Encode; my $mw; @@ -84,6 +84,14 @@ sub update_statusbar { $::statusbar->configure(-text => "$p"); } +my %encodings = ( + de => 'latin1', + pl => 'latin2', + ); + +# if windows has a different encoding than the one given above +my %special_win_encodings = (); + my %text = ( title => 'TeX Live 2008 Installation', basicinfo => 'Basic Information', custom => 'Further Customization', @@ -144,11 +152,21 @@ if ($::lang ne "en") { warn "Couldn't find language file installer/install-menu-perltk-$::lang.pl: $!\nContinuing in English!\n"; } else { # merge the translated strings into the text string + my $destenc = "latin1"; + $destenc = $encodings{$::lang} if defined($encodings{$::lang}); + $destenc = $special_win_encodings{$::lang} + if defined($special_win_encodings{$::lang}); foreach my $k (keys %translatedtext) { - $text{$k} = $translatedtext{$k}; + my $tmp = $translatedtext{$k}; + # translation strings are supposed to be in utf8 + Encode::from_to($tmp, "utf8", $destenc); + $text{$k} = $tmp; } foreach my $k (keys %translatedlabels) { - $labels{$k} = $translatedlabels{$k}; + my $tmp = $translatedlabels{$k}; + # translation strings are supposed to be in utf8 + Encode::from_to($tmp, "utf8", $destenc); + $labels{$k} = $tmp; } } } |