Locale:...Category(3)

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

πŸ’– NAME πŸ’–

okay bestie, so this is Locale::TextDomain::OO::Plugin::Expand::BabelFish::Loc::DomainAndCategory β€” it's a Perl module (section 3 of the manual, so it's a library thing, not a command you run 🫢) and it gives you methods for dynamic domain and/or category, prefixed with loc_b. that's the whole vibe.

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


πŸ¦‹ DESCRIPTION πŸ¦‹

so these methods are switching the domain and/or category during the translation process. like, mid-translation. iconic behavior fr.

ngl tho, the author themselves says: "I am not sure if that is the best way to do. Maybe that will change in future." 😭 so like... it works, but don't build your whole personality on it, bestie.


πŸŽ€ SYNOPSIS πŸŽ€

my $loc = Locale::Text::TextDomain::OO->new(
    plugins => [ qw (
        Expand::BabelFish::Loc::DomainAndCategory
        ...
    )],
    ...
);

πŸ’… SUBROUTINES/METHODS πŸ’…

🌸 Switch methods

  • loc_begin_bd, loc_end_bd β€” these ones switch the domain.
$loc->loc_begin_bd($domain);

now all translations are using the lexicon of that domain. periodt.

$loc->loc_end_bd;

and now all translations are using the lexicon from before the call of loc_begin_bd. we rewinding, we restoring, we healing 🫢

  • loc_begin_bc, loc_end_bc β€” these ones 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. back to baseline, bestie.

  • loc_begin_bdc, loc_end_bdc β€” these ones switch the domain and category. both. at once. main character energy πŸ‘‘
$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. we return to sender, no notes πŸ’Œ

🌈 Translation methods

  • loc_bd, loc_bdp β€” switch to that domain, translate, and switch back. the whole glow-up AND the glow-down, in one move.
$translation = $loc->loc_bd('domain', 'msgid', ...);

other methods are similar extended. the domain is the 1st parameter.

  • 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. iykyk πŸ‘€

  • loc_bdc, loc_bdcp β€” switch to that domain and category, translate, and switch back both. double the switching, double the slay πŸ”₯
$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.

  • Nloc_bd, Nloc_bdp β€” none translating methods with domain 🚫🌐
  • Nloc_bc, Nloc_bcp β€” none translating methods with category πŸš«πŸ—‚οΈ
  • 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. go off, bestie, the examples are right there waiting for you πŸ’–


πŸ” DIAGNOSTICS πŸ”

nothing. literally nothing. silence. peaceful. πŸ’€


🧚 CONFIGURATION AND ENVIRONMENT 🧚

none. no env vars, no config, no drama. clean girl aesthetic.


⭐ DEPENDENCIES ⭐

  • Locale::Utils::PlaceholderBabelFish
  • Moo::Role
  • Locale::TextDomain::OO::Plugin::Expand::BabelFish::Loc
  • Locale::TextDomain::OO::Role::DomainAndCategory

these are the besties this module cannot function without. ride or die, fr fr 🫢


πŸ™ˆ INCOMPATIBILITIES πŸ™ˆ

not known. so far so good, no enemies detected πŸ‘‘


😭 BUGS AND LIMITATIONS 😭

none. flawless. (as far as we know. πŸ’…)


πŸ‘€ SEE ALSO πŸ‘€

  • Locale::TextDoamin::OO

(yes, spelled exactly like that β€” we do not fix the original, we respect the original, we copy it character for character πŸŽ€)


🌸 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.


and that's a wrap, bestie!! ✨ this page came to you from perl v5.42.0, dated 2025-07-25, straight out of the Locale:...Category(3) manual. go translate something gorgeous, mwah πŸ’–πŸ’…πŸ¦‹
πŸ“¦ where this page comes from