package Locale::Maketext::Simple;
$Locale::Maketext::Simple::VERSION = '0.18';
use strict;
use 5.004;
=head1 NAME
Locale::Maketext::Simple - Simple interface to Locale::Maketext::Lexicon
=head1 VERSION
This document describes version 0.18 of Locale::Maketext::Simple,
released Septermber 8, 2006.
=head1 SYNOPSIS
Minimal setup (looks for F and F):
package Foo;
use Locale::Maketext::Simple; # exports 'loc'
loc_lang('fr'); # set language to French
sub hello {
print loc("Hello, [_1]!", "World");
}
More sophisticated example:
package Foo::Bar;
use Locale::Maketext::Simple (
Class => 'Foo', # search in auto/Foo/
Style => 'gettext', # %1 instead of [_1]
Export => 'maketext', # maketext() instead of loc()
Subclass => 'L10N', # Foo::L10N instead of Foo::I18N
Decode => 1, # decode entries to unicode-strings
Encoding => 'locale', # but encode lexicons in current locale
# (needs Locale::Maketext::Lexicon 0.36)
);
sub japh {
print maketext("Just another %1 hacker", "Perl");
}
=head1 DESCRIPTION
This module is a simple wrapper around B,
designed to alleviate the need of creating I for
module authors.
If B is not present, it implements a
minimal localization function by simply interpolating C<[_1]> with
the first argument, C<[_2]> with the second, etc. Interpolated
function like C<[quant,_1]> are treated as C<[_1]>, with the sole
exception of C<[tense,_1,X]>, which will append C to C<_1> when
X is C, or appending C to <_1> otherwise.
=head1 OPTIONS
All options are passed either via the C