Changeset 855
- Timestamp:
- 11/09/08 12:33:55 (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Changes (modified) (2 diffs)
-
lib/Padre/Document.pm (modified) (1 diff)
-
lib/Padre/Wx/MainWindow.pm (modified) (4 diffs)
-
lib/Padre/Wx/Menu.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Changes
r854 r855 7 7 Tab reordering 8 8 Tab close button 9 Localization and German translation. (H eiko Jansen)9 Localization and German translation. (HJANSEN) 10 10 Move the content of Padre::Wx::Dialog to Wx::Perl::Dialog 0.02 (SZABGAB) 11 11 Chanage back the new-file hot-key to be Ctr-N again. (SZABGAB) … … 17 17 Also put cut/copy/paste/select all in the edit menu and in the right click menu. (HJANSEN) 18 18 Move Parrot plugin to separate distribution. (SZABGAB) 19 Enable swictching between German and English. (SZABGAB) 19 20 20 21 0.15 2008.11.02 -
trunk/lib/Padre/Document.pm
r851 r855 356 356 }; 357 357 if ($@) { 358 return "Could not save: $ !";358 return "Could not save: $@"; 359 359 } 360 360 $self->{_timestamp} = $self->time_on_file; -
trunk/lib/Padre/Wx/MainWindow.pm
r848 r855 41 41 Wx::InitAllImageHandlers(); 42 42 43 $config->{host}->{locale} || Wx::Locale::GetSystemLanguage; 44 43 45 Wx::Log::SetActiveTarget( Wx::LogStderr->new ); 44 46 #Wx::LogMessage( 'Start'); … … 74 76 ); 75 77 76 # config param has to be ID, not name (e.g.: 87 for 'de'); TODO change this 77 $self->refresh_locale( $config->{host}->{locale} ); 78 $self->set_locale( $config->{host}->{locale} ); 78 79 79 80 $self->{manager} = Wx::AuiManager->new; … … 316 317 317 318 my $doc = $self->selected_document; 318 $self->refresh_locale;319 319 $self->refresh_menu; 320 320 $self->refresh_toolbar; … … 330 330 } 331 331 332 sub refresh_locale { 332 333 sub change_locale { 334 my ($self, $shortname) = @_; 335 my $config = Padre->ide->config; 336 $config->{host}->{locale} = $shortname; 337 $self->message( 'Currently you have to restart Padre for the language change to take effect' ); 338 return; 339 } 340 341 sub set_locale { 333 342 my $self = shift; 334 my $lang = shift || Wx::Locale::GetSystemLanguage; 335 336 $self->{'locale'} = undef; 337 338 $self->{'locale'} = Wx::Locale->new($lang); 339 $self->{'locale'}->AddCatalogLookupPathPrefix( Padre::Wx::sharedir('locale') ); 340 my $langname = $self->{'locale'}->GetCanonicalName(); 341 342 my $shortname = $langname ? substr( $langname, 0, 2 ) : 'en'; # only providing default sublangs 343 my $shortname = shift; 344 345 my %map = ( 346 en => 58, 347 de => 87, 348 ); 349 my $lang = $map{$shortname}; 350 351 $self->{locale} = Wx::Locale->new($lang); 352 $self->{locale}->AddCatalogLookupPathPrefix( Padre::Wx::sharedir('locale') ); 353 my $langname = $self->{locale}->GetCanonicalName(); 354 355 #my $shortname = $langname ? substr( $langname, 0, 2 ) : 'en'; # only providing default sublangs 343 356 my $filename = Padre::Wx::sharefile( 'locale', $shortname ) . '.mo'; 344 357 345 $self->{ 'locale'}->AddCatalog($shortname) if -f $filename;358 $self->{locale}->AddCatalog($shortname) if -f $filename; 346 359 347 360 return; -
trunk/lib/Padre/Wx/Menu.pm
r853 r855 357 357 ); 358 358 359 359 $menu->{view}->AppendSeparator; 360 $menu->{view_language} = Wx::Menu->new; 361 $menu->{view}->Append( -1, gettext("Language"), $menu->{view_language} ); 362 363 # TODO horrible, fix this 364 if ($config->{host}->{locale} eq 'en') { 365 Wx::Event::EVT_MENU( $win, 366 $menu->{view_language}->AppendRadioItem( -1, gettext("English") ), 367 sub { $_[0]->change_locale('en') }, 368 ); 369 Wx::Event::EVT_MENU( $win, 370 $menu->{view_language}->AppendRadioItem( -1, gettext("German") ), 371 sub { $_[0]->change_locale('de') }, 372 ); 373 } else { 374 Wx::Event::EVT_MENU( $win, 375 $menu->{view_language}->AppendRadioItem( -1, gettext("German") ), 376 sub { $_[0]->change_locale('de') }, 377 ); 378 Wx::Event::EVT_MENU( $win, 379 $menu->{view_language}->AppendRadioItem( -1, gettext("English") ), 380 sub { $_[0]->change_locale('en') }, 381 ); 382 } 360 383 361 384 # Create the Perl menu
Note: See TracChangeset
for help on using the changeset viewer.
