static void
message_print_obsolete (const message_ty *mp, ostream_t stream,
- const char *charset, size_t page_width, bool blank_line)
+ const char *charset, size_t page_width, bool blank_line,
+ bool debug)
{
int extra_indent;
/* Print the file position comments (normally empty). */
message_print_comment_filepos (mp, stream, uniforum, page_width);
- /* Print flag information in special comment. */
- if (mp->is_fuzzy)
+ /* Print flag information in special comment.
+ Preserve only
+ - the fuzzy flag, because it is important for the translator when the
+ message becomes active again,
+ - the no-wrap flag, because we use mp->do_wrap below for the wrapping,
+ therefore further processing through 'msgcat' needs to use the same
+ value of do_wrap,
+ - the *-format flags, because the wrapping depends on these flags (see
+ 'Don't break inside format directives' comment), therefore further
+ processing through 'msgcat' needs to use the same values of is_format.
+ This is a trimmed-down variant of message_print_comment_flags. */
+ if (mp->is_fuzzy
+ || has_significant_format_p (mp->is_format)
+ || mp->do_wrap == no)
{
+ bool first_flag = true;
+ size_t i;
+
ostream_write_str (stream, "#,");
if (mp->is_fuzzy)
- ostream_write_str (stream, " fuzzy");
+ {
+ ostream_write_str (stream, " fuzzy");
+ first_flag = false;
+ }
+
+ for (i = 0; i < NFORMATS; i++)
+ if (significant_format_p (mp->is_format[i]))
+ {
+ if (!first_flag)
+ ostream_write_str (stream, ",");
+
+ ostream_write_str (stream, " ");
+ ostream_write_str (stream,
+ make_format_description_string (mp->is_format[i],
+ format_language[i],
+ debug));
+ first_flag = false;
+ }
+
+ if (mp->do_wrap == no)
+ {
+ if (!first_flag)
+ ostream_write_str (stream, ",");
+
+ ostream_write_str (stream, " ");
+ ostream_write_str (stream,
+ make_c_width_description_string (mp->do_wrap));
+ first_flag = false;
+ }
ostream_write_str (stream, "\n");
}
if (mlp->item[j]->obsolete)
{
message_print_obsolete (mlp->item[j], stream, charset, page_width,
- blank_line);
+ blank_line, debug);
blank_line = true;
}
msgmerge-7 msgmerge-8 msgmerge-9 msgmerge-10 msgmerge-11 msgmerge-12 \
msgmerge-13 msgmerge-14 msgmerge-15 msgmerge-16 msgmerge-17 \
msgmerge-18 msgmerge-19 msgmerge-20 msgmerge-21 msgmerge-22 \
- msgmerge-23 msgmerge-24 msgmerge-25 msgmerge-26 \
+ msgmerge-23 msgmerge-24 msgmerge-25 msgmerge-26 msgmerge-27 \
+ msgmerge-28 \
msgmerge-compendium-1 msgmerge-compendium-2 msgmerge-compendium-3 \
msgmerge-compendium-4 msgmerge-compendium-5 msgmerge-compendium-6 \
msgmerge-properties-1 msgmerge-properties-2 \
msgid "Missing arguments."
msgstr "Argumente fehlen"
-#, fuzzy
+#, fuzzy, c-format
#~| msgid "%s: invalid option -- %c\n"
#~ msgid "%s: illegal option -- %c\n"
#~ msgstr "%s: ungültige Option -- %c\n"
+#, c-format
#~ msgid "%s: invalid option -- %c\n"
#~ msgstr "%s: ungültige Option -- %c\n"
EOF
--- /dev/null
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test that the msgmerge output is stable under an 'msgcat' invocation.
+# Also test what happens with the 'no-wrap' flag during msgmerge.
+
+cat <<\EOF > mm-test27.po
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "This is a long paragraph that gets wrapped into several lines because it is so long."
+msgstr "Dies ist ein langer Abschnitt, der in mehrere Zeilen umgebrochen wird, weil er so lang ist."
+
+#, no-wrap
+msgid "This is a long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr "Dies ist ein langer Abschnitt, der nicht in mehrere Zeilen umgebrochen wird, weil er als 'no-wrap' markiert ist."
+
+msgid "This is another long paragraph that gets wrapped into several lines because it is so long."
+msgstr "Dies ist ein weiterer langer Abschnitt, der in mehrere Zeilen umgebrochen wird, weil er so lang ist."
+
+#, no-wrap
+msgid "This is another long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr "Dies ist ein weiterer langer Abschnitt, der nicht in mehrere Zeilen umgebrochen wird, weil er als 'no-wrap' markiert ist."
+EOF
+
+cat <<\EOF > mm-test27-1.pot
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "This is a long paragraph that gets wrapped into several lines because it is so long."
+msgstr ""
+
+#, no-wrap
+msgid "This is a long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr ""
+EOF
+
+: ${MSGMERGE=msgmerge}
+${MSGMERGE} -q -o mm-test27.tmp.po mm-test27.po mm-test27-1.pot || Exit 1
+LC_ALL=C tr -d '\r' < mm-test27.tmp.po > mm-test27.new.po || Exit 1
+
+: ${MSGCAT=msgcat}
+${MSGCAT} mm-test27.new.po > mm-test27.tmp.po || Exit 1
+LC_ALL=C tr -d '\r' < mm-test27.tmp.po > mm-test27.cat.po || Exit 1
+
+: ${DIFF=diff}
+${DIFF} mm-test27.new.po mm-test27.cat.po || Exit 1
+
+cat <<\EOF > mm-test27-1.ok
+msgid ""
+msgstr ""
+"Report-Msgid-Bugs-To: \n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid ""
+"This is a long paragraph that gets wrapped into several lines because it is "
+"so long."
+msgstr ""
+"Dies ist ein langer Abschnitt, der in mehrere Zeilen umgebrochen wird, weil "
+"er so lang ist."
+
+#, no-wrap
+msgid "This is a long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr "Dies ist ein langer Abschnitt, der nicht in mehrere Zeilen umgebrochen wird, weil er als 'no-wrap' markiert ist."
+
+#~ msgid ""
+#~ "This is another long paragraph that gets wrapped into several lines "
+#~ "because it is so long."
+#~ msgstr ""
+#~ "Dies ist ein weiterer langer Abschnitt, der in mehrere Zeilen umgebrochen "
+#~ "wird, weil er so lang ist."
+
+#, no-wrap
+#~ msgid "This is another long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+#~ msgstr "Dies ist ein weiterer langer Abschnitt, der nicht in mehrere Zeilen umgebrochen wird, weil er als 'no-wrap' markiert ist."
+EOF
+
+: ${DIFF=diff}
+${DIFF} mm-test27-1.ok mm-test27.new.po || Exit 1
+
+# Now test what happens with the 'no-wrap' flag when merging with a POT file
+# where the 'no-wrap' flag is set.
+
+cat <<\EOF > mm-test27-2.pot
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#, no-wrap
+msgid "This is a long paragraph that gets wrapped into several lines because it is so long."
+msgstr ""
+
+#, no-wrap
+msgid "This is a long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr ""
+
+#, no-wrap
+msgid "This is another long paragraph that gets wrapped into several lines because it is so long."
+msgstr ""
+
+#, no-wrap
+msgid "This is another long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr ""
+EOF
+
+: ${MSGMERGE=msgmerge}
+${MSGMERGE} -q -o mm-test27.tmp.po mm-test27.new.po mm-test27-2.pot || Exit 1
+LC_ALL=C tr -d '\r' < mm-test27.tmp.po > mm-test27-2.po || Exit 1
+
+cat <<\EOF > mm-test27-2.ok
+msgid ""
+msgstr ""
+"Report-Msgid-Bugs-To: \n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#, no-wrap
+msgid "This is a long paragraph that gets wrapped into several lines because it is so long."
+msgstr "Dies ist ein langer Abschnitt, der in mehrere Zeilen umgebrochen wird, weil er so lang ist."
+
+#, no-wrap
+msgid "This is a long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr "Dies ist ein langer Abschnitt, der nicht in mehrere Zeilen umgebrochen wird, weil er als 'no-wrap' markiert ist."
+
+#, no-wrap
+msgid "This is another long paragraph that gets wrapped into several lines because it is so long."
+msgstr "Dies ist ein weiterer langer Abschnitt, der in mehrere Zeilen umgebrochen wird, weil er so lang ist."
+
+#, no-wrap
+msgid "This is another long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr "Dies ist ein weiterer langer Abschnitt, der nicht in mehrere Zeilen umgebrochen wird, weil er als 'no-wrap' markiert ist."
+EOF
+
+: ${DIFF=diff}
+${DIFF} mm-test27-2.ok mm-test27-2.po || Exit 1
+
+# Now test what happens with the 'no-wrap' flag when merging with a POT file
+# where the 'no-wrap' flag is absent.
+
+cat <<\EOF > mm-test27-3.pot
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "This is a long paragraph that gets wrapped into several lines because it is so long."
+msgstr ""
+
+msgid "This is a long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr ""
+
+msgid "This is another long paragraph that gets wrapped into several lines because it is so long."
+msgstr ""
+
+msgid "This is another long paragraph that does not get wrapped into several lines because it is marked as 'no-wrap'."
+msgstr ""
+EOF
+
+: ${MSGMERGE=msgmerge}
+${MSGMERGE} -q -o mm-test27.tmp.po mm-test27.new.po mm-test27-3.pot || Exit 1
+LC_ALL=C tr -d '\r' < mm-test27.tmp.po > mm-test27-3.po || Exit 1
+
+cat <<\EOF > mm-test27-3.ok
+msgid ""
+msgstr ""
+"Report-Msgid-Bugs-To: \n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid ""
+"This is a long paragraph that gets wrapped into several lines because it is "
+"so long."
+msgstr ""
+"Dies ist ein langer Abschnitt, der in mehrere Zeilen umgebrochen wird, weil "
+"er so lang ist."
+
+msgid ""
+"This is a long paragraph that does not get wrapped into several lines "
+"because it is marked as 'no-wrap'."
+msgstr ""
+"Dies ist ein langer Abschnitt, der nicht in mehrere Zeilen umgebrochen wird, "
+"weil er als 'no-wrap' markiert ist."
+
+msgid ""
+"This is another long paragraph that gets wrapped into several lines because "
+"it is so long."
+msgstr ""
+"Dies ist ein weiterer langer Abschnitt, der in mehrere Zeilen umgebrochen "
+"wird, weil er so lang ist."
+
+msgid ""
+"This is another long paragraph that does not get wrapped into several lines "
+"because it is marked as 'no-wrap'."
+msgstr ""
+"Dies ist ein weiterer langer Abschnitt, der nicht in mehrere Zeilen "
+"umgebrochen wird, weil er als 'no-wrap' markiert ist."
+EOF
+
+: ${DIFF=diff}
+${DIFF} mm-test27-3.ok mm-test27-3.po || Exit 1
+
+Exit 0
--- /dev/null
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test that the msgmerge output is stable under an 'msgcat' invocation.
+# Also test what happens with the 'c-format' flag during msgmerge.
+
+cat <<\EOF > mm-test28.po
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "warning: bad context for singular argument of keyword '%.*s'"
+msgstr "Warnung: schlechter Kontext für das Singular-Argument des Schlüsselwortes »%.*s«"
+
+#, c-format
+msgid "warning: broken context for singular argument of keyword '%.*s'"
+msgstr "Warnung: missratener Kontext für das Singular-Argument des Schlüsselworts »%.*s«"
+
+msgid "warning: abstruse context for plural argument of keyword '%.*s'"
+msgstr "Warnung: abstruser Kontext für das Plural-Argument des Schlüsselwortes »%.*s«"
+
+#, c-format
+msgid "warning: missing context for plural argument of keyword '%.*s'"
+msgstr "Warnung: fehlender Kontext für das Plural-Argument des Schlüsselwortes »%.*s«"
+EOF
+
+cat <<\EOF > mm-test28-1.pot
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "warning: bad context for singular argument of keyword '%.*s'"
+msgstr ""
+
+#, c-format
+msgid "warning: broken context for singular argument of keyword '%.*s'"
+msgstr ""
+EOF
+
+: ${MSGMERGE=msgmerge}
+${MSGMERGE} -q -o mm-test28.tmp.po mm-test28.po mm-test28-1.pot || Exit 1
+LC_ALL=C tr -d '\r' < mm-test28.tmp.po > mm-test28.new.po || Exit 1
+
+: ${MSGCAT=msgcat}
+${MSGCAT} mm-test28.new.po > mm-test28.tmp.po || Exit 1
+LC_ALL=C tr -d '\r' < mm-test28.tmp.po > mm-test28.cat.po || Exit 1
+
+: ${DIFF=diff}
+${DIFF} mm-test28.new.po mm-test28.cat.po || Exit 1
+
+cat <<\EOF > mm-test28-1.ok
+msgid ""
+msgstr ""
+"Report-Msgid-Bugs-To: \n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "warning: bad context for singular argument of keyword '%.*s'"
+msgstr ""
+"Warnung: schlechter Kontext für das Singular-Argument des Schlüsselwortes »%."
+"*s«"
+
+#, c-format
+msgid "warning: broken context for singular argument of keyword '%.*s'"
+msgstr ""
+"Warnung: missratener Kontext für das Singular-Argument des Schlüsselworts "
+"»%.*s«"
+
+#~ msgid "warning: abstruse context for plural argument of keyword '%.*s'"
+#~ msgstr ""
+#~ "Warnung: abstruser Kontext für das Plural-Argument des Schlüsselwortes »%."
+#~ "*s«"
+
+#, c-format
+#~ msgid "warning: missing context for plural argument of keyword '%.*s'"
+#~ msgstr ""
+#~ "Warnung: fehlender Kontext für das Plural-Argument des Schlüsselwortes "
+#~ "»%.*s«"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mm-test28-1.ok mm-test28.new.po || Exit 1
+
+# Now test what happens with the 'c-format' flag when merging with a POT file
+# where the 'c-format' flag is set.
+
+cat <<\EOF > mm-test28-2.pot
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#, c-format
+msgid "warning: bad context for singular argument of keyword '%.*s'"
+msgstr ""
+
+#, c-format
+msgid "warning: broken context for singular argument of keyword '%.*s'"
+msgstr ""
+
+#, c-format
+msgid "warning: abstruse context for plural argument of keyword '%.*s'"
+msgstr ""
+
+#, c-format
+msgid "warning: missing context for plural argument of keyword '%.*s'"
+msgstr ""
+EOF
+
+: ${MSGMERGE=msgmerge}
+${MSGMERGE} -q -o mm-test28.tmp.po mm-test28.new.po mm-test28-2.pot || Exit 1
+LC_ALL=C tr -d '\r' < mm-test28.tmp.po > mm-test28-2.po || Exit 1
+
+cat <<\EOF > mm-test28-2.ok
+msgid ""
+msgstr ""
+"Report-Msgid-Bugs-To: \n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#, c-format
+msgid "warning: bad context for singular argument of keyword '%.*s'"
+msgstr ""
+"Warnung: schlechter Kontext für das Singular-Argument des Schlüsselwortes "
+"»%.*s«"
+
+#, c-format
+msgid "warning: broken context for singular argument of keyword '%.*s'"
+msgstr ""
+"Warnung: missratener Kontext für das Singular-Argument des Schlüsselworts "
+"»%.*s«"
+
+#, c-format
+msgid "warning: abstruse context for plural argument of keyword '%.*s'"
+msgstr ""
+"Warnung: abstruser Kontext für das Plural-Argument des Schlüsselwortes »%.*s«"
+
+#, c-format
+msgid "warning: missing context for plural argument of keyword '%.*s'"
+msgstr ""
+"Warnung: fehlender Kontext für das Plural-Argument des Schlüsselwortes »%.*s«"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mm-test28-2.ok mm-test28-2.po || Exit 1
+
+# Now test what happens with the 'c-format' flag when merging with a POT file
+# where the 'c-format' flag is absent.
+
+cat <<\EOF > mm-test28-3.pot
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "warning: bad context for singular argument of keyword '%.*s'"
+msgstr ""
+
+msgid "warning: broken context for singular argument of keyword '%.*s'"
+msgstr ""
+
+msgid "warning: abstruse context for plural argument of keyword '%.*s'"
+msgstr ""
+
+msgid "warning: missing context for plural argument of keyword '%.*s'"
+msgstr ""
+EOF
+
+: ${MSGMERGE=msgmerge}
+${MSGMERGE} -q -o mm-test28.tmp.po mm-test28.new.po mm-test28-3.pot || Exit 1
+LC_ALL=C tr -d '\r' < mm-test28.tmp.po > mm-test28-3.po || Exit 1
+
+cat <<\EOF > mm-test28-3.ok
+msgid ""
+msgstr ""
+"Report-Msgid-Bugs-To: \n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "warning: bad context for singular argument of keyword '%.*s'"
+msgstr ""
+"Warnung: schlechter Kontext für das Singular-Argument des Schlüsselwortes »%."
+"*s«"
+
+msgid "warning: broken context for singular argument of keyword '%.*s'"
+msgstr ""
+"Warnung: missratener Kontext für das Singular-Argument des Schlüsselworts »%."
+"*s«"
+
+msgid "warning: abstruse context for plural argument of keyword '%.*s'"
+msgstr ""
+"Warnung: abstruser Kontext für das Plural-Argument des Schlüsselwortes »%.*s«"
+
+msgid "warning: missing context for plural argument of keyword '%.*s'"
+msgstr ""
+"Warnung: fehlender Kontext für das Plural-Argument des Schlüsselwortes »%.*s«"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mm-test28-3.ok mm-test28-3.po || Exit 1
+
+Exit 0