Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/regru/catalyst-plugin-babelfish
Catalyst plugin for i18n using Locale::Babelfish
https://github.com/regru/catalyst-plugin-babelfish
Last synced: 29 days ago
JSON representation
Catalyst plugin for i18n using Locale::Babelfish
- Host: GitHub
- URL: https://github.com/regru/catalyst-plugin-babelfish
- Owner: regru
- Created: 2014-06-03T11:31:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-10T09:19:20.000Z (about 10 years ago)
- Last Synced: 2024-04-17T05:50:32.084Z (9 months ago)
- Language: Perl
- Size: 270 KB
- Stars: 0
- Watchers: 29
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
# NAME
Catalyst::Plugin::Babelfish - Locale::Babelfish for Catalyst
[![Build Status](https://travis-ci.org/regru/Catalyst-Plugin-Babelfish.svg?branch=master)](https://travis-ci.org/regru/Catalyst-Plugin-Babelfish)
# VERSION
version 1.000000
# SYNOPSIS
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}) %]# DESCRIPTION
...
## CONFIGURATION
You can override any parameter sent to [Locale::Babelfish](https://metacpan.org/pod/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`# METHODS
## t
$c->t( ... );
Short form for
$c->l10n->t( ... );
## l10n
Babelfish object
$c->l10n->t( ... )
$c->l10n->has_any_value( ... )and other methods
# SEE ALSO
[Locale::Babelfish](https://metacpan.org/pod/Locale::Babelfish)
[https://github.com/nodeca/babelfish](https://github.com/nodeca/babelfish)
# AUTHORS
- Akzhan Abdulin
- Igor Mironov# COPYRIGHT AND LICENSE
This software is Copyright (c) 2014 by Igor Mironov.
This is free software, licensed under:
The MIT (X11) License