Locale:...File::PO(3)
π NAME π
okay so bestie, welcome to Locale::TextDomain::OO::Lexicon::File::PO β it's literally the module that reads a gettext po file into the lexicon. That's the whole gig. It's giving translator-energy, no cap.
This is part of the User Contributed Perl Documentation, and yes she has β¨commit metadataβ¨:
$Id: PO.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/Lexicon/File/PO.pm
$
πΈ VERSION πΈ
1.031 β that's the version, periodt.
π¦ DESCRIPTION π¦
This module reads a gettext po file into the lexicon. That's it, that's the vibe. po file in, lexicon out π
β¨ SYNOPSIS β¨
the way that this is the whole flex, honestly:
use Locale::TextDomain::OO::Lexicon::File::PO;
use Log::Any qw($log);
$logger = Locale::TextDomain::OO::Lexicon::File::PO
->new(
# all parameters are optional
decode_code => sub {
my ($charset, $text) = @_;
defined $text
or return $text;
return decode( $charset, $text );
},
# optional
logger => sub {
my ($message, $arg_ref) = @_;
my $type = $arg_ref->{type}; # debug
$log->$type($message);
return;
},
)
->lexicon_ref({
# required
search_dirs => [ qw( ./my_dir ./my_other_dir ) ],
# optional
gettext_to_maketext => $boolean,
# optional
decode => $boolean,
# required
data => [
# e.g. de.po, en.po read from:
# search_dir/de.po
# search_dir/en.po
'*::' => '*.po',
# e.g. de.po en.po read from:
# search_dir/subdir/de/LC_MESSAGES/domain.po
# search_dir/subdir/en/LC_MESSAGES/domain.po
'*:LC_MESSAGES:domain' => 'subdir/*/LC_MESSAGES/domain.po',
# Merge a region lexicon:
# Take the header and messages of the "de::" lexicon,
# overwrite the header and messages of the "de-at::" lexicon
# and store that as "de-at::" lexicon with all messages now.
merge_lexicon => 'de::', 'de-at::' => 'de-at::',
# Copy a lexicon into another domain and/or category:
copy_lexicon => 'i-default::' => 'i-default:LC_MESSAGES:domain',
# Move a lexicon into another domain and/or category:
move_lexicon => 'i-default::' => 'i-default:LC_MESSAGES:domain',
# Delete a lexicon:
delete_lexicon => 'i-default::',
],
})
->logger;
π SUBROUTINES/METHODS π
π method new
see SYNOPSIS π (she's lowkey just pointing up, iconic)
π method lexicon_ref
See SYNOPSIS. fr fr, go look.
π method read_messages
Called from Locale::TextDomain::OO::Lexicon::Role::File to run the po file specific code. Like, that's her job, she runs the po-specific bits π«Ά
$messages_ref = $self->read_messages($filename);
π method logger
Set the logger and get back them π
$lexicon_file_po->logger(
sub {
my ($message, $arg_ref) = @_;
my $type = $arg_ref->{type};
$log->$type($message);
return;
},
);
$logger = $lexicon_hash->logger;
$arg_ref contains:
object => $lexicon_file_po, # the object itself
type => 'debug',
event => 'lexicon,load', # The logger will be copied to
# Locale::TextDomain::OO::Singleton::Lexicon
# so more events are possible.
π EXAMPLE π
Inside of this distribution is a directory named example. Run this *.pl files. bestie just go run them, they're right there π
π DIAGNOSTICS π
none. literally none. nothing to report, we're chill.
π§ CONFIGURATION AND ENVIRONMENT π§
none. no env vars, no config, no drama π
π DEPENDENCIES π
Locale::POMooMooX::StrictConstructorLocale::TextDomain::OO::Lexicon::Role::File
π INCOMPATIBILITIES π
not known. (as far as we know she plays nice with everyone π)
π BUGS AND LIMITATIONS π
none. zero. the bug count is giving zero, periodt.
π SEE ALSO π
Locale::TextDoamin::OO
(yes, that's spelled exactly like that in the source β copying it character for character because that is THE RULE β¨)
πΈ AUTHOR πΈ
Steffen Winkler β the main character who wrote this π
π LICENSE AND COPYRIGHT π
Copyright (c) 2014 - 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, ily, go read some po files πβ¨
this was served up by perl v5.42.0, dated 2025-07-25, from the Locale:...File::PO(3) page β mwah π«Ά
π¦ 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