From a11bfc2d4e008fceceed4a1ad0a98a66c909e87e Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Sun, 27 Dec 2020 21:15:45 +0100 Subject: [PATCH] Use a separate domain for translating gnulib Use the --po-domain option to gnulib-tool to create a new textdomain that can be used by gnulib files for translations. This way, we don't have to maintain the list of all files that require translations in gnulib. * bootstrap.conf: Use --po-domain and --po-base options to create a separate base for gnulib translations * src/main.c(i18n_initialize): Call bindtextdomain on wget-gnulib to include those translations as well * Makefile.am: Add new directory gnulib_po to SUBDIRS * configure.ac: Generate gnulib_po/Makefile.in * lib/Makefile.am: Set AM_CPPFLAGS to empty since gnulib.mk expects it to be set --- Makefile.am | 2 +- bootstrap.conf | 2 +- configure.ac | 4 ++-- lib/Makefile.am | 1 + src/main.c | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 291f478e..ddc9fd73 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,7 +40,7 @@ distuninstallcheck_listfiles = find . -type f | \ ACLOCAL_AMFLAGS = -I m4 # subdirectories in the distribution -SUBDIRS = lib src doc po util fuzz tests testenv +SUBDIRS = lib src doc po gnulib_po util fuzz tests testenv EXTRA_DIST = MAILING-LIST \ msdos/config.h msdos/Makefile.DJ \ diff --git a/bootstrap.conf b/bootstrap.conf index 5e1014ad..577c4b6d 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -20,7 +20,7 @@ source_base=lib tests_base=lib/tests gnulib_name=libgnu -gnulib_tool_option_extras="--makefile-name=gnulib.mk" +gnulib_tool_option_extras="--makefile-name=gnulib.mk --po-base=gnulib_po --po-domain=wget" use_libtool=0 checkout_only_file= diff --git a/configure.ac b/configure.ac index f8c9e8e7..09178fa0 100644 --- a/configure.ac +++ b/configure.ac @@ -996,8 +996,8 @@ dnl dnl Create output dnl AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile util/Makefile - po/Makefile.in tests/Makefile fuzz/Makefile - lib/Makefile testenv/Makefile + po/Makefile.in gnulib_po/Makefile.in tests/Makefile + fuzz/Makefile lib/Makefile testenv/Makefile tests/certs/interca.conf tests/certs/rootca.conf]) AC_CONFIG_HEADERS([src/config.h]) AC_OUTPUT diff --git a/lib/Makefile.am b/lib/Makefile.am index d90142a5..e58fa284 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -9,5 +9,6 @@ noinst_LIBRARIES = MAINTAINERCLEANFILES = AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) +AM_CPPFLAGS = include gnulib.mk diff --git a/src/main.c b/src/main.c index 339a5fd4..4965c1eb 100644 --- a/src/main.c +++ b/src/main.c @@ -153,6 +153,7 @@ i18n_initialize (void) setlocale (LC_ALL, ""); /* Set the text message domain. */ bindtextdomain ("wget", LOCALEDIR); + bindtextdomain ("wget-gnulib", LOCALEDIR); textdomain ("wget"); #elif defined WINDOWS char MBCP[16] = "";