Log::R...xtract(3pm)

πŸ’– Log::R...xtract(3pm) πŸ’–

okay bestie, welcome to the Log::R...xtract(3pm) manual page β€” straight out of the User Contributed Perl Documentation vault ✨. It's a Perl module and it's lowkey a whole vibe if you're into translation tooling, which you're about to be 🫢


🌸 NAME 🌸

Log::Report::Extract β€” collecting translatable strings, one message-id at a time πŸ’…


πŸ¦‹ INHERITANCE πŸ¦‹

Log::Report::Extract gets extended by these iconic children:

  • Log::Report::Extract::PerlPPI
  • Log::Report::Template::Extract

like it's giving proud parent energy fr fr πŸ‘‘


✨ SYNOPSIS ✨

# See the extensions

that's it, that's the synopsis. the extensions said "iykyk" πŸ™ˆ


πŸ’œ DESCRIPTION πŸ’œ

so here's the tea, bestie πŸ“: this module is the one that helps you maintain your POT files β€” aka it keeps that list of message-ids inside them all fresh and up to date ✨.

after initiation, you gotta call the process() method with literally every file that changed since the last time you processed. once you do that, the existing PO files get updated accordingly, no cap πŸ”₯.

and if there are no translations yet? don't even stress β€” one textdomain/xx.po file will be created for you πŸ’… iconic behavior honestly.


πŸŽ€ METHODS πŸŽ€

🌈 Constructors

$class->new(%options)

here's the options table, vibe check it:

  • Option β€” Default
  • charset β€” 'utf-8'
  • lexicon β€” <required>
  • charset => STRING β€” the character-set used in the PO files ✨
  • lexicon => DIRECTORY β€” the place where the lexicon is kept. and when no lexicon is defined yet, THIS is the directory where a domain/xx.po file will be created 🫢

🌸 Accessors

  • $obj->addPot($domain, $pot, %options) β€” adds a POT, bestie πŸ’–
  • $obj->charset() β€” returns the character-set that's used inside the POT files ✨
  • $obj->domains() β€” returns a sorted list of all known domain names πŸ—‚οΈ
  • $obj->index() β€” returns the Log::Report::Lexicon::Index object, which is the one listing the files in the lexicon directory tree 🌳
  • $obj->pots($domain) β€” returns the list of Log::Report::Lexicon::POT objects which contain the tables for $domain πŸ‘‘

🧚 Processors

  • $obj->cleanup(%options) β€” remove all references. like, all of them 🧹

here's the options table:

  • Option β€” Default
  • keep β€” []
  • keep => HASH|ARRAY β€” keep the information about these filename, either specified as an ARRAY of names, or a HASH where the keys are the named πŸ‘€
  • $obj->process($filename, %options) β€” update the domains mentioned in $filename. all text-domains defined in the file will get updated automatically, but heads up bestie ⚠️: they should not be written before all files are processed. what you get back is the number of messages found in this particular file πŸ”’
  • $obj->showStats([$domains]) β€” show a status about the DOMAIN (and by default, all domains). at least mode verbose is required to see this, so don't come crying if it's quiet 😭

the statistics are sent to (Log::Report) dispatchers which accept notice and info. this could be syslog πŸ‘Ύ. and when you have no explicit dispatchers in your program, the level of detail gets controlled by the 'mode':

use Log::Report mode => 'DEBUG';  # or 'VERBOSE'
  • $obj->store( $domain, $filename, $linenr, $context, $msg, [$msg_plural] ) β€” register the existence of a ($msg, $msg_plural) in all POTs of the $domain πŸ“
  • $obj->write( [$domain], %options ) β€” update the information of the files related to $domain, and by default that means all processed DOMAINS πŸ’…

all information known about the written $domain is removed from the cache (poof πŸ’¨). and the %options get passed straight to the write() of the specific lexicon manager 🫢


πŸ’€ DIAGNOSTICS πŸ’€

  • Fault: cannot create lexicon directory $dir: $!

Cast by new()

  • Error: extractions require an explicit lexicon directory

Cast by new()

  • Error: no context tags allowed in plural `$msgid'

Cast by store()

  • Info: starting new textdomain $domain, template in $filename

Cast by write()


πŸ‘‘ 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 β€” slay, go forth and redistribute periodt πŸ’…


and that's a wrap, bestie πŸ¦‹ this little edition ran on perl v5.40.1, dated 2025-11-11, and you read the Log::R...xtract(3pm) page top to bottom like a true main character πŸ‘‘πŸ’– mwah, go collect those strings ✨

πŸ“¦ where this page comes from