]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Add MSGID_BUGS_ADDRESS to Makevars.
authorBruno Haible <bruno@clisp.org>
Tue, 18 Feb 2003 13:24:41 +0000 (13:24 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:10 +0000 (12:10 +0200)
Add --msgid-bugs-address option to xgettext.
Add Report-Msgid-Bugs-To field to PO file header.

18 files changed:
NEWS
gettext-runtime/m4/ChangeLog
gettext-runtime/m4/gettext.m4
gettext-runtime/po/ChangeLog
gettext-runtime/po/Makefile.in.in
gettext-runtime/po/Makevars
gettext-tools/doc/ChangeLog
gettext-tools/doc/gettext.texi
gettext-tools/doc/xgettext.texi
gettext-tools/misc/ChangeLog
gettext-tools/misc/gettextize.in
gettext-tools/po/ChangeLog
gettext-tools/po/Makefile.in.in
gettext-tools/po/Makevars
gettext-tools/po/Makevars.template [new file with mode: 0644]
gettext-tools/src/ChangeLog
gettext-tools/src/msgmerge.c
gettext-tools/src/xgettext.c

diff --git a/NEWS b/NEWS
index 7aedbe929efff7b7fb0b36c3514a5b9b74c8f98c..ebd4aeb4cae722c076200b22449c921d3478b91c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,11 @@ Version 0.11.6 - October 2002
   system that has users who desire to use internationalization. Whereas the
   'gettext-tools' package is only for developers and translators.
 
+* The po/Makevars file has a new field MSGID_BUGS_ADDRESS, which program
+  maintainers should fill in, to help feedback from the translators to the
+  program maintainers.
+  xgettext, accordingly, has a new option --msgid-bugs-address.
+
 * xgettext now also supports Smalltalk and PHP.
 
 * A new C++ class, called gnu::autosprintf, makes it possible to use C format
index cf4b062848d672046866d068fa9fe5639e512cb3..42d6e4be8946509fae44eb61b738a5ed2dd77f32 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-16  Bruno Haible  <bruno@clisp.org>
+
+       * gettext.m4 (AM_PO_SUBDIRS): Require an xgettext that supports the
+       --msgid-bugs-address option.
+
 2003-02-16  Bruno Haible  <bruno@clisp.org>
 
        * gettext.m4 (AM_GNU_GETTEXT): Move INTLOBJS to backward compatibility
index 1ac36a85ce4cd68f99f71482bb17a3dc020f5bf1..17bd132641c3e2ab5c1b070f28ff46b6b7553d33 100644 (file)
@@ -366,12 +366,12 @@ AC_DEFUN([AM_PO_SUBDIRS],
     :)
   AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
-  dnl Search for GNU xgettext 0.11 or newer in the PATH.
+  dnl Search for GNU xgettext 0.12 or newer in the PATH.
   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
   dnl The second test excludes FreeBSD xgettext.
   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
-     (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
     :)
   dnl Remove leftover from FreeBSD xgettext call.
   rm -f messages.po
@@ -401,8 +401,8 @@ AC_DEFUN([AM_PO_SUBDIRS],
   if test "$XGETTEXT" != ":"; then
     dnl If it is no GNU xgettext we define it as : so that the
     dnl Makefiles still can work.
-    if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
-       (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+    if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+       (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
       : ;
     else
       AC_MSG_RESULT(
index f756e51496ad86ec87f66c21e38d75d1bb9f1f07..e2afca16f06d44428d99063ef7726a99d190c888 100644 (file)
@@ -1,3 +1,13 @@
+2003-02-16  Bruno Haible  <bruno@clisp.org>
+
+       * Makevars (MSGID_BUGS_ADDRESS): New variable.
+       * Makefile.in.in (DISTFILES.common): Remove Makevars.
+       (DISTFILES): Add Makevars here.
+       ($(DOMAIN).pot-update): Pass --msgid-bugs-address to xgettext.
+       (install-data): Install Makevars.template. Uninstall Makevars.
+       (uninstall-data): Uninstall Makevars.template.
+       (dist2): Distribute Makevars.template, in gettext-tools package only.
+
 2003-02-12  Bruno Haible  <bruno@clisp.org>
 
        * POTFILES.in: New file.
index 1360f2c163accc8766380d05718d20116f9c5318..fa15e7f84fbdafbad13353aecd337e671ea76727 100644 (file)
@@ -42,9 +42,9 @@ POFILES = @POFILES@
 GMOFILES = @GMOFILES@
 UPDATEPOFILES = @UPDATEPOFILES@
 DUMMYPOFILES = @DUMMYPOFILES@
-DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
 $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
-DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot stamp-po \
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
 $(POFILES) $(GMOFILES) \
 $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
 
@@ -101,7 +101,8 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
        $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
          --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
          --files-from=$(srcdir)/POTFILES.in \
-         --copyright-holder='$(COPYRIGHT_HOLDER)'
+         --copyright-holder='$(COPYRIGHT_HOLDER)' \
+         --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
        test ! -f $(DOMAIN).po || { \
          if test -f $(srcdir)/$(DOMAIN).pot; then \
            sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
@@ -137,10 +138,13 @@ install-exec:
 install-data: install-data-@USE_NLS@
        if test "$(PACKAGE)" = "gettext-tools"; then \
          $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
-         for file in $(DISTFILES.common); do \
+         for file in $(DISTFILES.common) Makevars.template; do \
            $(INSTALL_DATA) $(srcdir)/$$file \
                            $(DESTDIR)$(gettextsrcdir)/$$file; \
          done; \
+         for file in Makevars; do \
+           rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+         done; \
        else \
          : ; \
        fi
@@ -237,7 +241,7 @@ uninstall: uninstall-exec uninstall-data
 uninstall-exec:
 uninstall-data: uninstall-data-@USE_NLS@
        if test "$(PACKAGE)" = "gettext-tools"; then \
-         for file in $(DISTFILES.common); do \
+         for file in $(DISTFILES.common) Makevars.template; do \
            rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
          done; \
        else \
@@ -281,6 +285,9 @@ dist distdir:
 # This is a separate target because 'update-po' must be executed before.
 dist2: $(DISTFILES)
        dists="$(DISTFILES)"; \
+       if test "$(PACKAGE)" = "gettext-tools"; then \
+         dists="$$dists Makevars.template"; \
+       fi; \
        if test -f $(srcdir)/ChangeLog; then \
          dists="$$dists ChangeLog"; \
        fi; \
index 8b09f53b0f5446dcab87e1f0a748f8916c09d35f..5c118c507aae36cae2cb7f61ebbf98ca326b3525 100644 (file)
@@ -20,6 +20,22 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
 # their copyright.
 COPYRIGHT_HOLDER = Free Software Foundation, Inc.
 
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org
+
 # This is the list of locale categories, beyond LC_MESSAGES, for which the
 # message catalogs shall be used.  It is usually empty.
 EXTRA_LOCALE_CATEGORIES =
index 4517026ecb03c4192819205fbedd3731481a8fe7..3c3e0abe80d296d07e5af54eafa2ec69115e16c8 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-16  Bruno Haible  <bruno@clisp.org>
+
+       * gettext.texi (Header Entry): Document Report-Msgid-Bugs-To.
+       * xgettext.texi: Document --msgid-bugs-address option.
+
 2003-02-16  Bruno Haible  <bruno@clisp.org>
 
        * gettext.texi (Prioritizing messages): New section.
index 29d06fc1388ccefe1099d636c223218d8c397c96..40dba0745701a66c412e6eee5171227d8c4ec5b4 100644 (file)
@@ -2514,6 +2514,22 @@ entry.  You should fill in the following fields.
 @item Project-Id-Version
 This is the name and version of the package.
 
+@item Report-Msgid-Bugs-To
+This has already been filled in by @code{xgettext}.  It contains an email
+address or URL where you can report bugs in the untranslated strings:
+
+@itemize -
+@item Strings which are not entire sentences, see the maintainer guidelines
+in @ref{Preparing Strings}.
+@item Strings which use unclear terms or require additional context to be
+understood.
+@item Strings which make invalid assumptions about notation of date, time or
+money.
+@item Pluralisation problems.
+@item Incorrect English spelling.
+@item Incorrect formatting.
+@end itemize
+
 @item POT-Creation-Date
 This has already been filled in by @code{xgettext}.
 
index f4a0b7ac36eec6a77c844f06b0c563ad6ee7bc45..425672c891bfa0801be6ff224cc9da83b1efced3 100644 (file)
@@ -269,6 +269,30 @@ Omit FSF copyright in output.  This option is equivalent to
 @samp{--copyright-holder=''}.  It can be useful for packages outside the GNU
 project that want their translations to be in the public domain.
 
+@item --msgid-bugs-address=@var{email@@address}
+@opindex --msgid-bugs-address@r{, @code{xgettext} option}
+Set the reporting address for msgid bugs.  This is the email address or URL
+to which the translators shall report bugs in the untranslated strings:
+
+@itemize -
+@item Strings which are not entire sentences, see the maintainer guidelines
+in @ref{Preparing Strings}.
+@item Strings which use unclear terms or require additional context to be
+understood.
+@item Strings which make invalid assumptions about notation of date, time or
+money.
+@item Pluralisation problems.
+@item Incorrect English spelling.
+@item Incorrect formatting.
+@end itemize
+
+It can be your email address, or a mailing list address where translators
+can write to without being subscribed, or the URL of a web page through
+which the translators can contact you.
+
+The default value is empty, which means that translators will be clueless!
+Don't forget to specify this option.
+
 @item -m [@var{string}]
 @itemx --msgstr-prefix[=@var{string}]
 @opindex -m@r{, @code{xgettext} option}
index a6a984a380e3603678a841f3de6cc76c59f0ba4f..a232545112d1e1630571a06c41e59ed2b0a416ce 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-16  Bruno Haible  <bruno@clisp.org>
+
+       * gettextize.in: Create po/Makevars.template from installed
+       po/Makevars.template, not from po/Makevars.
+       (func_version): Update copyright year.
+
 2003-02-16  Bruno Haible  <bruno@clisp.org>
 
        * po-compat.el: Add testing instructions.
index 5b2863d4c9a17467b27fff12a4e4b80939d2c813..46059a9f257182445fce5a358d32ac100ef6c261 100644 (file)
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
+# Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ Report bugs to <bug-gnu-gettext@gnu.org>."
 func_version ()
 {
   echo "$progname (GNU $package) $version"
-  echo "Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
+  echo "Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
   echo "Written by" "Ulrich Drepper"
@@ -509,24 +509,24 @@ for file in *; do
     Makefile.in.in)
       # Already handled above.
       ;;
-    Makevars)
-      func_linkorcopy $file "$gettext_dir/po/$file" po/$file.template
-      if test -f "$srcdir/po/$file"; then
-        sed -n -e 's/[         ]*\([A-Za-z0-9_]*\)[    ]*=.*/\1/p' < "$srcdir/po/$file" | LC_ALL=C sort > "$srcdir/po/$file.tmp1"
-        sed -n -e 's/[         ]*\([A-Za-z0-9_]*\)[    ]*=.*/\1/p' < "$srcdir/po/$file.template" | LC_ALL=C sort > "$srcdir/po/$file.tmp2"
-        missingvars=`LC_ALL=C comm -13 "$srcdir/po/$file.tmp1" "$srcdir/po/$file.tmp2"`
-        rm -f "$srcdir/po/$file.tmp1" "$srcdir/po/$file.tmp2"
+    Makevars.template)
+      func_linkorcopy Makevars.template "$gettext_dir/po/Makevars.template" po/Makevars.template
+      if test -f "$srcdir/po/Makevars"; then
+        sed -n -e 's/[         ]*\([A-Za-z0-9_]*\)[    ]*=.*/\1/p' < "$srcdir/po/Makevars" | LC_ALL=C sort > "$srcdir/po/Makevars.tmp1"
+        sed -n -e 's/[         ]*\([A-Za-z0-9_]*\)[    ]*=.*/\1/p' < "$srcdir/po/Makevars.template" | LC_ALL=C sort > "$srcdir/po/Makevars.tmp2"
+        missingvars=`LC_ALL=C comm -13 "$srcdir/po/Makevars.tmp1" "$srcdir/po/Makevars.tmp2"`
+        rm -f "$srcdir/po/Makevars.tmp1" "$srcdir/po/Makevars.tmp2"
         if test -n "$missingvars"; then
           please="$please
-Please update po/$file so that it defines all the variables mentioned
-in po/$file.template.
-You can then remove po/$file.template.
+Please update po/Makevars so that it defines all the variables mentioned
+in po/Makevars.template.
+You can then remove po/Makevars.template.
 "
         fi
       else
         please="$please
-Please create po/$file from the template in po/$file.template.
-You can then remove po/$file.template.
+Please create po/Makevars from the template in po/Makevars.template.
+You can then remove po/Makevars.template.
 "
       fi
       ;;
index de06c1e984df503d5e9ce361b47668ac2935e7b5..5a929fc239e32e2ac0e21809c06e1131948dbc93 100644 (file)
@@ -1,3 +1,14 @@
+2003-02-16  Bruno Haible  <bruno@clisp.org>
+
+       * Makevars.template: New file.
+       * Makevars (MSGID_BUGS_ADDRESS): New variable.
+       * Makefile.in.in (DISTFILES.common): Remove Makevars.
+       (DISTFILES): Add Makevars here.
+       ($(DOMAIN).pot-update): Pass --msgid-bugs-address to xgettext.
+       (install-data): Install Makevars.template. Uninstall Makevars.
+       (uninstall-data): Uninstall Makevars.template.
+       (dist2): Distribute Makevars.template, in gettext-tools package only.
+
 2003-02-12  Bruno Haible  <bruno@clisp.org>
 
        * POTFILES.in: Bring up to date.
index 1360f2c163accc8766380d05718d20116f9c5318..fa15e7f84fbdafbad13353aecd337e671ea76727 100644 (file)
@@ -42,9 +42,9 @@ POFILES = @POFILES@
 GMOFILES = @GMOFILES@
 UPDATEPOFILES = @UPDATEPOFILES@
 DUMMYPOFILES = @DUMMYPOFILES@
-DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
 $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
-DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot stamp-po \
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
 $(POFILES) $(GMOFILES) \
 $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
 
@@ -101,7 +101,8 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
        $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
          --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
          --files-from=$(srcdir)/POTFILES.in \
-         --copyright-holder='$(COPYRIGHT_HOLDER)'
+         --copyright-holder='$(COPYRIGHT_HOLDER)' \
+         --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
        test ! -f $(DOMAIN).po || { \
          if test -f $(srcdir)/$(DOMAIN).pot; then \
            sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
@@ -137,10 +138,13 @@ install-exec:
 install-data: install-data-@USE_NLS@
        if test "$(PACKAGE)" = "gettext-tools"; then \
          $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
-         for file in $(DISTFILES.common); do \
+         for file in $(DISTFILES.common) Makevars.template; do \
            $(INSTALL_DATA) $(srcdir)/$$file \
                            $(DESTDIR)$(gettextsrcdir)/$$file; \
          done; \
+         for file in Makevars; do \
+           rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+         done; \
        else \
          : ; \
        fi
@@ -237,7 +241,7 @@ uninstall: uninstall-exec uninstall-data
 uninstall-exec:
 uninstall-data: uninstall-data-@USE_NLS@
        if test "$(PACKAGE)" = "gettext-tools"; then \
-         for file in $(DISTFILES.common); do \
+         for file in $(DISTFILES.common) Makevars.template; do \
            rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
          done; \
        else \
@@ -281,6 +285,9 @@ dist distdir:
 # This is a separate target because 'update-po' must be executed before.
 dist2: $(DISTFILES)
        dists="$(DISTFILES)"; \
+       if test "$(PACKAGE)" = "gettext-tools"; then \
+         dists="$$dists Makevars.template"; \
+       fi; \
        if test -f $(srcdir)/ChangeLog; then \
          dists="$$dists ChangeLog"; \
        fi; \
index 8b09f53b0f5446dcab87e1f0a748f8916c09d35f..5c118c507aae36cae2cb7f61ebbf98ca326b3525 100644 (file)
@@ -20,6 +20,22 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
 # their copyright.
 COPYRIGHT_HOLDER = Free Software Foundation, Inc.
 
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org
+
 # This is the list of locale categories, beyond LC_MESSAGES, for which the
 # message catalogs shall be used.  It is usually empty.
 EXTRA_LOCALE_CATEGORIES =
diff --git a/gettext-tools/po/Makevars.template b/gettext-tools/po/Makevars.template
new file mode 100644 (file)
index 0000000..32692ab
--- /dev/null
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS =
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
index 01a2f72d8dbb0a23754562ed7054f68702c6e859..5441e59f2f09b794381d96007662ac7ac9fb6dfd 100644 (file)
@@ -1,3 +1,14 @@
+2003-02-16  Bruno Haible  <bruno@clisp.org>
+
+       * msgmerge.c (message_merge): Add support for Report-Msgid-Bugs-To
+       field.
+       * xgettext.c (msgid_bugs_address): New variable.
+       (long_options): Add option --msgid-bugs-address.
+       (main): Handle option --msgid-bugs-address.
+       (usage): Document option --msgid-bugs-address.
+       (construct_header): Add 'Report-Msgid-Bugs-To:' field. Warn if
+       msgid_bugs_address is empty.
+
 2003-02-15  Bruno Haible  <bruno@clisp.org>
 
        * user-email.in: Add support for GNOME evolution, OpenOffice and
index 22dbf534c2cdb01b2c7e958ae6edf11fc846a495..87bd713d4afc4fc9b6bb95fd7d9a97de025ed6ef 100644 (file)
@@ -561,7 +561,7 @@ message_merge (message_ty *def, message_ty *ref)
   /* Take the msgstr from the definition.  The msgstr of the reference
      is usually empty, as it was generated by xgettext.  If we currently
      process the header entry we have to merge the msgstr by using the
-     POT-Creation-Date field from the reference.  */
+     Report-Msgid-Bugs-To and POT-Creation-Date fields from the reference.  */
   if (ref->msgid[0] == '\0')
     {
       /* Oh, oh.  The header entry and we have something to fill in.  */
@@ -572,24 +572,26 @@ message_merge (message_ty *def, message_ty *ref)
       } known_fields[] =
       {
        { "Project-Id-Version:", sizeof ("Project-Id-Version:") - 1 },
-#define PROJECT_ID     0
+#define PROJECT_ID             0
+       { "Report-Msgid-Bugs-To:", sizeof ("Report-Msgid-Bugs-To:") - 1 },
+#define REPORT_MSGID_BUGS_TO   1
        { "POT-Creation-Date:", sizeof ("POT-Creation-Date:") - 1 },
-#define POT_CREATION   1
+#define POT_CREATION_DATE      2
        { "PO-Revision-Date:", sizeof ("PO-Revision-Date:") - 1 },
-#define PO_REVISION    2
+#define PO_REVISION_DATE       3
        { "Last-Translator:", sizeof ("Last-Translator:") - 1 },
-#define LAST_TRANSLATOR        3
+#define LAST_TRANSLATOR                4
        { "Language-Team:", sizeof ("Language-Team:") - 1 },
-#define LANGUAGE_TEAM  4
+#define LANGUAGE_TEAM          5
        { "MIME-Version:", sizeof ("MIME-Version:") - 1 },
-#define MIME_VERSION   5
+#define MIME_VERSION           6
        { "Content-Type:", sizeof ("Content-Type:") - 1 },
-#define CONTENT_TYPE   6
+#define CONTENT_TYPE           7
        { "Content-Transfer-Encoding:",
          sizeof ("Content-Transfer-Encoding:") - 1 }
-#define CONTENT_TRANSFER 7
+#define CONTENT_TRANSFER       8
       };
-#define UNKNOWN        8
+#define UNKNOWN        9
       struct
       {
        const char *string;
@@ -656,6 +658,36 @@ message_merge (message_ty *def, message_ty *ref)
          cp = endp;
        }
 
+      {
+       const char *msgid_bugs_ptr;
+
+       msgid_bugs_ptr = strstr (ref->msgstr, "Report-Msgid-Bugs-To:");
+       if (msgid_bugs_ptr != NULL)
+         {
+           size_t msgid_bugs_len;
+           const char *endp;
+
+           msgid_bugs_ptr += sizeof ("Report-Msgid-Bugs-To:") - 1;
+
+           endp = strchr (msgid_bugs_ptr, '\n');
+           if (endp == NULL)
+             {
+               /* Add a trailing newline.  */
+               char *extended;
+               endp = strchr (msgid_bugs_ptr, '\0');
+               msgid_bugs_len = (endp - msgid_bugs_ptr) + 1;
+               extended = (char *) alloca (msgid_bugs_len + 1);
+               stpcpy (stpcpy (extended, msgid_bugs_ptr), "\n");
+               msgid_bugs_ptr = extended;
+             }
+           else
+             msgid_bugs_len = (endp - msgid_bugs_ptr) + 1;
+
+           header_fields[REPORT_MSGID_BUGS_TO].string = msgid_bugs_ptr;
+           header_fields[REPORT_MSGID_BUGS_TO].len = msgid_bugs_len;
+         }
+      }
+
       {
        const char *pot_date_ptr;
 
@@ -681,8 +713,8 @@ message_merge (message_ty *def, message_ty *ref)
            else
              pot_date_len = (endp - pot_date_ptr) + 1;
 
-           header_fields[POT_CREATION].string = pot_date_ptr;
-           header_fields[POT_CREATION].len = pot_date_len;
+           header_fields[POT_CREATION_DATE].string = pot_date_ptr;
+           header_fields[POT_CREATION_DATE].len = pot_date_len;
          }
       }
 
@@ -702,8 +734,9 @@ message_merge (message_ty *def, message_ty *ref)
                        header_fields[idx].string, header_fields[idx].len)
 
       IF_FILLED (PROJECT_ID);
-      IF_FILLED (POT_CREATION);
-      IF_FILLED (PO_REVISION);
+      IF_FILLED (REPORT_MSGID_BUGS_TO);
+      IF_FILLED (POT_CREATION_DATE);
+      IF_FILLED (PO_REVISION_DATE);
       IF_FILLED (LAST_TRANSLATOR);
       IF_FILLED (LANGUAGE_TEAM);
       IF_FILLED (MIME_VERSION);
index fabbd06721733e547f91e92ea9b8302382a5bd90..74e0b146959a4b08246a4e77f1f34bf67ca42f05 100644 (file)
@@ -102,6 +102,9 @@ static int force_po;
 /* Copyright holder of the output file and the translations.  */
 static const char *copyright_holder = "THE PACKAGE'S COPYRIGHT HOLDER";
 
+/* Email address or URL for reports of bugs in msgids.  */
+static const char *msgid_bugs_address = "";
+
 /* String used as prefix for msgstr.  */
 static const char *msgstr_prefix;
 
@@ -155,6 +158,7 @@ static const struct option long_options[] =
   { "keyword", optional_argument, NULL, 'k' },
   { "keyword-substring", no_argument, NULL, 'K'},
   { "language", required_argument, NULL, 'L' },
+  { "msgid-bugs-address", required_argument, NULL, CHAR_MAX + 5 },
   { "msgstr-prefix", optional_argument, NULL, 'm' },
   { "msgstr-suffix", optional_argument, NULL, 'M' },
   { "no-escape", no_argument, NULL, 'e' },
@@ -384,6 +388,9 @@ main (int argc, char *argv[])
       case CHAR_MAX + 4:       /* --no-wrap */
        message_page_width_ignore ();
        break;
+      case CHAR_MAX + 5:       /* --msgid-bugs-address */
+       msgid_bugs_address = optarg;
+       break;
       default:
        usage (EXIT_FAILURE);
        /* NOTREACHED */
@@ -684,6 +691,7 @@ Output details:\n\
       --omit-header              don't write header with `msgid \"\"' entry\n\
       --copyright-holder=STRING  set copyright holder in output\n\
       --foreign-user             omit FSF copyright in output for foreign user\n\
+      --msgid-bugs-address=EMAIL@ADDRESS  set report address for msgid bugs\n\
   -m, --msgstr-prefix[=STRING]   use STRING or \"\" as prefix for msgstr entries\n\
   -M, --msgstr-suffix[=STRING]   use STRING or \"\" as suffix for msgstr entries\n\
 "));
@@ -1024,7 +1032,8 @@ remember_a_message (message_list_ty *mlp, char *string, lex_pos_ty *pos)
        buffer[0] = '\0';
       else
        sprintf (buffer, ":%ld", (long) pos->line_number);
-      multiline_warning (xasprintf ("%s%s: warning: ", pos->file_name, buffer),
+      multiline_warning (xasprintf (_("%s%s: warning: "), pos->file_name,
+                                   buffer),
                         xstrdup (_("\
 Empty msgid.  It is reserved by GNU gettext:\n\
 gettext(\"\") returns the header entry with\n\
@@ -1246,11 +1255,21 @@ construct_header ()
   char *msgstr;
   static lex_pos_ty pos = { __FILE__, __LINE__, };
 
+  if (msgid_bugs_address[0] == '\0')
+    multiline_warning (xasprintf (_("warning: ")),
+                       xstrdup (_("\
+The option --msgid-bugs-address was not specified.\n\
+If you are using a `Makevars' file, please specify\n\
+the MSGID_BUGS_ADDRESS variable there; otherwise please\n\
+specify an --msgid-bugs-address command line option.\n\
+")));
+
   time (&now);
   timestring = po_strftime (&now);
 
   msgstr = xasprintf ("\
 Project-Id-Version: PACKAGE VERSION\n\
+Report-Msgid-Bugs-To: %s\n\
 POT-Creation-Date: %s\n\
 PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n\
 Last-Translator: FULL NAME <EMAIL@ADDRESS>\n\
@@ -1258,7 +1277,7 @@ Language-Team: LANGUAGE <LL@li.org>\n\
 MIME-Version: 1.0\n\
 Content-Type: text/plain; charset=CHARSET\n\
 Content-Transfer-Encoding: 8bit\n",
-                     timestring);
+                     msgid_bugs_address, timestring);
   free (timestring);
 
   mp = message_alloc ("", NULL, msgstr, strlen (msgstr) + 1, &pos);