Locale:...eFilter(3)
π Locale::TextDomain::OO::Lexicon::Role::StoreFilter β the vibe β¨
okay bestie, this is a page from the User Contributed Perl Documentation for the module Locale::TextDomain::OO::Lexicon::Role::StoreFilter, and it's literally a filter that sifts the lexicon data before it gets stored. no cap.
$Id: StoreFilter.pm 573 2015-02-07 20:59:51Z steffenw $
$HeadURL:
svn+ssh://steffenw@svn.code.sf.net/p/perl-gettext-oo/code/module/trunk/lib/Locale/TextDomain/OO/Lexicon/Role/StoreFilter.pm
π VERSION π
1.017
β¨ DESCRIPTION β¨
This module filters the lexicon data before stored. it's giving bouncer at the club door but for lexicon data π
The idea is: Not all parts of lexicon are used by other programming languages. (not every language needs every lil crumb of the lexicon, and that's okay!)
Implements attributes filter_language, filter_category, filter_domain and filter_project. There it is possible to store undef for ignore filter, a string to check equal, a regex reference to match or a code reference to do some more complicate things. so basically you have four whole ways to flex on the filtering: ignore it, match it exactly, regex it, or go full main-character with a sub π«Ά
That filter removes also the key plural_code from header. That is an already prepared Perl code reference to calculate what plural form should used. The other language has to create the code again from key header key plural. That contains that pseudo code from po/mo file without ";" and/or "\n" at the end.
π¨ heads up bestie:plural_codegets yeeted out of the header by this filter. it's a Perl code ref that was already prepped to figure out which plural form to use. other languages gotta rebuild that code themselves from the header keyplural, which holds the pseudo code straight from the po/mo file β minus any trailing";"and/or"\n".
π SYNOPSIS π
with qw(
Locale::TextDomain::OO::Lexicon::Role::StoreFilter
);
Usage of that optional filter
use Locale::TextDomain::OO::Lexicon::Store...;
my $obj = Locale::TextDomain::OO::Lexicon::Store...->new(
...
# all parameters optional
filter_language => undef,
filter_category => 'cat1',
filter_domain => qr{ \A dom }xms,
filter_project => sub {
my $filter_name = shift; # $filter_name eq 'filter_project'
return $_ eq 'my project'; # $_ contains the value
},
);
$obj->copy;
$obj->clear_filter;
$obj->filter_language('en');
$obj->remove;
$obj->to_...;
see how it's all optional? the params are just there if you want them, queen π
π¦ SUBROUTINES/METHODS π¦
method filter_language, filter_category, filter_domain, filter_project
Set a filter as undef, string, regex or code reference. that's the whole menu β pick your fighter β
method clear_filter
Set filter_language, filter_category, filter_domain, filter_project to undef.
$obj->clear_filter;
method copy
Copies lexicon entries with matching filter from singleton lexicon to data (new lexicon).
$obj->copy;
method remove
Removes lexicon entries with matching filter from data (new lexicon).
$obj->remove;
method data
Get back that filtered lexicon data. it's yours, you earned it π
$data = $obj->data;
πΈ EXAMPLE πΈ
Inside of this distribution is a directory named example. Run this *.pl files.
π§ go on, run them, they don't bite (probably)
π DIAGNOSTICS π
none
π CONFIGURATION AND ENVIRONMENT π
none
π DEPENDENCIES π
CarpCloneLocale::TextDomain::OO::Singleton::LexiconLocale::TextDomain::OO::Util::JoinSplitLexiconKeysMoo::RoleMooX::Types::MooseLike::Basenamespace::autoclean
that's the whole squad, no extras, no surprise guests π
π INCOMPATIBILITIES π
not known
π BUGS AND LIMITATIONS π
none
π₯ SEE ALSO π₯
Locale::TextDoamin::OO
β (yes we're spelling it exactly like the original, no editing the lore, that's the rule periodt)
π AUTHOR π
Steffen Winkler
π LICENSE AND COPYRIGHT π
Copyright (c) 2013 - 2015, 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 the whole page bestie π«Ά this lil icon came from perl v5.42.0, dated 2025-07-25 β and yes, Locale:...eFilter(3) is still out here living its best life in the manual. iykyk β¨π
π¦ where this page comes from
- fedora 43: perl-Locale-TextDomain-OO 1.036-19.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms