From a4d33cdf48511a81a3311f4c2f618099d861c746 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 7 Oct 2018 08:25:21 +0200 Subject: [PATCH] gnulib: let it use its own PO domain See https://www.gnu.org/software/gnulib/manual/html_node/Localization.html. * bootstrap.conf: Create gnulib-po. * Makefile.am, configure.ac: Use it. * po/POTFILES.in: Remove files now in gnulib. * src/main.c: Open the bison-gnulib domain. --- Makefile.am | 2 +- TODO | 8 -------- bootstrap.conf | 2 +- configure.ac | 1 + gnulib | 2 +- po/POTFILES.in | 12 ------------ src/main.c | 7 ++++--- 7 files changed, 8 insertions(+), 26 deletions(-) diff --git a/Makefile.am b/Makefile.am index 673501ee..3c4c8765 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,7 +18,7 @@ AUTOMAKE_OPTIONS = subdir-objects ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = po runtime-po . +SUBDIRS = po runtime-po gnulib-po . # Files installed for use by Automake. aclocaldir = @aclocaldir@ diff --git a/TODO b/TODO index f7766862..2264c8f7 100644 --- a/TODO +++ b/TODO @@ -1,13 +1,5 @@ * Bison 3.4 ** use gettext-h in gnulib instead of gettext -** use gnulib-po -For some reason, according to syntax-check, we have to keep getopt.c in -POTIFILES.in, but not bitset/stats.c, although both come from gnulib. But -bitset/stats.c is a symlink, not getopt.c. This is fishy and should be -fixed. - -Meanwhile, bitset/stats.c is removed from the set of translations, which is -not too much of a problem as users are not expected to see this. ** bad diagnostics %token NUM diff --git a/bootstrap.conf b/bootstrap.conf index c32acb59..6d1f9a44 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -85,7 +85,7 @@ excluded_files=' m4/visibility.m4 ' -gnulib_tool_option_extras='--symlink --conditional-dependencies --makefile-name=gnulib.mk' +gnulib_tool_option_extras='--symlink --conditional-dependencies --makefile-name=gnulib.mk --po-base=gnulib-po --po-domain=bison' bootstrap_post_import_hook() { diff --git a/configure.ac b/configure.ac index 507e6f64..7520ab38 100644 --- a/configure.ac +++ b/configure.ac @@ -251,6 +251,7 @@ AM_WITH_DMALLOC AM_GNU_GETTEXT([external], [need-ngettext]) AM_GNU_GETTEXT_VERSION([0.18]) BISON_I18N +AC_CONFIG_FILES([gnulib-po/Makefile.in]) # Internationalized parsers. AC_CONFIG_FILES([runtime-po/Makefile.in]) diff --git a/gnulib b/gnulib index d6af2417..14a92019 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit d6af24178ca4b952327226ad64a4daad8e19109f +Subproject commit 14a920195eee84550cfdd7a161896363d4796a22 diff --git a/po/POTFILES.in b/po/POTFILES.in index 5028e179..97f2473c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -17,15 +17,3 @@ src/scan-code.l src/scan-gram.l src/scan-skel.l src/symtab.c - -lib/argmatch.c -lib/closeout.c -lib/error.c -lib/getopt.c -lib/obstack.c -lib/spawn-pipe.c -lib/quotearg.c -lib/timevar.c -lib/w32spawn.h -lib/wait-process.c -lib/xalloc-die.c diff --git a/src/main.c b/src/main.c index 8b48ad27..3c51eafe 100644 --- a/src/main.c +++ b/src/main.c @@ -66,11 +66,12 @@ main (int argc, char *argv[]) { char *cp = NULL; char const *localedir = relocate2 (LOCALEDIR, &cp); - (void) bindtextdomain (PACKAGE, localedir); - (void) bindtextdomain ("bison-runtime", localedir); + bindtextdomain ("bison", localedir); + bindtextdomain ("bison-gnulib", localedir); + bindtextdomain ("bison-runtime", localedir); free (cp); } - (void) textdomain (PACKAGE); + textdomain ("bison"); { char const *cp = getenv ("LC_CTYPE");