Locale::TextDomain::OO::Plugin::Expand::BabelFish::Loc::DomainAndCategory - Methods for dynamic domain and/or category, prefixed with loc_b
$Id: DomainAndCategory.pm 651 2017-05-31 18:10:43Z steffenw $
$HeadURL: svn+ssh://steffenw@svn.code.sf.net/p/perl-gettext-oo/code/module/trunk/lib/Locale/TextDomain/OO/Plugin/Expand/Gettext/Loc/DomainAndCategory.pm $
1.030
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::BabelFish::Loc::DomainAndCategory ... )], ... );
Switch the domain.
$loc->loc_begin_bd($domain);
All translations using the lexicon of that domain.
$loc->loc_end_bd;
All translations using the lexicon before call of loc_begin_bd.
Switch the category.
$loc->loc_begin_bc($category);
All translations using the lexicon of that category.
$loc->loc_end_bc;
All translations using the lexicon before call of loc_begin_bc.
Switch the domain and category.
$loc->loc_begin_bdc($domain, $category);
All translations using the lexicon of that domain and category.
$loc->loc_end_bdc;
All translations using the lexicon before call of loc_begin_bdc.
Switch to that domain, translate and switch back.
$translation = $loc->loc_bd('domain', 'msgid', ...);
Other methods are similar extended. The domain is the 1st parameter.
Switch to that category, translate and switch back.
$translation = $loc->loc_bc('msgid', 'category', ...);
Other methods are similar extended. The category is the last parameter but before the placeholder replacement parameters.
Switch to that domain and category, translate and switch back both.
$translation = $loc->loc_bdc('domain', 'msgid', 'category', ...);
Other methods are similar extended. The domain is the 1st parameter. The category is the last parameter but before the placeholder replacement parameters.
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.
nothing
none
Locale::Utils::PlaceholderBabelFish
Moo::Role
Locale::TextDomain::OO::Plugin::Expand::BabelFish::Loc
Locale::TextDomain::OO::Role::DomainAndCategory
not known
Locale::TextDoamin::OO
Steffen Winkler
Copyright (c) 2017, Steffen Winkler <steffenw at cpan.org>. All rights reserved.
<steffenw at cpan.org>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Locale::TextDomain::OO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::TextDomain::OO
CPAN shell
perl -MCPAN -e shell install Locale::TextDomain::OO
For more information on module installation, please visit the detailed CPAN module installation guide.