Web::ComposableRequest::Role::L10N - Provide localisation methods
package Your::Request::Class; use Moo; extends 'Web::ComposableRequest::Base'; with 'Web::ComposableRequest::Role::L10N';
Provide localisation methods
Defines the following attributes;
domain
The domain to which this request belongs. Can be used to select assets like translation files
locale
The language requested by the client. Defaults to the LANG constant en (for English)
LANG
en
Defines the following configuration attributes
l10n_attributes
A hash reference. The domains attribute is an array reference containing the default gettext domains
domains
gettext
A non empty simple string which defaults to the constant LANG. The default locale for the application
locales
An array reference of non empty simple strings. Defaults to a list containing the LANG constant. Defines the list of locales supported by the application
quote_bind_values
A boolean which defaults to true. Causes the bind values in parameter substitutions to be quoted
loc
$localised_string = $self->loc( $key, @args );
Translates $key into the required language and substitutes the bind values
$key
loc_default
Like the loc method but always translates to the default language
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to http://rt.cpan.org/NoAuth/Bugs.html?Dist=Web-ComposableRequest. Patches are welcome
Larry Wall - For the Perl programming language
Peter Flanigan, <pjfl@cpan.org>
<pjfl@cpan.org>
Copyright (c) 2017 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install Web::ComposableRequest, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Web::ComposableRequest
CPAN shell
perl -MCPAN -e shell install Web::ComposableRequest
For more information on module installation, please visit the detailed CPAN module installation guide.