Sören Kornetzki

NAME

Plack::Middleware::ExtractUriLanguage - Cuts off language tags out of the request's PATH_INFO to simplify internationalization route handlers.

VERSION

This documentation describes ExtractUriLanguage within version 0.004.

Current development state: BETA release

SYNOPSIS

    # with Plack::Middleware::ExtractUriLanguage
    enable 'Plack::Middleware::ExtractUriLanguage',
      ExtractUriLanguageOrig => 'extracturilanguage.path_info',
      ExtractUriLanguageTag  => 'extracturilanguage.language';

DESCRIPTION

ExtractUriLanguage cuts off language tags out of the request's PATH_INFO to simplify internationalization route handlers. The extracted language tag will be stored within the environment variable extracturilanguage.language (configurable). The original unmodified PATH_INFO is additionaly saved within the environment variable extracturilanguage.path_info (configurable).

CONFIGURATION AND ENVIRONMENT

ExtractUriLanguageOrig

    ExtractUriLanguageOrig  => 'extracturilanguage.path_info';

Environment variable name for the original unmodified PATH_INFO. The default is "extracturilanguage.path_info".

ExtractUriLanguageTag

    ExtractUriLanguageTag  => 'extracturilanguage.language';

Environment variable name for the detected language tag. The default is "extracturilanguage.language".

ExtractUriLanguageList

    ExtractUriLanguageList => [qw( de de-de en en-us en-gb )];

Only detect and extract the language tags defined with this list. The default is undef. When undef ExtractUriLanguage will try to guess the language tag based on the following formats:

ISO 639-1 "-" ISO 3166 ALPHA-2 ( "de-de", "en-us", "en-gb" )
ISO 639-1 ( "de", "en" )

BUGS AND LIMITATIONS

Please report all bugs and feature requests at GitHub Issues.

AUTHOR

BURNERSK <burnersk@cpan.org>

COPYRIGHT AND LICENSE

This file is part of Plack-Middleware-ExtractUriLanguage

This software is Copyright (c) 2013 by BURNERSK.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)