Changeset 2354

Show
Ignore:
Timestamp:
05/16/08 06:32:09 (21 months ago)
Author:
fumiakiy
Message:

Translate labels of widgets that are included in a widgetset. BugId:79752

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-38/lib/MT/DefaultTemplates.pm

    r2220 r2354  
    321321            $tmpl_hash = $set ? $def_tmpl->{templates} : $def_tmpl; 
    322322        } 
     323        my $plugin = $tmpl_hash->{plugin}; 
    323324 
    324325        foreach my $tmpl_set (keys %$tmpl_hash) { 
     
    367368                } 
    368369 
     370                if ( exists $tmpl->{widgets} ) { 
     371                    my $widgets = $tmpl->{widgets}; 
     372                    my @widgets; 
     373                    foreach my $widget ( @$widgets ) { 
     374                        if ( $plugin ) { 
     375                            push @widgets, $plugin->translate( $widget ); 
     376                        } 
     377                        else { 
     378                            push @widgets, MT->translate( $widget ); 
     379                        } 
     380                    } 
     381                    $tmpl->{widgets} = \@widgets if @widgets; 
     382                } 
     383 
    369384                my $local_global_tmpls = $tmpl->{global} ? \%global_tmpls : \%tmpls; 
    370385                if (exists $local_global_tmpls->{$tmpl_id}) {