NAME

MojoX::FilterChain::DetectLang - Detect client language filter

SYNOPSIS

$chain
  ->add(MojoX::FilterChain::DetectLang->new(languages => [qw/ en de /]));

...

# /
$chain->process($c);
$c->stash->{language}; # undef

# /en
$chain->process($c);
$c->stash->{language}; # en

# /de/path
$chain->process($c);
$c->stash->{language}; # de

DESCRIPTION

MojoX::FilterChain::DetectLang is a filter for detecting client language

METHODS

MojoX::FilterChain::DetectLang inherits all methods from MojoX::FilterChain::Base and implements the following ones.

languages

Languages that your website can handle.

stash_key

Stash variable name where language will be stored.