Locale:...Lexicon(3)
π Locale::...Lexicon(3) π
okay bestie, so this is a page from the User Contributed Perl Documentation section of the manual, and it's literally all about one lil singleton. buckle up π
$Id: Lexicon.pm 698 2017-09-28 05:21:05Z steffenw $
$HeadURL: svn+ssh://steffenw@svn.code.sf.net/p/perl-gettext-oo/code/module/trunk/lib/Locale/TextDomain/OO/Singleton/Lexicon.pm $
β¨ NAME β¨
Locale::TextDomain::OO::Singleton::Lexicon β it provides singleton lexicon access, no cap π
πΈ VERSION πΈ
1.031 β that's the vibe, that's the version π¦
π«Ά DESCRIPTION π«Ά
This module provides the singleton lexicon access for Locale::TextDomain:OO.
like. that's the whole job. it's giving "one instance to rule them all" π
π« SYNOPSIS π«
use Locale::TextDomain::OO::Singleton::Lexicon;
$lexicon_data = Locale::TextDomain::OO::Singleton::Lexicon->instance->data;
that's it, that's the entrance exam, you passed π
π§ SUBROUTINES/METHODS π§
π method new
exists but makes no sense π
like it's there, it's a real method, but bestie... it makes no sense. don't @ me, that's just what the docs say π
π method instance
see SYNOPSIS π
exists but makes no sense π
same energy fr fr β it exists, and yet. it makes no sense.
π method data
Get back the lexicon hash reference so you can fill the lexicon, or read from the lexicon. that's your whole access point, slay π
$lexicon_data = Locale::TextDomain::OO::Singleton::Lexicon->instance->data;
π method merge_lexicon
Merge ist mostly used to join data of a language to create data for a region with some region different data. (yes, "ist" β we're keeping the author's energy exactly as-is π)
The example means: Take 'de::' and overwrite with specials of 'de-at::' and store as 'de-at::'.
$instance->merge_lexicon('de::', 'de-at::', 'de-at::');
Maybe more clear writing:
$instance->merge_lexicon('de::', 'de-at::' => 'de-at::');
π method copy_lexicon
Copy a lexicon is a special case. It is like merge without the 2nd parameter.
$instance->copy_lexicon('i-default::', 'i-default:LC_MESSAGES:domain');
Maybe more clear writing:
$instance->copy_lexicon('i-default::' => 'i-default:LC_MESSAGES:domain');
π method move_lexicon
Move is typical used to move the "i-default::" lexicon into your domain and category. Using a lexicon without messages you are able to translate because the header with plural forms is set. With no lexicon you would get a missing "plural forms"-error during translation. β οΈ
$instance->move_lexicon('i-default::', 'i-default:LC_MESSAGES:domain');
Maybe more clear writing:
$instance->move_lexicon('i-default::' => 'i-default:LC_MESSAGES:domain');
π method delete_lexicon
Delete a lexicon from data. gone. poof. bye bestie π
$deleted_lexicon = $instance->delete_lexicon('de::');
π method logger
Set the logger and get back them π
$lexicon_hash->logger(
sub {
my ($message, $arg_ref) = @_;
my $type = $arg_ref->{type};
$log->$type($message);
return;
},
);
$logger = $lexicon_hash->logger;
$arg_ref contains
object => $lexicon_hash, # the object itself
type => 'debug',
event => 'lexicon,merge', # or 'lexicon,copy'
# or 'lexicon,move'
# or 'lexicon,delete'
π EXAMPLE π
Inside of this distribution is a directory named example. Run this *.pl files. β¨
π₯ DIAGNOSTICS π₯
confess
π CONFIGURATION AND ENVIRONMENT π
none β literally nothing, no environment variables, no config, we keep it clean π§Ό
π DEPENDENCIES π
CarpMooMooX::StrictConstructornamespace::autocleanLocale::TextDomain::OO::Role::LoggerMooX::Singleton
π INCOMPATIBILITIES π
not known β as far as anyone knows, we're compatible with the whole universe π
π BUGS AND LIMITATIONS π
none
π¦ SEE ALSO π¦
Locale::TextDoamin::OO
(yes, spelled exactly like that β TextDoamin. keeping it character for character because that's the assignment π)
π AUTHOR π
Steffen Winkler
π LICENSE AND COPYRIGHT π
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.
okay that's the whole page bestie, you ate it up π«Ά this was perl v5.42.0, dated 2025-07-25, and that's the Locale:...Lexicon(3) manual page from the User Contributed Perl Documentation β periodt π
β¨
π¦ 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