NAME

Term::CLI::L10N - localizations for Term::CLI

VERSION

version 0.059000

SYNOPSIS

use Term::CLI::L10N qw( :all );

say loc("invalid value"); # "loc" is imported by default.

say __("invalid value");  # "__" is not imported by default.


my $lh = Term::CLI::L10N->handle();

say $lh->maketext("invalid value");  # "maketext" is not imported by default.

DESCRIPTION

The Term::CLI::L10N module implements a localization mechanism based on Locale::Maketext(3p).

FUNCTIONS

The module can export a few utility routines.

__ ( Str [, Str ... ] )

Synonym for loc.

loc ( Str [, Str ... ] )

Call Locale::Maketext's maketext function on the arguments.

CLASS METHODS

handle

Return the module's Locale::Maketext handle.

set_language ( Str [, ... ] )

Set the language to Str, trying multiple if a list is given.

Dies with an error if no language can be loaded.

EXAMPLES

use Term::CLI::L10N qw( loc ); # Initialise using current locale.

Term::CLI::L10N->set_language('nl'); # Force "nl" language.

say loc("ERROR"); # Should print "FOUT".

SEE ALSO

Term::CLI::L10N::en(3p), Term::CLI::L10N::nl(3p), Locale::Maketext(3p), Locale::Maketext::Lexicon(3p).

AUTHOR

Steven Bakker <sbakker@cpan.org>.

COPYRIGHT AND LICENSE

Copyright (c) 2018 Steven Bakker; All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See "perldoc perlartistic."

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.