+2014-05-31 Daiki Ueno <ueno@gnu.org>
+
+ * msgexec.texi: Document the environment variable
+ MSGEXEC_PREV_MSGCTXT, MSGEXEC_PREV_MSGID, and
+ MSGEXEC_PREV_MSGID_PLURAL.
+
2014-05-31 Daiki Ueno <ueno@gnu.org>
* msgfilter.texi: Document the environment variable
@vindex MSGEXEC_MSGID_PLURAL@r{, environment variable}
@vindex MSGEXEC_LOCATION@r{, environment variable}
@vindex MSGEXEC_PLURAL_FORM@r{, environment variable}
+@vindex MSGEXEC_PREV_MSGCTXT@r{, environment variable}
+@vindex MSGEXEC_PREV_MSGID@r{, environment variable}
+@vindex MSGEXEC_PREV_MSGID_PLURAL@r{, environment variable}
During each @var{command} invocation, the environment variable
@code{MSGEXEC_MSGID} is bound to the message's msgid, and the environment
variable @code{MSGEXEC_LOCATION} is bound to the location in the PO file
@code{MSGEXEC_MSGID_PLURAL} is bound to the message's msgid_plural and
@code{MSGEXEC_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{MSGEXEC_PREV_MSGCTXT} is bound to the
+message's previous msgctxt, @code{MSGEXEC_PREV_MSGID} is bound to
+the previous msgid, and @code{MSGEXEC_PREV_MSGID_PLURAL} is bound to
+the previous msgid_plural.
@cindex catalog encoding and @code{msgexec} output
Note: It is your responsibility to ensure that the @var{command} can cope
+2014-05-31 Daiki Ueno <ueno@gnu.org>
+
+ msgexec: Pass previous msgid to the child process
+ Suggested by Pavel Kharitonov in:
+ <http://lists.gnu.org/archive/html/bug-gettext/2014-05/msg00022.html>.
+ * msgexec.c (process_string): Set MSGEXEC_PREV_* envvar.
+
2014-05-31 Daiki Ueno <ueno@gnu.org>
msgfilter: Pass previous msgid to the child process
(long) mp->pos.line_number);
xsetenv ("MSGEXEC_LOCATION", location, 1);
free (location);
+ if (mp->prev_msgctxt != NULL)
+ xsetenv ("MSGEXEC_PREV_MSGCTXT", mp->prev_msgctxt, 1);
+ else
+ unsetenv ("MSGEXEC_PREV_MSGCTXT");
+ if (mp->prev_msgid != NULL)
+ xsetenv ("MSGEXEC_PREV_MSGID", mp->prev_msgid, 1);
+ else
+ unsetenv ("MSGEXEC_PREV_MSGID");
+ if (mp->prev_msgid_plural != NULL)
+ xsetenv ("MSGEXEC_PREV_MSGID_PLURAL", mp->prev_msgid_plural, 1);
+ else
+ unsetenv ("MSGEXEC_PREV_MSGID_PLURAL");
/* Open a pipe to a subprocess. */
child = create_pipe_out (sub_name, sub_path, sub_argv, NULL, false, true,
+2014-05-31 Daiki Ueno <ueno@gnu.org>
+
+ * msgexec-5: Test MSGEXEC_PREV_MSGID and MSGEXEC_PREV_MSGID_PLURAL.
+
2014-05-31 Daiki Ueno <ueno@gnu.org>
* msgfilter-6: Test MSGFILTER_PREV_MSGID and
# 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"
$MSGEXEC_MSGID
$MSGEXEC_MSGID_PLURAL
$MSGEXEC_PLURAL_FORM
+$MSGEXEC_PREV_MSGID
+$MSGEXEC_PREV_MSGID_PLURAL
---
MEOF
cat
+
+
---
Content-Type: text/plain; charset=ASCII
Plural-Forms: nplurals=2; plural=(n > 1);
'Your command, please?', asked the waiter.
+
+
---
'Votre commande, s'il vous plait', dit le garcon.
-========================= mex-test5.po:14 =========================
+========================= mex-test5.po:16 =========================
a piece of cake
%d pieces of cake
0
+a piece of bread
+%d pieces of bread
---
un morceau de gateau
-========================= mex-test5.po:14 =========================
+========================= mex-test5.po:16 =========================
a piece of cake
%d pieces of cake
1
+a piece of bread
+%d pieces of bread
---
%d morceaux de gateau
-========================= mex-test5.po:20 =========================
+========================= mex-test5.po:22 =========================
%s is replaced by %s.
+
+
---
%2$s remplace %1$s.
EOF