bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help: gnulib: let it use its own PO domain


From: Akim Demaille
Subject: help: gnulib: let it use its own PO domain
Date: Fri, 8 Feb 2019 07:04:51 +0100

Hi Paul,

I'm lost here.  I've tried many different approaches, but it failed each time: 
when I apply the following patch, Bison is no longer internationalized. I don't 
get any translation: not those of Bison itself, nor those of gnulib. I must be 
doing something wrong, but I don't understand what.

So my goal is to relieve translators of Bison from translating gnulib using 
gnulib-tool's --po-base and --po-domain.  If I can move from the gettext module 
to the gettext-h module, that would be good too, but that change has no 
influence at all: no translations in either case.

I am conservative on the required version of Gettext, because the CI also runs 
on an old Debian, which has an old version of Gettext.  Of course it would be 
better for the CI to have a recent distro build the tarball and run the tarball 
on old platforms, but I don't have that now, and I'm not sure how to do that.

I have pushed this in the 'gnulib-po' branch, both on Savannah, and here: 
https://github.com/akimd/bison/tree/gnulib-po.  The CI is running on it here:

https://travis-ci.org/akimd/bison/builds/490399748

Thanks!

commit 4c493bb31b9981b9e121e1f27c8b15cb762a2d42
Author: Akim Demaille <address@hidden>
Date:   Sun Oct 7 08:25:21 2018 +0200

    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.

diff --git a/Makefile.am b/Makefile.am
index d32b14a9..5080229b 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/bootstrap.conf b/bootstrap.conf
index 1e58284a..79bd899f 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -84,7 +84,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 1b5343e7..c51ef782 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,8 +248,9 @@ AM_WITH_DMALLOC
 # We use gnulib, which is only guaranteed to work properly with the
 # latest Gettext.
 AM_GNU_GETTEXT([external], [need-ngettext])
-AM_GNU_GETTEXT_VERSION([0.18])
+AM_GNU_GETTEXT_VERSION([0.18.3])
 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 954d1e36..30f8dae4 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 954d1e36aa815994f7f5b1fcd46ebc96a63b8df4
+Subproject commit 30f8dae4c7a629eb5d227b1a39bc56b373e7ce12
diff --git a/m4/.gitignore b/m4/.gitignore
index 43cae90b..ddf13a32 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -5,6 +5,8 @@
 /asm-underscore.m4
 /assert.m4
 /calloc.m4
+/canonicalize.m4
+/clock_time.m4
 /close-stream.m4
 /close.m4
 /closeout.m4
@@ -37,15 +39,20 @@
 /fseterr.m4
 /fstat.m4
 /getdtablesize.m4
+/gethrxtime.m4
 /getopt.m4
 /getprogname.m4
+/getrusage.m4
 /gettext.m4
+/gettime.m4
+/gettimeofday.m4
 /glibc2.m4
 /glibc21.m4
 /gnulib-cache.m4
 /gnulib-common.m4
 /gnulib-comp.m4
 /gnulib-tool.m4
+/host-cpu-c-abi.m4
 /iconv.m4
 /include_next.m4
 /intdiv0.m4
@@ -76,6 +83,7 @@
 /locale-fr.m4
 /locale-ja.m4
 /locale-zh.m4
+/localtime-buffer.m4
 /lock.m4
 /longlong.m4
 /lstat.m4
@@ -117,9 +125,13 @@
 /quotearg.m4
 /raise.m4
 /rawmemchr.m4
+/readlink.m4
 /realloc.m4
+/relocatable-lib.m4
+/relocatable.m4
 /sched_h.m4
 /setenv.m4
+/sh-filename.m4
 /sig_atomic_t.m4
 /sigaction.m4
 /signal_h.m4
@@ -132,6 +144,7 @@
 /spawn_h.m4
 /sprintf-posix.m4
 /ssize_t.m4
+/stat-time.m4
 /stat.m4
 /stdbool.m4
 /stddef_h.m4
@@ -148,12 +161,16 @@
 /strndup.m4
 /strnlen.m4
 /strverscmp.m4
+/sys_resource_h.m4
 /sys_socket_h.m4
 /sys_stat_h.m4
+/sys_time_h.m4
+/sys_times_h.m4
 /sys_types_h.m4
 /sys_wait_h.m4
 /threadlib.m4
 /time_h.m4
+/timespec.m4
 /uintmax_t.m4
 /unistd-safer.m4
 /unistd_h.m4
@@ -177,21 +194,3 @@
 /xalloc.m4
 /xsize.m4
 /xstrndup.m4
-/host-cpu-c-abi.m4
-/stat-time.m4
-/sys_time_h.m4
-/sys_times_h.m4
-/sh-filename.m4
-/clock_time.m4
-/gethrxtime.m4
-/getrusage.m4
-/gettime.m4
-/gettimeofday.m4
-/localtime-buffer.m4
-/sys_resource_h.m4
-/timespec.m4
-/intl-thread-locale.m4
-/canonicalize.m4
-/readlink.m4
-/relocatable-lib.m4
-/relocatable.m4
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 7704bef4..45d04709 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");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]