Changeset 275 for trunk


Ignore:
Timestamp:
12/16/09 11:04:36 (14 years ago)
Author:
nanardon
Message:
  • add code to support i18n
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.PL

    r261 r275  
    1414requires 'Catalyst::Plugin::Prototype'; 
    1515requires 'Catalyst::View::TT'; 
     16requires 'Catalyst::Plugin::I18N'; 
    1617 
    1718requires 'YAML'; # This should reflect the config file format you've chosen 
     
    5253    return " 
    5354 
     55pot: lib/Epoll/I18N/messages.pot 
     56 
     57po: lib/Epoll/I18N/fr.po 
     58 
     59lib/Epoll/I18N/messages.pot: 
     60\tcat MANIFEST | egrep '(.pm|.tt)' | xargs xgettext.pl -o lib/Epoll/I18N/messages.pot 
     61 
     62lib/Epoll/I18N/fr.po: lib/Epoll/I18N/messages.pot 
     63\tmsginit --input=lib/Epoll/I18N/messages.pot --output=lib/Epoll/I18N/fr.po --locale=fr 
     64 
    5465svnmanifest: 
    5566\tsvn ls -R| grep -v '/\$\$'  > MANIFEST 
     
    6172\tmd5sum -c control/md5sum 
    6273 
    63 .PHONY: md5sum checkmd5 svnmanifest 
     74.PHONY: md5sum checkmd5 svnmanifest pot lib/Epoll/I18N/messages.pot 
    6475 
    6576ChangeLog: 
  • trunk/epoll.spec.in

    r255 r275  
    1515 
    1616BuildRequires: perl(Catalyst::Plugin::Prototype) 
     17BuildRequires: perl(Catalyst::Plugin::I18N) 
     18 
     19Requires: perl(Catalyst::Plugin::Prototype) 
     20Requires: perl(Catalyst::Plugin::I18N) 
    1721 
    1822%description 
  • trunk/lib/Epoll.pm

    r259 r275  
    2222    Session::State::Cookie 
    2323    Prototype 
     24    I18N 
    2425    /; 
    2526 
     
    5859__PACKAGE__->config->{session}{dbi_dsn} = 'dbi:Pg:' . __PACKAGE__->config->{db}; 
    5960 
     61sub begin : Private { 
     62    my ( $self, $c ) = @_; 
     63 
     64    my $locale = $c->request->param('locale'); 
     65 
     66    $c->loc('foo bar'); 
     67 
     68    $c->response->headers->push_header( 'Vary' => 'Accept-Language' );  # hmm vary and param? 
     69    $c->languages( $locale ? [ $locale ] : undef 
     70    ); 
     71} 
    6072 
    6173=head1 NAME 
  • trunk/root/templates/default.tt

    r259 r275  
    55<form action="[% c.uri_for %]" method="POST"> 
    66[% IF novoting %] 
    7 <p class="warning">Aucun vote en cours ne concerne [% novoting | html %].</p> 
     7<p class="warning">[% c.loc('Aucun vote en cours ne concerne') %] [% novoting | html %].</p> 
    88[% END %] 
    99[% IF sendvoting %] 
  • trunk/root/templates/includes/header.tt

    r262 r275  
    2626<!-- $Id$ --> 
    2727<div id="header"> 
    28     <p id="title"><b>Epoll:</b> systÚme de vote en ligne</p> 
     28    <p id="title"><b>Epoll:</b> [% c.loc('systÚme de vote en ligne') %]</p> 
    2929    <p id="now" style="float: right">Page générée le [% c.model('Vote').dbtime | html %]</p> 
    3030    <p id="menu"> 
Note: See TracChangeset for help on using the changeset viewer.