NAME
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 $
VERSION
1.030
DESCRIPTION
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.
SYNOPSIS
my $loc = Locale::Text::TextDomain::OO->new(
plugins => [ qw (
Expand::BabelFish::Loc::DomainAndCategory
...
)],
...
);
SUBROUTINES/METHODS
Switch methods
methods loc_begin_bd, loc_end_bd
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.
methods loc_begin_bc, loc_end_bc
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.
methods loc_begin_bdc, loc_end_bdc
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.
Translation methods
methods loc_bd, loc_bdp
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.
methods loc_bc, loc_bcp
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.
methods loc_bdc, loc_bdcp
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.
methods Nloc_bd, Nloc_bdp
none translating methods with domain
methods Nloc_bc, Nloc_bcp
none translating methods with category
methods Nloc_bdc, Nloc_bdcp
none translating methods with domain and category
EXAMPLE
Inside of this distribution is a directory named example. Run this *.pl files.
DIAGNOSTICS
nothing
CONFIGURATION AND ENVIRONMENT
none
DEPENDENCIES
Locale::Utils::PlaceholderBabelFish
Locale::TextDomain::OO::Plugin::Expand::BabelFish::Loc
Locale::TextDomain::OO::Role::DomainAndCategory
INCOMPATIBILITIES
not known
BUGS AND LIMITATIONS
none
SEE ALSO
AUTHOR
Steffen Winkler
LICENSE AND COPYRIGHT
Copyright (c) 2017, 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.