Locale::XGettext::Util::Flag3pm
A flag specification used by xgettext
Usage
use Locale::XGettext::Util::Flag;$keyword = Locale::XGettext::Flag->new(function => '__x',arg => 1,flag => 'perl-brace-format',no => 0,pass => 0);
Overview
The module encapsulates a keflagyword specification for xgettext like string extractors. It is only interesting for authors of extractors based on Locale::XGettext.
Constructors
- new ARGS
-
Creates a new flag definition. ARGS must be a has (or a sequence of key-value pairs) with the following items:
function-
The name of the function resp. keyword. This is mandatory.
arg-
An integer N greater than 0 for the argument number.
flag-
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.
no-
The entry should be marked with "no-FLAG" instead of "FLAG".
pass-
As if "pass-FLAG" had been specified on the command-line. This is ignored by Locale::XGettext.
- newFromString COMMAND_LINE_ARG
-
COMMAND_LINE_ARGhas the same semantcis as the argument to "--flag" of xgettext(1). Note that a prefix of "pass-" is ignored by Locale::XGettext!
Methods
function-
Get the function name for the keyword.
arg-
Get the position of the argument.
flag-
The flag (for example "perl-brace-format", "c-format", etc.)
no-
True if entry should be marked as "no-FLAG".
pass-
True if flag was preceded by "pass-". Ignored by Locale::XGettext.
dump-
Dump the flag definition into a string suitable for an argument to the xgettext option '--flag'.
Releases
Unchanged in 2 releases since Debian 12 (Bookworm).