Locale::TextDomain::OO::Plugin::Expand::Gettext::Loc::DomainAndCategory - Methods for dynamic domain and/or category, prefixed with loc_
$Id: DomainAndCategory.pm 545 2014-10-30 13:23:00Z 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::Loc::DomainAndCategory ... )], ... );
Switch the domain.
$loc->loc_begin_d($domain);
All translations using the lexicon of that domain.
$loc->loc_end_d;
All translations using the lexicon before call of loc_begin_d.
Switch the category.
$loc->loc_begin_c($category);
All translations using the lexicon of that category.
$loc->loc_end_c;
All translations using the lexicon before call of loc_begin_c.
Switch the domain and category.
$loc->loc_begin_dc($domain, $category);
All translations using the lexicon of that domain and category.
$loc->loc_end_dc;
All translations using the lexicon before call of loc_begin_dc.
Switch to that domain, translate and switch back.
$translation = $loc->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->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->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::Loc
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.