- SEE ALSO
- COPYRIGHT AND LICENSE
Locale::TextDomain::IfEnv - Enable translation only when environment variable flag is true
This document describes version 0.002 of Locale::TextDomain::IfEnv (from Perl distribution Locale-TextDomain-IfEnv), released on 2019-12-26.
use Locale::TextDomain::IfEnv 'Some-TextDomain'; print __ "Hello, world!\n";
When imported, Locale::TextDomain::IfEnv will check the
PERL_LOCALE_TEXTDOMAIN_IFENV environment variable. If the environment variable has a true value, the module will load Locale::TextDomain 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.
For simplicity, currently the tied hash (
%__) and its hashref (
$__) are not provided. Contact me if you use and need this.
Please visit the project's homepage at https://metacpan.org/release/Locale-TextDomain-IfEnv.
Source repository is at https://github.com/perlancar/perl-Locale-TextDomain-IfEnv.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Locale-TextDomain-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.
This software is copyright (c) 2019 by firstname.lastname@example.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.