CatalystX::I18N::Role::Base - Basic catalyst I18N support
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'); }
This role is required by all other roles and provides basic I18N support for Catalyst.
$c->locale('de_AT'); OR my $locale = $c->locale();
Get/set the current locale. Changing this value has some side-effects:
Stores the locale in the current session (if any)
Sets the 'Content-Language' response header (if CatalystX::I18N::TraitFor::Response has been loaded)
Same as $c->locale($locale);.
$c->locale($locale);
Returns the language part of the current locale
Returns the territory part of the current locale
Returns the (cloned) I18N config hash for the current locale.
my $lgt = $c->i18n_geocode say $lgt->name;
Returns a Locale::Geocode::Territory object for the current territory.
POSIX, Locale::Geocode
Maroš Kollár CPAN ID: MAROS maros [at] k-1.com L<http://www.k-1.com>
To install CatalystX::I18N, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::I18N
CPAN shell
perl -MCPAN -e shell install CatalystX::I18N
For more information on module installation, please visit the detailed CPAN module installation guide.