Locale::TextDomain::OO::Plugin::Expand::Gettext::DomainAndCategory - Methods for dynamic domain and/or category, prefixed with __
$Id: DomainAndCategory.pm 689 2017-08-29 21:37:38Z steffenw $
$HeadURL: svn+ssh://steffenw@svn.code.sf.net/p/perl-gettext-oo/code/module/trunk/lib/Locale/TextDomain/OO/Plugin/Expand/Gettext/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::Gettext::DomainAndCategory ... )], ... );
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.
nothing
none
Locale::Utils::PlaceholderNamed
Moo::Role
Locale::TextDomain::OO::Plugin::Expand::Gettext
Locale::TextDomain::OO::Role::DomainAndCategory
not known
Locale::TextDoamin::OO
Steffen Winkler
Copyright (c) 2013 - 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.