I wrote:
> So, IMO, the following code from coreutils' function emit_ancillary_info
> should go away:

Here are two proposed patches, one for gnulib, one for coreutils.

With this, the man page output of 'tr' is changed to contain:

 ------------------------------------------------------------------------------
REPORTING BUGS
       Report bugs to: <[email protected]>.
       Report any translation bugs to: <https://translationproject.org/team/>.
       GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
       General help using GNU software: <https://www.gnu.org/gethelp/>
 ------------------------------------------------------------------------------

Bruno
>From 20c8ac528e54c7ea7c044e611f46466fbe4aae43 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Fri, 24 Apr 2026 15:31:00 +0200
Subject: [PATCH] version-etc: Optionally emit another line for the man page.

* lib/version-etc.c: Include <stdlib.h>.
(emit_bug_reporting_address): Terminate the "Report bugs to" sentence,
as suggested in
https://www.gnu.org/software/gettext/manual/html_node/Bug-Report-Address.html.
Add a "Report any translation bugs to" sentence, but only when producing
a man page.
---
 ChangeLog         | 10 ++++++++++
 lib/version-etc.c | 11 ++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3d5eeade61..72c388b678 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-04-24  Bruno Haible  <[email protected]>
+
+	version-etc: Optionally emit another line for the man page.
+	* lib/version-etc.c: Include <stdlib.h>.
+	(emit_bug_reporting_address): Terminate the "Report bugs to" sentence,
+	as suggested in
+	https://www.gnu.org/software/gettext/manual/html_node/Bug-Report-Address.html.
+	Add a "Report any translation bugs to" sentence, but only when producing
+	a man page.
+
 2026-04-23  Paul Eggert  <[email protected]>
 
 	wchar-h: <string.h> namespace cleanup
diff --git a/lib/version-etc.c b/lib/version-etc.c
index b5778709b7..d6131a0bfd 100644
--- a/lib/version-etc.c
+++ b/lib/version-etc.c
@@ -23,6 +23,7 @@
 
 #include <stdarg.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #if USE_UNLOCKED_IO
 # include "unlocked-io.h"
@@ -245,7 +246,15 @@ emit_bug_reporting_address (void)
      for this package.  Please add _another line_ saying
      "Report translation bugs to <...>\n" with the address for translation
      bugs (typically your translation team's web or email address).  */
-  printf (_("Report bugs to: %s\n"), PACKAGE_BUGREPORT);
+  printf (_("Report bugs to: <%s>.\n"), PACKAGE_BUGREPORT);
+#ifdef PACKAGE_L10N_BUGREPORT
+  /* PACKAGE_L10N_BUGREPORT may be defined to the URL of the package's
+     translation project, e.g. "https://translationproject.org/team/";.  */
+  /* Get this reporting instruction included in the (English) man page
+     only.  No need to include it in the normal --help output.  */
+  if (getenv ("IN_HELP2MAN") != NULL)
+    printf ("Report any translation bugs to: <%s>.\n", PACKAGE_L10N_BUGREPORT);
+#endif
 #ifdef PACKAGE_PACKAGER_BUG_REPORTS
   printf (_("Report %s bugs to: %s\n"), PACKAGE_PACKAGER,
           PACKAGE_PACKAGER_BUG_REPORTS);
-- 
2.52.0

>From d60a493409efe5f74d60c99e05dee7995f710080 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Fri, 24 Apr 2026 15:36:51 +0200
Subject: [PATCH] maint: Remove redundant "Report translation bugs to" in
 --help output

Reported by Rafael Fontenelle <[email protected]> in
<https://bugs.gnu.org/80886>.

* configure.ac: Define PACKAGE_L10N_BUGREPORT.
* man/local.mk (run_help2man): Set the IN_HELP2MAN environment variable.
* src/system.h (emit_ancillary_info): Don't emit "Report any translation
bugs to" line; this is already done by emit_bug_reporting_address() in
version-etc.c.
---
 configure.ac |  4 ++++
 man/local.mk |  2 +-
 src/system.h | 12 ------------
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index f60db9915..474557662 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,6 +153,10 @@ if test "$gl_bold_manpages" != no; then
 fi
 AM_CONDITIONAL([BOLD_MAN_REFS], [test "$gl_bold_manpages" != no])
 
+# When generating manual pages, include a "Report any translation bugs" line.
+AC_DEFINE([PACKAGE_L10N_BUGREPORT], ["https://translationproject.org/team/";],
+  [Define to the URL of your translation project.])
+
 AC_ARG_ENABLE([manual-url],
   [AS_HELP_STRING([--enable-manual-url@<:@=<url>@:>@],
      [When generating man pages, or displaying --help, generate hyperlinks
diff --git a/man/local.mk b/man/local.mk
index 92cfebadd..156b0e18c 100644
--- a/man/local.mk
+++ b/man/local.mk
@@ -27,7 +27,7 @@ if HAVE_PERL
 if BOLD_MAN_REFS
 help2man_OPTS=--bold-refs
 endif
-run_help2man = env TERM=not_dumb $(PERL) -- \
+run_help2man = env IN_HELP2MAN=1 TERM=not_dumb $(PERL) -- \
 	       $(srcdir)/man/help2man --loose-indent $(help2man_OPTS)
 else
 run_help2man = $(SHELL) $(srcdir)/man/dummy-man
diff --git a/src/system.h b/src/system.h
index d3c5f08a7..545377335 100644
--- a/src/system.h
+++ b/src/system.h
@@ -870,18 +870,6 @@ emit_ancillary_info (char const *program)
 
   emit_bug_reporting_address ();
 
-  /* Don't output this redundant message for English locales.
-     Note we still output for 'C' so that it gets included in the man page.  */
-  char const *lc_messages = setlocale (LC_MESSAGES, NULL);
-  if (lc_messages && STRNCMP_LIT (lc_messages, "en_"))
-    {
-      /* TRANSLATORS: Replace LANG_CODE in this URL with your language code
-         <https://translationproject.org/team/LANG_CODE.html> to form one of
-         the URLs at https://translationproject.org/team/.  Otherwise, replace
-         the entire URL with your translation team's email address.  */
-      fputs (_("Report any translation bugs to "
-               "<https://translationproject.org/team/>\n"), stdout);
-    }
   /* .htaccess on the coreutils web site maps programs to the appropriate page,
      however we explicitly handle "[" -> "test" here as the "[" is not
      recognized as part of a URL by default in terminals.  */
-- 
2.52.0

Reply via email to