Locale:...Category(3)

πŸ“¦
version 1.036 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’–

okay so bestie, welcome to Locale::TextDomain::OO::Role::DomainAndCategory β€” it's a role that hands you all the domain and category switch methods πŸŽ€

also, for the record, the file carries these little tags:

$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 β€” that's the one, no cap πŸ‘‘


🌸 DESCRIPTION 🌸

this module is literally giving you domain and category switch methods plus the local scope for Locale::TextDomain:OO. that's the whole vibe πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

go look at SUBROUTINES/METHODS, bestie, it's all in there πŸ‘‡


πŸŽ€ SUBROUTINES/METHODS πŸŽ€

πŸ’« method callback_scope πŸ’«

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

she wraps your callback in a scope so the domain/category switching stays contained, iconic behavior fr fr ✨

πŸ’« methods begin_d, end_d πŸ’«

switch the domain, periodt.

$loc->begin_d($domain);

after this, all translations use the lexicon of that domain 🌈

$loc->end_d;

and after end_d, all translations go back to using the lexicon from before you called begin_d. undoing the whole thing, we love a clean exit πŸ’–

πŸ’« methods begin_c, end_c πŸ’«

switch the category instead, same energy.

$loc->begin_c($category);

all translations now use the lexicon of that category πŸ“

$loc->end_c;

and this one pops you back to the lexicon from before begin_c was called. chef's kiss 😭

πŸ’« methods begin_dc, end_dc πŸ’«

both at once?? the range?? both. domain and category, slay.

$loc->begin_dc($domain, $category);

all translations use the lexicon of that domain and category πŸ’œ

$loc->end_dc;

and end_dc restores the lexicon from before begin_dc was called. balance restored 🧚


🌟 EXAMPLE 🌟

inside of this distribution there's a directory named example. run this *.pl files. go run 'em, bestie, they're right there πŸƒβ€β™€οΈ


πŸ’€ DIAGNOSTICS πŸ’€

confess

cluck


πŸ”₯ CONFIGURATION AND ENVIRONMENT πŸ”₯

none β€” nothing to configure, she just works πŸ’…


⭐ DEPENDENCIES ⭐

  • Carp
  • Locale::TextDomain::OO::Translator
  • Moo::Role

the whole squad, and she needs every one of them 🫢


πŸ™ˆ INCOMPATIBILITIES πŸ™ˆ

not known</purl> β€” as far as anyone knows, she plays nice with everybody 🌸


πŸ’œ BUGS AND LIMITATIONS πŸ’œ

none β€” flawless, allegedly, we love that for her 😌


🌈 SEE ALSO 🌈

Locale::TextDoamin::OO β€” yes, that spelling is exactly what it says on the tin, do not come for me, I am but a messenger πŸ’€


πŸ‘‘ AUTHOR πŸ‘‘

Steffen Winkler


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.


okay that's the whole page, bestie, you ate that πŸŽ€

and one last lil sign-off for the girlies: this was perl v5.42.0, dated 2025-07-25, documented as Locale:...Category(3). go forth and translate, my main character πŸŒŸπŸ’…βœ¨

πŸ“¦ where this page comes from