diff options
Diffstat (limited to 'Master/tlpkg/installer/install-menu-perltk.pl')
-rw-r--r-- | Master/tlpkg/installer/install-menu-perltk.pl | 174 |
1 files changed, 28 insertions, 146 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index 798610b1c54..fc7a35a5f8b 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -17,6 +17,19 @@ my $svnrev = '$Revision$'; $svnrev =~ m/: ([0-9]+) /; $::menurevision = $1; +require Tk; +require Tk::Dialog; +require Tk::DialogBox; +require Tk::PNG; +require Tk::ROText; +require Tk::ProgressBar; + +if ($::alternative_selector) { + require Tk::DirTree; +} + +use utf8; +no utf8; our %vars; our $tlpdb; @@ -32,62 +45,14 @@ our $MENU_ALREADYDONE = 3; my $return = $MENU_INSTALL; -require Tk; -require Tk::Dialog; -require Tk::DialogBox; -require Tk::PNG; -require Tk::ROText; -require Tk::ProgressBar; +our %text; +our %labels; +require("installer/install-translations.pl"); -if ($::alternative_selector) { - require Tk::DirTree; -} -use utf8; -no utf8; - -if (defined($::opt_lang)) { - $::lang = $::opt_lang; - if ($::lang eq "zh") { - # set language to simplified chinese - $::lang = "zh-cn"; - } -} else { - if ($^O =~ /^MSWin(32|64)$/i) { - # trying to deduce automatically the country code - my $foo = TeXLive::TLWinGoo::reg_country(); - if ($foo) { - $::lang = $foo; - } else { - debug("Didn't get any usuful code from reg_country: $foo...\n"); - } - } else { - # we load POSIX and locale stuff - require POSIX; - import POSIX qw/locale_h/; - # now we try to deduce $::lang - my $loc = setlocale(&POSIX::LC_MESSAGES); - my ($lang,$area,$codeset); - if ($loc =~ m/^([^_.]*)(_([^.]*))?(\.([^@]*))?(@.*)?$/) { - $lang = defined($1)?$1:""; - $area = defined($3)?$3:""; - if ($lang eq "zh") { - if ($area =~ m/^(TW|HK)$/i) { - $lang = "zh-tw"; - } else { - # fallback to zh-cn for anything else, that is - # zh-cn, zh-sg, zh, and maybe something else - $lang = "zh-cn"; - } - } - } - $::lang = $lang if ($lang); - } -} my $mw; my $subframe; my $mainwindow; - my $bintextbutton; my $schemebutton; my $collectionstext; @@ -102,6 +67,18 @@ my $optletterstate; my $optfmtstate; my $optsrcstate; my $optdocstate; +my $letteryesno = ( $vars{'option_letter'} ? $text{'yes'} : $text{'no'} ); +my $fmtyesno = ( $vars{'option_fmt'} ? $text{'yes'} : $text{'no'} ); +my $srcyesno = ( $vars{'option_src'} ? $text{'yes'} : $text{'no'} ); +my $docyesno = ( $vars{'option_doc'} ? $text{'yes'} : $text{'no'} ); + +$::run_menu = \&run_menu_perltk; + + +#################################################################### +# From here on only function definitions +# ################################################################## + sub setup_hooks_perltk { push @::info_hook, @@ -140,100 +117,6 @@ sub update_progressbar { } } -my %text = ( title => 'TeX Live 2008 Installation', - basicinfo => 'Basic Information', - custom => 'Further Customization', - dirsetup => "Directory setup", - options => 'Options', - sysint => 'System Integration', - change => 'Change', - toggle => 'Toggle', - install => 'Install TeX Live', - finbut => 'Finish', - quit => 'Quit', - ok => 'Ok', - cancel => 'Cancel', - status => 'Status output', - changevar => 'Change variable value', - enterpath => 'Enter path for', - hinthome => '(use ~ for %%%)', - selectscheme => 'Select a scheme', - selectstdcol => 'Select the collections to be installed', - selectall => 'Select All', - selectnone => 'Deselect All', - selectlang => 'Select language support', - selectdoc => 'Select language-specific documentation', - createsym => 'create symlinks in standard directories', - binto => 'binaries to', - manto => 'manpages to', - infoto => 'info to', - selectsys => 'Select arch-os', - outof => 'out of', - collof => 'collections out of', - diskreq => 'disk space required', - yes => 'Yes', - no => 'No', - notwritable => '(default not writable - please change!)', - changetexdir => '(please change TEXDIR first!)', - nolangcol => '(no language collection selected!)', - finished => 'See TEXDIR/index.html for links to documentation.\nThe TeX Live web site\n(http://tug.org/texlive/) contains any updates and corrections.\nTeX Live is a joint project of the TeX user groups around the world;\nplease consider supporting it by joining the group best for you. The\nlist of groups is available on the web at http://tug.org/usergroups.html.', - finishedpath => 'Add TEXDIR/texmf/doc/man to MANPATH.\nAdd TEXDIR/texmf/doc/info to INFOPATH.\nMost importantly, add TEXDIR/bin/PLATFORM\nto your PATH for current and future sessions.', - welcome => 'Welcome to TeX Live!', - wizard => 'Go to Wizard', - ); - - -my %labels = ( binsys => 'Binary System(s)', - scheme => 'Selected Scheme', - stdcoll => 'Standard Collections', - langcoll => 'Language Collections', - texdir => 'TEXDIR (the main TeX directory)', - localdir => 'TEXMFLOCAL (directory for site-wide local files)', - sysvardir => 'TEXMFSYSVAR (directory for autogenerated data)', - sysconfigdir => 'TEXMFSYSCONFIG (directory for local config)', - texmfhome => 'TEXMFHOME (directory for user-specific files)', - optletter => 'Use letter-size paper by default, instead of A4', - optfmt => 'Create all format files', - optdoc => 'Install font/macro doc tree', - optsrc => 'Install font/macro source tree', - symlink => 'Create symlinks in system directories', - ); - -if (($::lang ne "en") && ($::lang ne "C")) { - if (! -r "$::installerdir/tlpkg/installer/lang/perltk-$::lang") { - tlwarn ("\n Sorry, no translations available for $::lang; falling back to English. - (If you'd like to help translate the installer's messages, please see - http://tug.org/texlive/doc.html#install-tl-xlate for information.)\n\n"); - } else { - # merge the translated strings into the text string - open(LANG, "<$::installerdir/tlpkg/installer/lang/perltk-$::lang"); - my %trans; - while (<LANG>) { - chomp; - next if m/^\s*#/; - next if m/^\s*$/; - my ($a,$b) = split(/:/,$_,2); - $b =~ s/^\s*([^\s])/$1/; - $b =~ s/\s*$//; - if (!utf8::decode($b)) { - warn("decoding string to utf8 didn't work:$b\n"); - } - $trans{"$a"} = "$b"; - } - close(LANG); - foreach my $k (keys %text) { - $text{$k} = $trans{"text.$k"} if defined($trans{"text.$k"}); - } - foreach my $k (keys %labels) { - $labels{$k} = $trans{"label.$k"} if defined($trans{"label.$k"}); - } - } -} - -my $letteryesno = ( $vars{'option_letter'} ? $text{'yes'} : $text{'no'} ); -my $fmtyesno = ( $vars{'option_fmt'} ? $text{'yes'} : $text{'no'} ); -my $srcyesno = ( $vars{'option_src'} ? $text{'yes'} : $text{'no'} ); -my $docyesno = ( $vars{'option_doc'} ? $text{'yes'} : $text{'no'} ); sub run_menu_perltk { calc_depends(); @@ -427,7 +310,6 @@ sub run_menu_perltk { Tk::MainLoop(); return($return); } -$::run_menu = \&run_menu_perltk; sub installation_window { # create a progress bar window |