Maroš Kollár > CatalystX-I18N-1.13 > CatalystX::I18N::Role::Base

Download:
CatalystX-I18N-1.13.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

CatalystX::I18N::Role::Base - Basic catalyst I18N support

SYNOPSIS ^

 package MyApp::Catalyst;
 
 use Catalyst qw/MyPlugins 
    CatalystX::I18N::Role::Base/;

 package MyApp::Catalyst::Controller::Main;
 use strict;
 use warnings;
 use parent qw/Catalyst::Controller/;
 
 sub action : Local {
     my ($self,$c) = @_;
     
     $c->locale('de_AT');
 }

DESCRIPTION ^

This role is required by all other roles and provides basic I18N support for Catalyst.

METHODS ^

locale

 $c->locale('de_AT');
 OR
 my $locale  = $c->locale();

Get/set the current locale. Changing this value has some side-effects:

set_locale

Same as $c->locale($locale);.

language

Returns the language part of the current locale

territory

Returns the territory part of the current locale

i18n_config

Returns the (cloned) I18N config hash for the current locale.

i18n_geocode

 my $lgt = $c->i18n_geocode
 say $lgt->name;

Returns a Locale::Geocode::Territory object for the current territory.

SEE ALSO ^

POSIX, Locale::Geocode

AUTHOR ^

    Maroš Kollár
    CPAN ID: MAROS
    maros [at] k-1.com
    
    L<http://www.k-1.com>
syntax highlighting: