+2014-05-15 Stanislav Brabec <sbrabec@suse.cz> (tiny change)
+
+ * msgfilter.texi: Document the environment variable
+ MSGFILTER_MSGID_PLURAL and MSGFILTER_PLURAL_FORM.
+
2014-05-15 Stanislav Brabec <sbrabec@suse.cz> (tiny change)
* msgexec.texi: Document the environment variable
@vindex MSGFILTER_MSGCTXT@r{, environment variable}
@vindex MSGFILTER_MSGID@r{, environment variable}
+@vindex MSGFILTER_MSGID_PLURAL@r{, environment variable}
@vindex MSGFILTER_LOCATION@r{, environment variable}
+@vindex MSGFILTER_PLURAL_FORM@r{, environment variable}
During each @var{filter} invocation, the environment variable
@code{MSGFILTER_MSGID} is bound to the message's msgid, and the environment
variable @code{MSGFILTER_LOCATION} is bound to the location in the PO file
of the message. If the message has a context, the environment variable
@code{MSGFILTER_MSGCTXT} is bound to the message's msgctxt, otherwise it is
-unbound.
+unbound. If the message has a plural form, environment variable
+@code{MSGFILTER_MSGID_PLURAL} is bound to the message's msgid_plural and
+@code{MSGFILTER_PLURAL_FORM} is bound to the order number of the plural
+actually processed (starting with 0), otherwise both are unbound.
@subsection Input file location
+2014-05-15 Stanislav Brabec <sbrabec@suse.cz> (tiny change)
+
+ msgfilter: Implement plural support
+ * msgfilter.c (process_message): Set or unset
+ MSGFILTER_MSGID_PLURAL and MSGFILTER_PLURAL_FORM.
+
2014-05-15 Stanislav Brabec <sbrabec@suse.cz> (tiny change)
msgexec: Implement plural support
else
unsetenv ("MSGFILTER_MSGCTXT");
xsetenv ("MSGFILTER_MSGID", mp->msgid, 1);
+ if (mp->msgid_plural != NULL)
+ xsetenv ("MSGFILTER_MSGID_PLURAL", mp->msgid_plural, 1);
+ else
+ unsetenv ("MSGFILTER_MSGID_PLURAL");
location = xasprintf ("%s:%ld", mp->pos.file_name,
(long) mp->pos.line_number);
xsetenv ("MSGFILTER_LOCATION", location, 1);
char *result;
size_t length;
+ if (mp->msgid_plural != NULL)
+ {
+ char *plural_form_string = xasprintf ("%lu", k);
+
+ xsetenv ("MSGFILTER_PLURAL_FORM", plural_form_string, 1);
+ free (plural_form_string);
+ }
+ else
+ unsetenv ("MSGFILTER_PLURAL_FORM");
process_string (p, strlen (p), &result, &length);
result = (char *) xrealloc (result, length + 1);
result[length] = '\0';