Locale:...in::Perl(3)

πŸ’… Locale:...in::Perl(3) β€” the Perl format parser, bestie

okay so real quick, this is a page from the User Contributed Perl Documentation collection β€” it's Locale::Maketext::Extract::Plugin::Perl, and it's the little plugin that scrapes translatable strings out of Perl code. she's fast, she's cute, she's slightly imperfect. let's get into it πŸŽ€


✨ NAME ✨

Locale::Maketext::Extract::Plugin::Perl β€” literally just the Perl format parser. that's her whole job. πŸ¦‹


🌸 VERSION 🌸

version 1.00


⭐ SYNOPSIS ⭐

$plugin = Locale::Maketext::Extract::Plugin::Perl->new(
    $lexicon            # A Locale::Maketext::Extract object
    @file_types         # Optionally specify a list of recognised file types
)

$plugin->extract($filename,$filecontents);

so you hand her a $lexicon (that's a Locale::Maketext::Extract object, no discussion needed) and optionally a list of recognised file types in @file_types, and then you hit her with $plugin->extract($filename,$filecontents); and she does the thing. slay. ✨


πŸ’– DESCRIPTION πŸ’–

she extracts strings to localise (including HEREDOCS and concatenated strings, yes ma'am, she catches those too 🫢) from Perl code.

now. let's talk about it. this Perl parser is very fast and very good, but not perfect β€” it does make mistakes. like, she's giving main character energy but she's not omniscient.

the PPI parser (Locale::Maketext::Extract::Plugin::PPI) is more accurate, but a lot slower β€” which is exactly why it's not enabled by default. trade-offs, bestie. πŸ’…


πŸŽ€ SHORT PLUGIN NAME πŸŽ€

perl

that's it. that's the name. iconic. πŸ‘‘


🌈 VALID FORMATS 🌈

these are the localization function names she recognises, fr fr:

  • translate
  • maketext
  • gettext
  • l
  • loc
  • x
  • _
  • __

(and yes, _ and __ are two separate things, don't come for me 😭)


πŸ¦‹ KNOWN FILE TYPES πŸ¦‹

  • .pm
  • .pl
  • .cgi

that's the whole guest list. πŸ“


πŸ”₯ SEE ALSO πŸ”₯

  • xgettext.pl β€” for extracting translatable strings from common template systems and perl source files. she's the one you actually call, iykyk.
  • Locale::Maketext::Lexicon
  • Locale::Maketext::Extract::Plugin::Base
  • Locale::Maketext::Extract::Plugin::PPI
  • Locale::Maketext::Extract::Plugin::FormFu
  • Locale::Maketext::Extract::Plugin::TT2
  • Locale::Maketext::Extract::Plugin::YAML
  • Locale::Maketext::Extract::Plugin::Mason
  • Locale::Maketext::Extract::Plugin::TextTemplate
  • Locale::Maketext::Extract::Plugin::Generic

πŸ’œ AUTHORS πŸ’œ

Audrey Tang <cpan@audreyt.org>


Copyright 2002-2013 by Audrey Tang <cpan@audreyt.org>.

This software is released under the MIT license cited below. and here's the whole thing, verbatim, because legal text does not get to be summarised, bestie πŸ’€


πŸ“œ The "MIT" License πŸ“œ

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

like, all caps for a whole paragraph? she's shouting but she's legally required to shout. respect. πŸ™ˆ

πŸ‘‘ AUTHORS πŸ‘‘

  • Clinton Gormley <drtech@cpan.org>
  • Audrey Tang <cpan@audreyt.org>

yes, there are two AUTHORS sections on this page. no, i will not be merging them. continuity is the vibe check. ✨


This software is Copyright (c) 2014 by Audrey Tang.

This is free software, licensed under:

The MIT (X11) License

and that's the whole page, bestie. this cutie came to you courtesy of perl v5.40.2, dated 2025-01-03 β€” go forth and localise literally everything πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from