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.
- 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_ARG has the same semantcis as the argument to
"--flag" of xgettext(1). Note that a prefix of
"pass-" is ignored by Locale::XGettext!
- 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'.
Copyright (C) 2016-2017 Guido Flohr
<guido.flohr@cantanea.com>, all rights reserved.