/* Write the PO file. */
msgdomain_list_print (result, output_file, output_syntax, force_po, false);
- exit (EXIT_SUCCESS);
+ exit (error_message_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS);
}
/* Write the PO file. */
msgdomain_list_print (result, output_file, output_syntax, force_po, false);
- exit (EXIT_SUCCESS);
+ exit (error_message_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS);
}
size_t i;
tmp = message_list_search (total_mlp, mp->msgctxt, mp->msgid);
- if (tmp == NULL)
+ if (tmp != NULL)
+ {
+ if ((tmp->msgid_plural != NULL) != (mp->msgid_plural != NULL))
+ {
+ char *errormsg =
+ xasprintf (_("msgid '%s' is used without plural and with plural."),
+ mp->msgid);
+ multiline_error (xstrdup (""),
+ xasprintf ("%s\n", errormsg));
+ }
+ }
+ else
{
tmp = message_alloc (mp->msgctxt, mp->msgid, mp->msgid_plural,
NULL, 0, &mp->pos);
/* Write the PO file. */
msgdomain_list_print (result, output_file, output_syntax, force_po, false);
- exit (EXIT_SUCCESS);
+ exit (error_message_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS);
}
msgattrib-properties-1 \
msgcat-1 msgcat-2 msgcat-3 msgcat-4 msgcat-5 msgcat-6 msgcat-7 \
msgcat-8 msgcat-9 msgcat-10 msgcat-11 msgcat-12 msgcat-13 msgcat-14 \
- msgcat-15 msgcat-16 msgcat-17 msgcat-18 msgcat-19 msgcat-20 \
+ msgcat-15 msgcat-16 msgcat-17 msgcat-18 msgcat-19 msgcat-20 msgcat-21 \
msgcat-properties-1 msgcat-properties-2 \
msgcat-stringtable-1 \
msgcmp-1 msgcmp-2 msgcmp-3 msgcmp-4 \
--- /dev/null
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Verify that msgcat complains when the same msgid occurs with and without
+# msgid_plural.
+
+cat <<\EOF > mcat-test21.in1
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "File"
+msgstr "Soumettre"
+EOF
+
+cat <<\EOF > mcat-test21.in2
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+msgid "File"
+msgid_plural "Files"
+msgstr[0] "fichier"
+msgstr[1] "fichiers"
+EOF
+
+rm -f mcat-test21.out1
+: ${MSGCAT=msgcat}
+${MSGCAT} -o mcat-test21.out1 mcat-test21.in1 mcat-test21.in2 2>/dev/null
+test $? = 1 || { Exit 1; }
+
+rm -f mcat-test21.out2
+: ${MSGCAT=msgcat}
+${MSGCAT} -o mcat-test21.out2 mcat-test21.in2 mcat-test21.in1 2>/dev/null
+test $? = 1 || { Exit 1; }
+
+Exit 0