Catalyst::Plugin::Babelfish - Locale::Babelfish for Catalyst
version 1.000000
use Catalyst 'Babelfish';
$c->l10n->locale('ru_RU');
print $c->l10n->locale;
print $c->l10n->t('main.hello');
Use a macro if you're lazy:
[% MACRO t(text, args) BLOCK;
c.t(text, args);
END; %]
[% t('main.hello') %]
[% t('main.test', { test => 1}) %]
...
You can override any parameter sent to Locale::Babelfish by specifying
a babelfish
hashref to the config section:
__PACKAGE__->config(
babelfish => {
default_locale => 'en_US',
dirs => [ "/path/to/dictionaries" ],
lang_param => 'language',
},
);
All parameters equal to Locale::Babelfish except lang_param
this parameter for automatic language change.
Plugin will check parameter in GET-POST request, by default lang
$c->t( ... );
Short form for
$c->l10n->t( ... );
Babelfish object
$c->l10n->t( ... )
$c->l10n->has_any_value( ... )
and other methods
https://github.com/nodeca/babelfish
- Akzhan Abdulin akzhan@cpan.org
- Igor Mironov grif@cpan.org
This software is Copyright (c) 2014 by Igor Mironov.
This is free software, licensed under:
The MIT (X11) License