-
-
15 Mar 2019 15:51:07 UTC
- Distribution: Locale-TextDomain-OO
- Module version: 1.030
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (346 / 0 / 1)
- Kwalitee
Bus factor: 1- 80.51% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity
24 month- Tools
- Download (100.82KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Steffen Winkler <steffenw at cpan.org>
- Dependencies
- Carp
- Class::Load
- Clone
- Encode
- English
- Hash::Util
- JSON
- JSON::PP
- Locale::MO::File
- Locale::PO
- Locale::TextDomain::OO::Util
- Locale::TextDomain::OO::Util::ExtractHeader
- Locale::TextDomain::OO::Util::JoinSplitLexiconKeys
- Locale::Utils::PlaceholderBabelFish
- Locale::Utils::PlaceholderMaketext
- Locale::Utils::PlaceholderNamed
- Moo
- Moo::Role
- MooX::Singleton
- MooX::StrictConstructor
- MooX::Types::MooseLike::Base
- Path::Tiny
- Tie::Sub
- Try::Tiny
- namespace::autoclean
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- NAME
- VERSION
- DESCRIPTION
- SYNOPSIS
- SUBROUTINES/METHODS
- Switch methods
- Translation methods
- methods loc_d, loc_dn, loc_dp, loc_dnp, loc_dx, loc_dnx, loc_dpx, loc_dnpx
- methods loc_c, loc_cn, loc_cp, loc_cnp, loc_cx, loc_cnx, loc_cpx, loc_cnpx
- methods loc_dc, loc_dcn, loc_dcp, loc_dcnp, loc_dcx, loc_dcnx, loc_dcpx, loc_dcnpx
- methods Nloc_d, Nloc_dn, Nloc_dp, Nloc_dnp, Nloc_dx, Nloc_dnx, Nloc_dpx, Nloc_dnpx
- methods Nloc_c, Nloc_cn, Nloc_cp, Nloc_cnp, Nloc_cx, Nloc_cnx, Nloc_cpx, Nloc_cnpx
- methods Nloc_dc, Nloc_dcn, Nloc_dcp, Nloc_dcnp, Nloc_dcx, Nloc_dcnx, Nloc_dcpx, Nloc_dcnpx
- EXAMPLE
- DIAGNOSTICS
- CONFIGURATION AND ENVIRONMENT
- DEPENDENCIES
- INCOMPATIBILITIES
- BUGS AND LIMITATIONS
- SEE ALSO
- AUTHOR
- LICENSE AND COPYRIGHT
NAME
Locale::TextDomain::OO::Plugin::Expand::Gettext::Loc::DomainAndCategory - Methods for dynamic domain and/or category, prefixed with loc_
$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/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::Gettext::Loc::DomainAndCategory ... )], ... );
SUBROUTINES/METHODS
Switch methods
methods loc_begin_d, loc_end_d
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.
methods loc_begin_c, loc_end_c
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.
methods loc_begin_dc, loc_end_dc
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.
Translation methods
methods loc_d, loc_dn, loc_dp, loc_dnp, loc_dx, loc_dnx, loc_dpx, loc_dnpx
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.
methods loc_c, loc_cn, loc_cp, loc_cnp, loc_cx, loc_cnx, loc_cpx, loc_cnpx
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.
methods loc_dc, loc_dcn, loc_dcp, loc_dcnp, loc_dcx, loc_dcnx, loc_dcpx, loc_dcnpx
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.
methods Nloc_d, Nloc_dn, Nloc_dp, Nloc_dnp, Nloc_dx, Nloc_dnx, Nloc_dpx, Nloc_dnpx
none translating methods with domain
methods Nloc_c, Nloc_cn, Nloc_cp, Nloc_cnp, Nloc_cx, Nloc_cnx, Nloc_cpx, Nloc_cnpx
none translating methods with category
methods Nloc_dc, Nloc_dcn, Nloc_dcp, Nloc_dcnp, Nloc_dcx, Nloc_dcnx, Nloc_dcpx, Nloc_dcnpx
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::PlaceholderNamed
Locale::TextDomain::OO::Plugin::Expand::Gettext::Loc
Locale::TextDomain::OO::Role::DomainAndCategory
INCOMPATIBILITIES
not known
BUGS AND LIMITATIONS
none
SEE ALSO
AUTHOR
Steffen Winkler
LICENSE AND COPYRIGHT
Copyright (c) 2013 - 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.
Module Install Instructions
To install Locale::TextDomain::OO, copy and paste the appropriate command in to your terminal.
cpanm Locale::TextDomain::OO
perl -MCPAN -e shell install Locale::TextDomain::OO
For more information on module installation, please visit the detailed CPAN module installation guide.