=head1 NAME

Locale::XGettext::Util::Keyword - A Keyword Used By xgettext

=head1 SYNOPSIS

    use Locale::XGettext::Util::Keyword;

    $keyword = Locale::XGettext::Keyword->new('npcgettext',
                                              '1c', 2, 3,
                                              '"Plural form"');
    $keyword = Locale::XGettext::Keyword->newFromString('npcgettext:1c,2,3,"Plural form"');

Flags are not yet supported.

=head1 DESCRIPTION

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

=head1 CONSTRUCTORS

=over 4

=item B<new FUNCTION[, ARGSPEC ...]>

Creates a new keyword for FUNCTION B<FUNCTION>.  Without B<ARGSPEC> it is assumed
that the singular form is the first argument.

B<ARGSPEC> can be one of the following:

=over 8

=item B<N>

An integer B<N> greater than 0.  The first one encountered specifies the 
position of the singular form, the second one the position of the plural 
form.

=item B<Nc>

An integer B<N> greater than 0 followed by the character "c".  B<N> specifies
the position of the message context argument.

=item B<"COMMENT">

Every PO entry for this keyword should get the automatic comment 
B<COMMENT>.  Note that the surroudning "double quotes" are required!

=back

=item B<newFromString COMMAND_LINE_ARG>

B<COMMAND_LINE_ARG> has the same semantcis as the argument to
"--keyword" of L<xgettext(1)>.

=back

=head1 METHODS

=over 4

=item B<function>

Get the function name of the keyword.

=item B<singular>

Get the position of the argument for the singular form.

=item B<plural>

Get the position of the argument for the plural form or 0 if there is no
plural form.

=item B<context>

Get the position of the argument for the plural form or 0 if there is no
plural form.

=item B<comment>

The automatic comment for this keyword or the undefined value.

=item B<dump>

Dump the keyword definition into a string suitable for an argument
to the xgettext option '--keyword'.

=back

=head1 COPYRIGHT

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

=head1 SEE ALSO

L<Locale::XGettext>, L<xgettext(1)>, L<perl(1)>