The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Locale::TextDomain::OO::Role::DomainAndCategory - Provides domain and category switch methods

$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/Role/DomainAndCategory.pm $

VERSION

1.030

DESCRIPTION

This module provides domain and category switch methods and the local scope for for Locale::TextDomain:OO.

SYNOPSIS

see SUBROUTINES/METHODS

SUBROUTINES/METHODS

method callback_scope

    $loc->callback_scope(
        sub {
            # switch domain and/or category
            $loc->begin_...(...);
            return $loc->... # translate
        },
    );
}

methods begin_d, end_d

Switch the domain.

    $loc->begin_d($domain);

All translations using the lexicon of that domain.

    $loc->end_d;

All translations using the lexicon before call of begin_d.

methods begin_c, end_c

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.

methods begin_dc, end_dc

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.

EXAMPLE

Inside of this distribution is a directory named example. Run this *.pl files.

DIAGNOSTICS

confess

cluck

CONFIGURATION AND ENVIRONMENT

none

DEPENDENCIES

Carp

Locale::TextDomain::OO::Translator

Moo::Role

INCOMPATIBILITIES

not known

BUGS AND LIMITATIONS

none

SEE ALSO

Locale::TextDoamin::OO

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.