+2014-05-31 Daiki Ueno <ueno@gnu.org>
+
+ * msgfilter.texi: Document the environment variable
+ MSGFILTER_PREV_MSGCTXT, MSGFILTER_PREV_MSGID, and
+ MSGFILTER_PREV_MSGID_PLURAL.
+
2014-05-15 Stanislav Brabec <sbrabec@suse.cz> (tiny change)
* msgfilter.texi: Document the environment variable
@vindex MSGFILTER_MSGID_PLURAL@r{, environment variable}
@vindex MSGFILTER_LOCATION@r{, environment variable}
@vindex MSGFILTER_PLURAL_FORM@r{, environment variable}
+@vindex MSGFILTER_PREV_MSGCTXT@r{, environment variable}
+@vindex MSGFILTER_PREV_MSGID@r{, environment variable}
+@vindex MSGFILTER_PREV_MSGID_PLURAL@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
@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.
+If the message has a previous msgid (added by @code{msgmerge}),
+environment variable @code{MSGFILTER_PREV_MSGCTXT} is bound to the
+message's previous msgctxt, @code{MSGFILTER_PREV_MSGID} is bound to
+the previous msgid, and @code{MSGFILTER_PREV_MSGID_PLURAL} is bound to
+the previous msgid_plural.
@subsection Input file location
+2014-05-31 Daiki Ueno <ueno@gnu.org>
+
+ msgfilter: Pass previous msgid to the child process
+ Suggested by Pavel Kharitonov in:
+ <http://lists.gnu.org/archive/html/bug-gettext/2014-05/msg00022.html>.
+ * msgfilter.c (process_message): Set MSGFILTER_PREV_* envvar.
+
2014-05-19 Daiki Ueno <ueno@gnu.org>
* Makefile.am (po-gram-gen2.h): Adjust the directory to which
(long) mp->pos.line_number);
xsetenv ("MSGFILTER_LOCATION", location, 1);
free (location);
+ if (mp->prev_msgctxt != NULL)
+ xsetenv ("MSGFILTER_PREV_MSGCTXT", mp->prev_msgctxt, 1);
+ else
+ unsetenv ("MSGFILTER_PREV_MSGCTXT");
+ if (mp->prev_msgid != NULL)
+ xsetenv ("MSGFILTER_PREV_MSGID", mp->prev_msgid, 1);
+ else
+ unsetenv ("MSGFILTER_PREV_MSGID");
+ if (mp->prev_msgid_plural != NULL)
+ xsetenv ("MSGFILTER_PREV_MSGID_PLURAL", mp->prev_msgid_plural, 1);
+ else
+ unsetenv ("MSGFILTER_PREV_MSGID_PLURAL");
/* Count NUL delimited substrings. */
for (p = msgstr, nsubstrings = 0;
+2014-05-31 Daiki Ueno <ueno@gnu.org>
+
+ * msgfilter-6: Test MSGFILTER_PREV_MSGID and
+ MSGFILTER_PREV_MSGID_PLURAL.
+
2014-05-15 Daiki Ueno <ueno@gnu.org>
tests: Add test for msgfilter plural handling
# Les gateaux allemands sont les meilleurs du monde.
#, c-format
+#| msgid "a piece of bread"
+#| msgid_plural "%d pieces of bread"
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] "un morceau de gateau"
$MSGFILTER_MSGID
$MSGFILTER_MSGID_PLURAL
$MSGFILTER_PLURAL_FORM
+$MSGFILTER_PREV_MSGID
+$MSGFILTER_PREV_MSGID_PLURAL
MEOF
cat
EOF
+
+
========================= mf-test6.po:8 =========================
'Your command, please?', asked the waiter.
-========================= mf-test6.po:14 =========================
+
+
+========================= mf-test6.po:16 =========================
a piece of cake
%d pieces of cake
0
-========================= mf-test6.po:14 =========================
+a piece of bread
+%d pieces of bread
+========================= mf-test6.po:16 =========================
a piece of cake
%d pieces of cake
1
-========================= mf-test6.po:20 =========================
+a piece of bread
+%d pieces of bread
+========================= mf-test6.po:22 =========================
%s is replaced by %s.
+
+
EOF
: ${DIFF=diff}