Changeset 2296


Ignore:
Timestamp:
12/30/08 18:29:52 (3 years ago)
Author:
adamk
Message:

Clarifying what the languages() sub was for

Location:
trunk/Padre/lib/Padre
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Locale.pm

    r2294 r2296  
    191191my %NUMBER = reverse %SHORTNAME; 
    192192 
    193 # LANGUAGES hash needs to be here in order 
    194 # the get the run-time language change for these words too. 
    195 my %LANGUAGES = ( 
     193# The list of languages that should be shown in the language menu 
     194# and the strings that should be used to label them. 
     195sub menu_view_languages { 
    196196    ar => Wx::gettext('Arabic'), 
    197197    de => Wx::gettext('German'), 
     
    206206    pt => Wx::gettext('Portuguese'), # Actually brazilian, which is a bug 
    207207        es => Wx::gettext('Spanish'), 
    208 ); 
    209  
    210 # TODO: The need for direct access to the table indicates a failure 
    211 #       on the part of Padre::Locale to provide sufficiently useful 
    212 #       functions. Second-generation locale support has data that is 
    213 #       too complex to be reasonably useful to external consumers, so 
    214 #       we need to fix that by providing more direct functions. 
    215 sub languages { 
    216     return %LANGUAGES; 
    217208} 
    218209 
  • trunk/Padre/lib/Padre/Wx/Menu/View.pm

    r2231 r2296  
    2121 
    2222sub new { 
    23     my $class = shift; 
    24     my $main  = shift; 
     23    my $class  = shift; 
     24    my $main   = shift; 
     25    my $config = Padre->ide->config; 
    2526 
    2627    # Create the empty menu as normal 
     
    190191 
    191192 
     193 
    192194    # Font Size 
    193195    Wx::Event::EVT_MENU( $main, 
     
    245247    $self->AppendSeparator; 
    246248 
    247     my $config    = Padre->ide->config; 
     249 
     250 
     251 
    248252 
    249253    # Styles (temporary location?) 
     
    253257        $self->{style} 
    254258    ); 
    255     my %styles    = (default => 'Default', night => 'Night'); 
     259    my %styles = ( default => 'Default', night => 'Night' ); 
    256260    foreach my $name ( sort { $styles{$a} cmp $styles{$b} }  keys %styles) { 
    257261        my $label = $styles{$name}; 
     
    269273 
    270274 
     275 
     276 
     277 
    271278    # Language Support 
    272279    $self->{language} = Wx::Menu->new; 
     
    284291    $self->{language}->AppendSeparator; 
    285292 
    286     my %languages = Padre::Locale::languages(); 
     293    my %languages = Padre::Locale::menu_view_languages(); 
    287294    foreach my $name ( sort { $languages{$a} cmp $languages{$b} }  keys %languages) { 
    288295        my $label = $languages{$name}; 
    289296        if ( $label eq 'English' ) { 
     297            # NOTE: A dose of fun in a mostly boring application. 
     298            # With more Padre developers, more countries, and more 
     299            # people in total British English instead of American 
     300            # English CLEARLY it is a FAR better default for us to 
     301            # use. 
     302            # Because it's something of an in joke to English 
     303            # speakers, non-English localisations do NOT show this. 
    290304            $label = "English (New Britstralian)"; 
    291305        } 
    292306 
    293307        my $radio = $self->{language}->AppendRadioItem( -1, $label ); 
    294         if ( $config->{host}->{locale} and $config->{host}->{locale} eq $name ) { 
    295             $radio->Check(1); 
    296         } 
    297308        Wx::Event::EVT_MENU( $main, 
    298309            $radio, 
     
    301312            }, 
    302313        ); 
     314        if ( $config->{host}->{locale} and $config->{host}->{locale} eq $name ) { 
     315            $radio->Check(1); 
     316        } 
    303317    } 
    304318 
     
    312326    Wx::Event::EVT_MENU( $main, 
    313327        $self->Append( -1, 
    314             Wx::gettext("&Full screen\tF11") 
     328            Wx::gettext("&Full Screen\tF11") 
    315329        ), 
    316330        sub { 
Note: See TracChangeset for help on using the changeset viewer.