Maroš Kollár > CatalystX-I18N > CatalystX::I18N::Role::PosixLocale

Download:
CatalystX-I18N-1.12.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

CatalystX::I18N::Role::PosixLocale - Sets the POSIX locale

SYNOPSIS ^

 # In your catalyst base class
 package MyApp::Catalyst;
 
 use Catalyst qw/MyPlugins 
    CatalystX::I18N::Role::Base
    CatalystX::I18N::Role::PosixLocale/;

 sub action : Local {
     my ($self,$c) = @_;
     
     $c->locale('sk_SK')
     # POSIX LC_COLLATE locale is 'sk_SK.UTF-8' now
 }

DESCRIPTION ^

This role sets the POSIX locales for each request.

METHODS ^

i18n_posix_category

Helper method that returns the value of the requested POSIX locale category (LC_ALL, LC_COLLATE, LC_NUMERIC, LC_MONETARY). The POSIX category that should be used can be set in the I18N config.

 __PACKAGE__->config( 
     I18N    => {
         posix_category     => 'LC_COLLATE',
     }
 );

Default is LC_ALL

SEE ALSO ^

POSIX, perllocale

AUTHOR ^

    Maroš Kollár
    CPAN ID: MAROS
    maros [at] k-1.com
    
    L<http://www.revdev.at>
syntax highlighting: