Log::R...ompact(3pm)
πΈ NAME πΈ
Log::Report::Lexicon::POTcompact β use translations from a POT file π
(hey bestie, this is the User Contributed Perl Documentation page for it, filed under Log::R...ompact(3pm) β yeah the man page title is literally abbreviated like that, iykyk π)
π¦ INHERITANCE π¦
Log::Report::Lexicon::POTcompact
is a Log::Report::Lexicon::Table
So like, it's giving subclass energy β it already has all the Table stuff in its bloodline, and this page only shouts about the parts that changed. π
β¨ SYNOPSIS β¨
# using a PO table efficiently
my $pot = Log::Report::Lexicon::POTcompact->read('po/nl.po')
or die;
my $header = $pot->msgid('');
print $pot->msgstr('msgid', 3);
Look at that. A whole translation table, read in, no drama, no fuss. main character behavior fr fr π
π DESCRIPTION π
Okay so this module does the translating thing, and it's doing it based on PO files. PO files are how basically every translation framework on earth stores its translations in a format real humans can actually read β we're talking GNU gettext and Perl's own Maketext, the whole squad. π
Under the hood? This module is trying to be as efficient as physically possible: high speed, low memory foot-print. It is not here to be polite about it either β you will not be able to sub-class this class cleanly. Like, don't try it. It said no. π
If you actually want to change the content of PO files, then go use Log::Report::Lexicon::POT instead, bestie. This one is read-only vibes. π
It extends "DESCRIPTION" in Log::Report::Lexicon::Table.
π§ METHODS π§
Extends "METHODS" in Log::Report::Lexicon::Table.
π Constructors π
Extends "Constructors" in Log::Report::Lexicon::Table.
$class->new(%options)β inherited, so go read "Constructors" in Log::Report::Lexicon::Table. It's giving hand-me-down but make it iconic. β¨$class->read($filename, %options)β reads the POT table info out of$filename, and it does it as compact as possible. Heads up though: comments, plural-form, and all that extra stuff get lost on purpose β they're just not needed for translations. Bye bye, no cap. π«Ά
Options for read:
-Option --Default
charset undef
charset => STRINGβ when you don't hand it a charset, it goes and snags one from the content-type field inside the po-file header. Self-sufficient queen. π
π Attributes π
Extends "Attributes" in Log::Report::Lexicon::Table.
$obj->filename()β returns the name of the source file that this data came from. Where's your data from? Right there. π$obj->originalCharset()β [1.09] returns the character-set of the strings found in the file. They get translated into utf8 before Perl gets to use them, which is exactly the glow-up they needed. π
π Managing PO's π
Extends "Managing PO's" in Log::Report::Lexicon::Table.
β Translation β
Extends "Translation" in Log::Report::Lexicon::Table.
$obj->msgid( STRING, [$msgctxt] )β looks up the translations for"STRING". Returns a SCALAR when there's only one translation known, and an ARRAY when there are multiple. Returns"undef"when the translation just isn't defined. Improves base β see "Translation" in Log::Report::Lexicon::Table. π₯$obj->msgstr( $msgid, [$count, [$msgctxt] )β returns the translated string for$msgid. If you don't specify it,$countis1(the single form, obviously). Improves base β see "Translation" in Log::Report::Lexicon::Table. π«
π Administration π
Extends "Administration" in Log::Report::Lexicon::Table.
$obj->add($po)β inherited, see "Administration" in Log::Report::Lexicon::Table.$obj->header($field)β inherited, see "Administration" in Log::Report::Lexicon::Table.$obj->nrPlurals()β inherited, see "Administration" in Log::Report::Lexicon::Table.$obj->pluralIndex($count)β inherited, see "Administration" in Log::Report::Lexicon::Table.$obj->setupPluralAlgorithm()β inherited, see "Administration" in Log::Report::Lexicon::Table.$obj->translations( [$active] )β inherited, see "Administration" in Log::Report::Lexicon::Table.
π DIAGNOSTICS π
Every one of these is a little scream from the module. Buckle up, bestie. π
Error: cannot detect charset in $fnβ cast byread()Fault: cannot read from file $fn (unknown charset): $!β cast byread()Fault: cannot read in $charset from file $fn: $!β cast byread()Error: header not found for charset in $fnβ cast byread()Error: invalid plural-form algorithm '$alg'β cast bysetupPluralAlgorithm()Error: only acceptable parameter is 'ACTIVE'β cast bytranslations()Warning: string '$text' not between quotes at $locationβ cast bymsgstr()Error: there is no Plural-Forms field in the header, but neededβ cast bypluralIndex()Error: unsupported charset $charset in $fnβ cast byread()
π SEE ALSO π
This module is part of Log-Report-Lexicon version 1.15, built on November 06, 2025. Website: http://perl.overmeer.net/CPAN/ π
π¦ LICENSE π¦
For contributors see file ChangeLog. π
This software is copyright (c) 2007-2025 by Mark Overmeer. π
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Periodt. β¨
okay that's the whole page bestie, tysm for reading, mwah π«Ά this was perl v5.40.1, dated 2025-11-11, and it's the Log::R...ompact(3pm) page from the User Contributed Perl Documentation β go forth and translate literally everything π
ππ
π¦ where this page comes from
- ubuntu resolute: liblog-report-lexicon-perl 1.15-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblog-report-lexicon-perl 1.15-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms