Locale:...Category(3)

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

πŸ’… Locale::TextDomain::OO::Plugin::Expand::Gettext::Loc::DomainAndCategory πŸ’…

okay bestie, so this one is a module from User Contributed Perl Documentation, section 3 (the Perl library pages, iykyk), and it's literally called Locale::TextDomain::OO::Plugin::Expand::Gettext::Loc::DomainAndCategory β€” and yes she's giving full government name, we respect that 🫢. The short version: it's Methods for dynamic domain and/or category, prefixed with loc_.

Also, for the archivists in the chat πŸŽ€:

$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
$

wait, no, hold up β€” that URL is svn+ssh://steffenw@svn.code.sf.net/p/perl-gettext-oo/code/module/trunk/lib/Locale/TextDomain/OO/Plugin/Expand/Gettext/Loc/DomainAndCategory.pm, my bad, the + matters and we do NOT typo paths in this house 😭


🌸 VERSION 🌸

1.030 ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically these methods are out here switching the domain and/or category during translation process. mid-translation glow-up, no cap πŸ’…

and the author is so real for this, actual quote energy: I am not sure if that is the best way to do. Maybe that will change in future. β€” not them being humble 😭 iconic honestly, we love an honest king πŸ‘‘


⭐ 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, bestie πŸŒ€

$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, both of them, double the slay πŸ’–

$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. the round trip, the full journey ✈️

$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. both!! at once!! multitasking queen πŸ’…βœ¨

$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. go on, run them, live a little 🧚


πŸ’€ DIAGNOSTICS πŸ’€

nothing β€” not a single peep, she's silent, she's mysterious 😌


πŸ”₯ CONFIGURATION AND ENVIRONMENT πŸ”₯

none β€” zero env vars, zero config, unbothered, moisturized, in her lane πŸ’†β€β™€οΈ


🌷 DEPENDENCIES 🌷

  • Locale::Utils::PlaceholderNamed
  • Moo::Role
  • Locale::TextDomain::OO::Plugin::Expand::Gettext::Loc
  • Locale::TextDomain::OO::Role::DomainAndCategory

the whole friend group, we love a supportive squad 🫢


πŸ™ˆ INCOMPATIBILITIES πŸ™ˆ

not known β€” no drama detected, we're chill 😎


πŸ’– BUGS AND LIMITATIONS πŸ’–

none β€” she said flawless and honestly? believed it πŸ’…


🌈 SEE ALSO 🌈

Locale::TextDoamin::OO β€” yes bestie, that's spelled exactly like that in the source, Doamin, we are NOT correcting it, that's her name, periodt πŸ‘‘


✨ AUTHOR ✨

Steffen Winkler 🫑 legend behaviour


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. free as in go off, do your thing πŸ¦‹


okay and for the cute sign-off: this whole vibe is perl v5.42.0, dated 2025-07-25, and it's page Locale:...Category(3) of the manual β€” stay hydrated, read your manpages, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from