perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RobertCZ <rob...@robert.cz>
Subject default_messages ignored?
Date Sun, 12 Dec 2004 19:24:06 GMT
Hi,

  default_messages don't seem to work:

-----------

<h1>*** [= Heading =] ***</h1>
<h1>*** [= Submit =] ***</h1>

-----------

would print correct thing with test.html?lang=en but only


  *** Hlavicka ***


  *** ***

when test.html?lang=cz

It looks like defauly messages are completely ignored. app file included 
below

- Robert


-----------

@ISA = ('Embperl::App') ;

sub init {
        my $self = shift ;
        my $r = $self->curr_req ;
        my $fdat = $r->thread->form_hash;        
        my $lang = $fdat->{lang} || 'en' ;
#   my %messages = %{ do '/home/www/phl/etc/dict/dict.dump' };
    my %messages =
        (
        'cz' =>
            {
            'Heading' => 'Hlavicka',
            'Submit'  => undef,
            },
        'en' =>
            {
            'Heading' => 'Heading',
            'Submit'  => 'Submit',
            },
        ) ;
        
        push @{$r->messages}, $messages{$lang} ;
        push @{$r->default_messages}, $messages{'en'} if ($lang ne 'en') ;

    return 0;

}
 
1 ;


Mime
View raw message