Locale::TextDomain::OO::Plugin::Expand::Maketext - Additional maketext methods
$Id: Maketext.pm 487 2014-02-03 14:31:43Z steffenw $
1.009
This module provides additional maketext methods like Locale::Maketext::Simple to run that on projects that use Locale::Maketext at the moment.
To run maketext with different context (msgctxt) run method maketext_p.
my $loc = Locale::Text::TextDomain::OO->new( plugins => [ qw ( Expand::Maketext ... )], ... );
Optional type formatting see Locale::Utils::PlaceholderMaketext for possible methods.
$loc->expand_maketext->formatter_code($code_ref);
Returns the Locale::Utils::PlaceholderMaketext object to be able to set some options.
my $expander_object = $self->expand_maketext;
This method includes the expansion as 'quant' or '*'.
print $loc->maketext( 'Hello World!', );
print $loc->maketext( 'Hello [_1]!', 'Steffen', );
print $loc->maketext( '[quant,_1,file read,files read]', $num_files, );
print $loc->maketext_p ( 'time', 'to', );
print $loc->maketext_p ( 'destination', 'to', );
print $loc->maketext_p ( 'destination', 'from [_1] to [_2]', 'Chemnitz', 'Erlangen', );
print $loc->maketext_p( 'maskulin', 'Mr. [_1] has [*,_2,book,books].', $name, $books, );
The extractor looks for maketext('...
and has no problem with <$loc-
Nmaketext('...>>.
This is the idea of the N-Methods.
$loc->Nmaketext('...'); $loc->Nmaketext_p('...', '...');
Inside of this distribution is a directory named example. Run this *.pl files.
confess
none
Locale::Utils::PlaceholderMaketext
not known
none
Steffen Winkler
Copyright (c) 2009 - 2014,
Steffen Winkler
<steffenw at cpan.org>
.
All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.