#!perl use strict; use warnings; use utf8; use Tk; my $map = { 'de' => { btn_click_me => 'Klick mich', }, 'en' => { btn_click_me => 'Cleck me', } }; my $lang = 'de'; my $mw = Tk::MainWindow->new(-title=>"language support"); $mw->geometry("100x100"); my @menulanguages =("de","en"); my $menubar = $mw->Menu(-relief => 'flat'); $mw->configure(-menu => $menubar); my $menu_lang = $menubar->cascade(-label => $lang); $menu_lang->radiobutton(-label=> $_, -variable => \$lang, -value => $_, -command => \&update_window) for @menulanguages; my $mybutton = $mw->Button( -textvariable => \$map->{$lang}->{btn_click_me}, )->pack(); $mw->MainLoop(); sub update_window { $mw->update(); } # /update_window