CatalystX::I18N::TraitFor::Request - Adds various I18N methods to a Catalyst::Request object
package MyApp::Catalyst; use CatalystX::RoleApplicator; use Catalyst qw/MyPlugins CatalystX::I18N::Role::Base/; __PACKAGE__->apply_request_class_roles(qw/CatalystX::I18N::TraitFor::Request/);
Adds several attributes to a Catalyst::Request object that help you determine a users language and locale.
All attributes are lazy. This means that the values will be only calculated when the attributes is read/called the first time.
my @languages = $c->request->accept_language();
Returns an ordered list of accepted languages (from the 'Accept-Language' header). Inavlid entries in the language headers are filtered.
my $browser_language = $c->request->browser_language();
Returns the language of the browser (form the 'User-Agent' header)
my $browser_territory = $c->request->browser_territory();
Returns the territory of the browser (form the 'User-Agent' header)
my $browser_territory = $c->request->client_country();
Looks up the client IP-address via IP::Country::Fast.
my $browser_detect = $c->request->browser_detect();
Returns a HTTP::BrowserDetect object.
Catalyst::Request, IP::Country::Fast, HTTP::BrowserDetect
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.