Log::R...r::POT(3pm)

πŸ’– Log::Report::Translator::POT β€” the manual page, but make it cute πŸ’–

okay bestie, so this is a Perl manpage (3pm, user-contributed Perl documentation, iykyk) for a module called Log::Report::Translator::POT and honestly? she's giving translation, she's giving efficiency, she's giving iconic. Let's get into it. πŸ¦‹


✨ NAME ✨

Log::Report::Translator::POT β€” translation based on POT files. that's it, that's the whole vibe. 🌸


πŸŽ€ INHERITANCE πŸŽ€

Log::Report::Translator::POT is a Log::Report::Translator. she's the daughter of a legend, no cap. πŸ’…


✨ SYNOPSIS ✨

here's the tea, internally it looks like this:

# internal use
my $msg = Log::Report::Message->new(
      _msgid  => "Hello World\n",
  _domain => 'my-domain',
);

print Log::Report::Translator::POT
   ->new(lexicons => $dir)
   ->translate($msg, 'nl-BE');

and for the normal use, aka what the end-user actually watches happen in the program's ::main:

# normal use (end-users view in the program's ::main)
textdomain 'my-domain',
  translator =>  Log::Report::Translator::POT->new(lexicon => $dir);
print __"Hello World\n";

look at her go. periodt. πŸ‘‘


πŸ’œ DESCRIPTION πŸ’œ

So the whole point: she translates a message by directly accessing POT files. ✨ The files load lazily (unless forced β€” rude of you to force her, but okay). She peeks into the PO's in a compact way, using Log::Report::Lexicon::POTcompact, which is much more efficient than Log::Report::Lexicon::PO. two queens but only one is on the fast track fr fr.

She extends "DESCRIPTION" in Log::Report::Translator. πŸ’–


πŸ¦‹ METHODS πŸ¦‹

She extends "METHODS" in Log::Report::Translator. yeah, she's got range.

🌸 Constructors 🌸

Extends "Constructors" in Log::Report::Translator.

$class->new(%options)

here's the options menu, bestie:

  • charset β€” default is <C<undef>>
  • lexicons β€” default is <see text>

now the details, one by one:

  • charset => STRING β€” Enforces the character set for files. By default she reads the character-set as defined in the header of each PO file. minding her own business, reading headers, being respectful. 🫢
  • lexicons => DIRECTORY β€” The DIRECTORY where the translations can be found. Check Log::Report::Lexicon::Index for the expected structure of such a DIRECTORY, okay? πŸ‘€

The default is based on the location of the module which instantiates this translator. The filename of the module is stripped from its ".pm" extension, and used as directory name. Within that directory, there must be a directory named "messages", which will be the root directory of a Log::Report::Lexicon::Index. she's mapping her own little world out here, cute.

Β» example: default lexicon directory πŸŽ€
# file xxx/perl5.8.8/My/Module.pm
use Log::Report 'my-domain',
  translator => Log::Report::Translator::POT->new;

# lexicon now in xxx/perl5.8.8/My/Module/messages/

✨ Accessors ✨

Extends "Accessors" in Log::Report::Translator.

  • $obj->charset() β€” Returns the default charset, which can be overrule by the locale. the locale said "let me handle this one" and honestly? respect. πŸ’…
  • $obj->lexicons() β€” Returns a list of Log::Report::Lexicon::Index objects, where the translation files may be located. a little lineup of where the magic might be. 🌈

🧚 Translating 🧚

Extends "Translating" in Log::Report::Translator.

  • $obj->load($domain, $locale) β€” Inherited, see "Translating" in Log::Report::Translator. she didn't write this one, she inherited it like the main character she is. πŸ’–
  • $obj->translate($msg, $lang, $context) β€” Inherited, see "Translating" in Log::Report::Translator. same energy, same delegation. go look at the parent.

πŸ’€ DIAGNOSTICS πŸ’€

(she will in fact be telling you things, listen up)

  • Error: You have to upgrade Log::Report::Lexicon to at least 1.00 β€” Cast by new(). bestie your version is old old. upgrade, fr. 😭
  • Info: read table $filename as $class for $dname in $locale β€” Cast by translate(). just a lil headsup, no drama. 🌸
  • Error: unknown translation table extension '$ext' in $filename β€” Cast by translate(). she does not recognize that extension and she will be saying so. screaming, crying, throwing up. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

This module is part of Log-Report-Lexicon version 1.15, built on November 06, 2025. Website: http://perl.overmeer.net/CPAN/ β€” go say hi, she's famous. ✨


🌈 LICENSE 🌈

For contributors see file ChangeLog. (yes, go look, the lore is in there πŸ’œ)

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. free as in slay, periodt. πŸ’–


and that's a wrap on this Log::Report::Translator::POT(3pm) page πŸŽ€ β€” this beauty ships with perl v5.40.1, dated 2025-11-11. go forth, translate, be iconic. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from