DOKK / manpages / debian 12 / liblocale-xgettext-perl / Locale::XGettext::Util::Flag.3pm.en
Locale::XGettext::Util::Flag(3pm) User Contributed Perl Documentation Locale::XGettext::Util::Flag(3pm)

Locale::XGettext::Util::Flag - A Flag Specification Used By xgettext

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

The module encapsulates a keflagyword specification for xgettext like string extractors. It is only interesting for authors of extractors based on Locale::XGettext.

Creates a new flag definition. ARGS must be a has (or a sequence of key-value pairs) with the following items:
The name of the function resp. keyword. This is mandatory.
An integer N greater than 0 for the argument number.
The name of the flag to be applied, for example "perl-brace-format" or "no-perl-brace-format". A possible prefix of "no-" or "pass-" is stripped off and interpreted accordingly but only if "pass" or "no" were not explicitly specified.
The entry should be marked with "no-FLAG" instead of "FLAG".
As if "pass-FLAG" had been specified on the command-line. This is ignored by Locale::XGettext.
COMMAND_LINE_ARG has the same semantcis as the argument to "--flag" of xgettext(1). Note that a prefix of "pass-" is ignored by Locale::XGettext!

Get the function name for the keyword.
Get the position of the argument.
The flag (for example "perl-brace-format", "c-format", etc.)
True if entry should be marked as "no-FLAG".
True if flag was preceded by "pass-". Ignored by Locale::XGettext.
Dump the flag definition into a string suitable for an argument to the xgettext option '--flag'.

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

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

2023-02-05 perl v5.36.0