Locale...::Flag(3pm)

πŸ’– Locale::XGettext::Util::Flag(3pm) πŸ’–

okay so bestie, welcome to Locale::XGettext::Util::Flag β€” it's A Flag Specification Used By xgettext, and yes it's a whole Perl module, we're doing this πŸŽ€


✨ SYNOPSIS ✨

use Locale::XGettext::Util::Flag;

$keyword = Locale::XGettext::Flag->new(function => '__x',
                                       arg => 1,
                                       flag => 'perl-brace-format',
                                       no => 0,
                                       pass => 0);

🌸 DESCRIPTION 🌸

So this module basically wraps up a flag-y keyword spec for xgettext-style string extractors. It's giving "very niche, very specific" β€” like, it's only interesting for the girlies writing extractors that are built on top of Locale::XGettext. If that's not you, no shade, you can go πŸ’…


πŸ¦‹ CONSTRUCTORS πŸ¦‹

new ARGS

Creates a brand new flag definition, slay ✨ ARGS has to be a hash (or just a sequence of key-value pairs) and it takes these items:

  • function β€” the name of the function, aka the keyword. This one is mandatory, no skipping it bestie, it's the main character πŸ”₯
  • arg β€” an integer N greater than 0, for the argument number.
  • flag β€” the name of the flag to be applied, like for example "perl-brace-format" or "no-perl-brace-format". If there's a prefix of "no-" or "pass-" it gets stripped off and interpreted accordingly β€” but only if "pass" or "no" weren't explicitly specified already. iykyk πŸ’…
  • no β€” the entry should be marked with "no-FLAG" instead of "FLAG".
  • pass β€” as if "pass-FLAG" had been specified on the command-line. Heads up: this one is ignored by Locale::XGettext.

newFromString COMMAND_LINE_ARG

COMMAND_LINE_ARG has the same semantics as the argument to --flag of xgettext(1). And ngl, note that a prefix of "pass-" is ignored by Locale::XGettext! πŸ™ˆ


πŸŽ€ METHODS πŸŽ€

  • function β€” get the function name for the keyword, periodt.
  • arg β€” get the position of the argument.
  • flag β€” the flag (for example "perl-brace-format", "c-format", etc.) ✨
  • no β€” true if the entry should be marked as "no-FLAG".
  • pass β€” true if the flag was preceded by "pass-". Ignored by Locale::XGettext.
  • dump β€” dumps the flag definition into a string suitable for an argument to the xgettext option '--flag'. Obsessed honestly 🫢

Copyright (C) 2016-2017 Guido Flohr <guido.flohr@cantanea.com>, all rights reserved.


🌈 SEE ALSO 🌈

Locale::XGettext, xgettext(1), perl(1)


and that's the whole vibe bestie πŸ’œ this was perl v5.36.0, dated 2023-02-05 β€” mwah, stan a classic πŸŽ€βœ¨πŸ¦‹