CatalystX::I18N::Role::PosixLocale - Sets the POSIX locale
# 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 }
This role sets the POSIX locales for each request.
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
POSIX locale is set for the whole process, and might affect other modules outside of Catalyst' scope. This role is also known to cause problems if used in conjunction with the CatalystX::I18N::TraitFor::ViewTT role
POSIX, perllocale
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.