NAME
Locale::TextDomain::UTF8::IfEnv - Enable translation + UTF-8 encoding only when environment variable flag is true
VERSION
This document describes version 0.001 of Locale::TextDomain::UTF8::IfEnv (from Perl distribution Locale-TextDomain-UTF8-IfEnv), released on 2019-12-26.
SYNOPSIS
Use like you would use Locale::TextDomain::UTF8 (but see "Caveats"):
use Locale::TextDomain::UTF8::IfEnv 'Some-TextDomain';
print __ "Hello, world!\n";
DESCRIPTION
When imported, Locale::TextDomain::UTF8::IfEnv will check the PERL_LOCALE_TEXTDOMAIN_IFENV
environment variable. If the environment variable has a true value, the module will load Locale::TextDomain::UTF8 and pass the import arguments to it. If the environment variable is false, the module will install a mock version of __
, et al. Thus, all strings will translate to themselves.
This module can be used to avoid the startup (and runtime) cost of translation unless when you want to enable translation.
Caveats
For simplicity, currently the tied hash (%__
) and its hashref ($__
) are not provided. Contact me if you use and need this.
ENVIRONMENT
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/Locale-TextDomain-UTF8-IfEnv.
SOURCE
Source repository is at https://github.com/perlancar/perl-Locale-TextDomain-UTF8-IfEnv.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Locale-TextDomain-UTF8-IfEnv
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
SEE ALSO
Bencher::Scenarios::LocaleTextDomainIfEnv
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2019 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.