+2001-12-15 Bruno Haible <bruno@clisp.org>
+
+ * xgettext.c (remember_a_message_plural): Mark the message as xx-format
+ if the English plural form has xx format syntax and the singular form
+ may or may not have xx format syntax.
+
2001-12-15 Bruno Haible <bruno@clisp.org>
* format.h (struct formatstring_parser): Add 'equality' and
char *msgstr1;
size_t msgstr1_len;
char *msgstr;
+ size_t i;
msgid_plural = string;
memcpy (msgstr + mp->msgstr_len, msgstr1, msgstr1_len);
mp->msgstr = msgstr;
mp->msgstr_len = mp->msgstr_len + msgstr1_len;
+
+ /* If it is not already decided, through programmer comments or
+ the msgid, whether the msgid is a format string, examine the
+ msgid_plural. This is a heuristic. */
+ for (i = 0; i < NFORMATS; i++)
+ if (formatstring_parsers[i] == current_formatstring_parser
+ && (mp->is_format[i] == undecided || mp->is_format[i] == possible))
+ {
+ struct formatstring_parser *parser = formatstring_parsers[i];
+ void *descr = parser->parse (mp->msgid_plural);
+
+ if (descr != NULL)
+ {
+ /* Same heuristic as in remember_a_message. */
+ if (parser->get_number_of_directives (descr) > 0)
+ mp->is_format[i] = possible;
+
+ parser->free (descr);
+ }
+ else
+ /* msgid_plural is not a valid format string. */
+ mp->is_format[i] = impossible;
+ }
}
else
free (msgid_plural);
+2001-12-15 Bruno Haible <bruno@clisp.org>
+
+ * plural-1: Adapt for changed xgettext behaviour w.r.t. format strings
+ in plural forms.
+ * lang-c: Likewise.
+ * lang-c++: Likewise.
+ * lang-objc: Likewise.
+ * lang-clisp: Likewise.
+ * lang-java: Likewise.
+ * lang-ycp: Likewise.
+ * lang-po: Likewise.
+
2001-12-15 Bruno Haible <bruno@clisp.org>
* msgfmt-1: Remove temporary files in case of error.
msgid "'Your command, please?', asked the waiter."
msgstr ""
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] ""
msgstr "«Votre commande, s'il vous plait», dit le garçon."
# Les gateaux allemands sont les meilleurs du monde.
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] "un morceau de gateau"
msgid "'Your command, please?', asked the waiter."
msgstr ""
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] ""
msgstr "«Votre commande, s'il vous plait», dit le garçon."
# Les gateaux allemands sont les meilleurs du monde.
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] "un morceau de gateau"
msgid "'Your command, please?', asked the waiter."
msgstr ""
+#, lisp-format
msgid "a piece of cake"
msgid_plural "~D pieces of cake"
msgstr[0] ""
msgstr "«Votre commande, s'il vous plait», dit le garçon."
# Les gateaux allemands sont les meilleurs du monde.
+#, lisp-format
msgid "a piece of cake"
msgid_plural "~D pieces of cake"
msgstr[0] "un morceau de gateau"
msgid "'Your command, please?', asked the waiter."
msgstr ""
+#, java-format
msgid "a piece of cake"
msgid_plural "{0,number} pieces of cake"
msgstr[0] ""
msgstr "«Votre commande, s'il vous plait», dit le garçon."
# Les gateaux allemands sont les meilleurs du monde.
+#, java-format
msgid "a piece of cake"
msgid_plural "{0,number} pieces of cake"
msgstr[0] "un morceau de gateau"
msgid "'Your command, please?', asked the waiter."
msgstr ""
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] ""
msgstr "«Votre commande, s'il vous plait», dit le garçon."
# Les gateaux allemands sont les meilleurs du monde.
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] "un morceau de gateau"
msgid "'Your command, please?', asked the waiter."
msgstr ""
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] ""
msgstr "«Votre commande, s'il vous plait», dit le garçon."
# Les gateaux allemands sont les meilleurs du monde.
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] "un morceau de gateau"
msgid "'Your command, please?', asked the waiter."
msgstr ""
+#, ycp-format
msgid "a piece of cake"
msgid_plural "%1 pieces of cake"
msgstr[0] ""
msgstr "«Votre commande, s'il vous plait», dit le garçon."
# Les gateaux allemands sont les meilleurs du monde.
+#, ycp-format
msgid "a piece of cake"
msgid_plural "%1 pieces of cake"
msgstr[0] "un morceau de gateau"
tmpfiles="$tmpfiles cake.ok"
cat <<EOF > cake.ok
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] ""
tmpfiles="$tmpfiles fr.po"
cat <<EOF > fr.po
# Les gateaux allemands sont les meilleurs du monde.
+#, c-format
msgid "a piece of cake"
msgid_plural "%d pieces of cake"
msgstr[0] "un morceau de gateau"
${MSGUNFMT} fr/LC_MESSAGES/cake.mo -o fr.po.tmp
tmpfiles="$tmpfiles fr.po.strip"
-sed 1d < fr.po > fr.po.strip
+sed 1,2d < fr.po > fr.po.strip
: ${DIFF=diff}
${DIFF} fr.po.strip fr.po.tmp || exit 1