Leyland::Localizer - Wrapper for the Locale::Wolowitz localization system for Leyland apps
version 0.001007
# in app.psgi my $config = { ... locales => '/path/to/myapp/locales', ... }; # in your controllers $c->set_lang('es'); # use Spanish when responding, possibly because that's what the client wants $c->loc('Hello %1', $c->params->{name}); # in your views (assuming you're using L<Tenjin>): <h1>[== $c->loc('Hello %1', $c->params->{name}) =]</h1>
This module provides Leyland applications with simple localization capabilities, using Locale::Wolowitz. This does not mean localizing your application to the locale of the computer/server on which it is running, but localizing your HTTP responses according to your application's client's wishes.
If, for example, your application is a website provided in two or more languages, this module will provide your application with Wolowitz's loc() method, for translating strings into a certain language.
loc()
See the Leyland::Manual::Localization for more information.
The path of the directory in which Locale::Wolowitz translation files reside. Can be a relative path. This attribute will come from the "locales" config option in app.psgi.
app.psgi
The Locale::Wolowitz object used for localization.
Translates $string into $language, possibly performing some replacements. This is just a shortcut for Locale::Wolowitz->loc(), so check out Locale::Wolowitz for more information.
$string
$language
Locale::Wolowitz->loc()
The following methods are only to be used internally.
Automatically called by Moose after initializing an instance of this class, this method creates a new Locale::Wolowitz object and saves it as the "w" attribute.
Ido Perlmuter, <ido at ido50.net>
<ido at ido50.net>
Please report any bugs or feature requests to bug-Leyland at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Leyland. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-Leyland at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Leyland::Localizer
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Leyland
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Leyland
CPAN Ratings
http://cpanratings.perl.org/d/Leyland
Search CPAN
http://search.cpan.org/dist/Leyland/
Copyright 2010-2011 Ido Perlmuter.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Leyland, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Leyland
CPAN shell
perl -MCPAN -e shell install Leyland
For more information on module installation, please visit the detailed CPAN module installation guide.