NAME
Dancer::Plugin::Locale::Wolowitz - Internationalization for Dancer
VERSION
version 0.160190
SYNOPSIS
use Dancer ':syntax';
use Dancer::Plugin::Locale::Wolowitz;
get '/' => sub {
template index;
}
DESCRIPTION
Provides an easy way to translate your application. This module relies on Locale::Wolowitz, please consult the documentation of Locale::Wolowitz.
METHODS
loc
loc('Welcome');
loc('View %1', ['Country'])
loc('View %1', ['Country'], $language)
or in templates
<% l('Welcome') %>
<% l('View %1', ['Country']) %>
<% l('View %1', ['Country'], 'fr') %>
Translated to the requested language, if such a translation exists, otherwise no translation occurs. Just like in Locale::Wolowitz, with the difference that auto-detection is the default, hence an optional passed language is the third, instead of the the second argument.
input: (Str): Key translate
(Arrayref): Arguments are injected to the placeholders in the string
(Str): Language code, to circumvent auto-detection from browser header
output: (Str): Translated to the requested language
CONFIGURATION
plugins:
Locale::Wolowitz:
lang_session: "lang"
locale_path_directory: "i18n"
CONTRIBUTING
This module is developed on Github at:
http://github.com/hobbestigrou/Dancer-Plugin-Locale-Wolowitz
ACKNOWLEDGEMENTS
Thanks to Ido Perlmuter for Locale::Wolowitz
BUGS
Please report any bugs or feature requests via github issue tracker.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Dancer::Plugin::Locale::Wolowitz
SEE ALSO
AUTHOR
Natal Ngétal
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Natal Ngétal.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.