Subject: Re: bug#76034: bug#76034: Status of gnulib-l10n in diffutils

From: Simon Josefsson <[email-masked]>
Date: Mon, 03 Feb 2025 22:42:12 +0100

Paul Eggert <[email-masked]> writes:

> On 2/3/25 12:15, Santiago Vila wrote:
>> So: Will diffutils really do the same at some point?
>
> I don't see why not. We didn't get around to it for 3.11, though.

Something like this perhaps?

/Simon
From 280f6a66819e6e2738498a6f37e09a50058cd9f0 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <[email-masked]>
Date: Mon, 3 Feb 2025 22:40:16 +0100
Subject: [PATCH] cmp, diff, diff3, sdiff: Support gnulib-l10n.

* src/cmp.c (main): Call bindtextdomain for gnulib-l10n.
src/diff.c (main): Likewise.
src/diff3.c (main): Likewise.
src/sdiff.c (main: Likewise.
---
 src/cmp.c   | 1 +
 src/diff.c  | 1 +
 src/diff3.c | 1 +
 src/sdiff.c | 1 +
 4 files changed, 4 insertions(+)

diff --git a/src/cmp.c b/src/cmp.c
index 26067d9..2482708 100644
--- a/src/cmp.c
+++ b/src/cmp.c
@@ -208,6 +208,7 @@ main (int argc, char **argv)
   set_program_name (argv[0]);
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
+  bindtextdomain ("gnulib", GNULIB_LOCALEDIR);
   textdomain (PACKAGE);
   c_stack_action (nullptr);
   xstdopen ();
diff --git a/src/diff.c b/src/diff.c
index c465d40..fa6100e 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -303,6 +303,7 @@ main (int argc, char **argv)
   set_program_name (argv[0]);
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
+  bindtextdomain ("gnulib", GNULIB_LOCALEDIR);
   textdomain (PACKAGE);
   c_stack_action (nullptr);
   function_regexp_list.buf = &function_regexp;
diff --git a/src/diff3.c b/src/diff3.c
index 1b935f8..fa5f5a6 100644
--- a/src/diff3.c
+++ b/src/diff3.c
@@ -233,6 +233,7 @@ main (int argc, char **argv)
   set_program_name (argv[0]);
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
+  bindtextdomain ("gnulib", GNULIB_LOCALEDIR);
   textdomain (PACKAGE);
   c_stack_action (nullptr);
   xstdopen ();
diff --git a/src/sdiff.c b/src/sdiff.c
index 07b4510..7734a82 100644
--- a/src/sdiff.c
+++ b/src/sdiff.c
@@ -449,6 +449,7 @@ main (int argc, char *argv[])
   set_program_name (argv[0]);
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
+  bindtextdomain ("gnulib", GNULIB_LOCALEDIR);
   textdomain (PACKAGE);
   c_stack_action (cleanup);
   xstdopen ();
-- 
2.48.1