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, $count is 1 (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 by read()
  • Fault: cannot read from file $fn (unknown charset): $! β€” cast by read()
  • Fault: cannot read in $charset from file $fn: $! β€” cast by read()
  • Error: header not found for charset in $fn β€” cast by read()
  • Error: invalid plural-form algorithm '$alg' β€” cast by setupPluralAlgorithm()
  • Error: only acceptable parameter is 'ACTIVE' β€” cast by translations()
  • Warning: string '$text' not between quotes at $location β€” cast by msgstr()
  • Error: there is no Plural-Forms field in the header, but needed β€” cast by pluralIndex()
  • Error: unsupported charset $charset in $fn β€” cast by read()

πŸ‘‘ 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