Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Catalyst: accessing maketext from a model

by mkchris (Sexton)
on Jan 20, 2022 at 16:47 UTC ( [id://11140649]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $c->model("DB::$resultset")->do_something({
      language => sub{ $c->maketext( @_ ); }
    });
    
  2. or download this
      $c->log->debug( sprintf( "maketext: '%s'", $c->maketext("menu.title.
    +news") ) );
    $c->log->debug( sprintf( "model maketext: '%s'", $c->model("maketext")
    +->maketext("menu.title.news") ) );
    
  3. or download this
    [debug] maketext: 'News Index'
    [debug] model maketext: 'News Index'
    
  4. or download this
    #!/usr/bin/perl
    
    use strict;
    ...
    
    my $lang = TopTable::Maketext->new($maketext_info);
    printf "%s\n", $lang->maketext( "menu.title.news" );
    
  5. or download this
    maketext doesn't know how to say:
    menu.title.news
    as needed at bin\maketext-demo.pl line 16.
    
  6. or download this
    my $dir = Path::Class::Dir->new( "$Bin/..", "root", "locale" );
    my $lang = TopTable::Maketext->new(directories => $dir);
    
  7. or download this
    my $dir = Path::Class::Dir->new( "$Bin/..", "root", "locale" );
    my $lang = TopTable::Maketext->new(directories => $dir, locales => "en
    +-GB");
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11140649]
Approved by philipbailey
Front-paged by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-29 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found