Locale::TextDomain::OO::Plugin::Expand::Gettext::DomainAndCategory - Methods for dynamic domain and/or category, prefixed with __
$Id: DomainAndCategory.pm 543 2014-10-29 08:26:25Z steffenw $
1.014
This methods swiching the domain and/or category during translation process.
I am not sure if that is the best way to do. Maybe that will change in future.
my $loc = Locale::Text::TextDomain::OO->new( plugins => [ qw ( Expand::Gettext::DomainAndCategory ... )], ... );
Switch the domain.
$loc->__begin_d($domain);
All translations using the lexicon of that domain.
$loc->__end_d;
All translations using the lexicon before call of __begin_d.
Switch the category.
$loc->__begin_c($category);
All translations using the lexicon of that category.
$loc->__end_c;
All translations using the lexicon before call of __begin_c.
Switch the domain and category.
$loc->__begin_dc($domain, $category);
All translations using the lexicon of that domain and category.
$loc->__end_dc;
All translations using the lexicon before call of __begin_dc.
Switch to that domain, translate and switch back.
$translation = $loc->__dx('domain', 'msgid', key => value );
Other methods are similar extended. The domain is the 1st parameter.
Switch to that category, translate and switch back.
$translation = $loc->__cx('msgid', 'category', key => value );
Other methods are similar extended. The category is the last parameter but before the placeholder replacement hash/hash_ref.
Switch to that domain and category, translate and switch back both.
$translation = $loc->__dcx('domain', 'msgid', 'category', key => value );
Other methods are similar extended. The domain is the 1st parameter. The category is the last parameter but before the placeholder replacement hash/hash_ref.
none translating methods with domain
none translating methods with category
none translating methods with domain and category
Inside of this distribution is a directory named example. Run this *.pl files.
confess
cluck
none
Locale::Utils::PlaceholderNamed
Locale::TextDomain::OO::Plugin::Expand::Gettext
not known
none
Steffen Winkler
Copyright (c) 2013,
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.