NAME

CatalystX::I18N::TraitFor::Request - Adds various I18N methods to a Catalyst::Request object

SYNOPSIS

package MyApp::Catalyst;

use CatalystX::RoleApplicator;
use Catalyst qw/MyPlugins 
   CatalystX::I18N::Role::Base/;

__PACKAGE__->apply_request_class_roles(qw/CatalystX::I18N::TraitFor::Request/);

DESCRIPTION

Adds several methods to a Catalyst::Request object that help you determine a users language and locale.

All methods are lazy. This means that the values will be only calculated upon the first call of the method.

METHODS

accept_language

my @languages = $c->request->accept_language();

Returns an ordered list of accepted languages (from the 'Accept-Language' header)

browser_language

my $browser_language = $c->request->browser_language();

Returns the language of the browser (form the 'User-Agent' header)

browser_territory

my $browser_territory = $c->request->browser_territory();

Returns the territory of the browser (form the 'User-Agent' header)

client_country

my $browser_territory = $c->request->client_country();

Looks up the client IP-address via IP::Country::Fast.

browser_detect

my $browser_detect = $c->request->browser_detect();

Returns a HTTP::BrowserDetect object.

SEE ALSO

Catalyst::Request, IP::Country::Fast, HTTP::BrowserDetect

AUTHOR

Maroš Kollár
CPAN ID: MAROS
maros [at] k-1.com

L<http://www.revdev.at>