Fix translation infrastructure
PATCH 1/1 Fix translation infrastructure
Our translation handling has been pretty broken since switching to Automake, and it isn't even possible to update the POT file right now. The following patch switches over to a reasonably standard gettext layout for the po/ directory, with the exception that I modified po/Makefile.in.in (as suggested in the gettext documentation) to handle POTFILES-shell.in.
This patch is very large, but most of it consists of running 'gettextize', reverting some bits that were just due to different versions of libtool and the like on different developers' systems, and then running the gnulib-tool command recorded in m4/gnulib-cache.m4 with a version of gnulib matching what Yves said he was using (today's git HEAD, 92074aac5a16846cd07e964d11275c5ef8e4ac78).
2010-09-20 Colin Watson <[email protected]>
Fix po directory handling.
* configure.ac: Create po/Makefile.in rather than po/Makefile.
* grub-core/gnulib/Makefile.am: Import gettext module.
* m4/gnulib-cache.m4: Likewise.
* m4/gnulib-comp.m4: Likewise.
* m4/gettext.m4: New file, from gnulib.
* m4/glibc2.m4: Likewise.
* m4/iconv.m4: Likewise.
* m4/intdiv0.m4: Likewise.
* m4/intl.m4: Likewise.
* m4/intldir.m4: Likewise.
* m4/intlmacosx.m4: Likewise.
* m4/intmax.m4: Likewise.
* m4/inttypes-pri.m4: Likewise.
* m4/lcmessage.m4: Likewise.
* m4/lib-ld.m4: Likewise.
* m4/lib-link.m4: Likewise.
* m4/lib-prefix.m4: Likewise.
* m4/lock.m4: Likewise.
* m4/nls.m4: Likewise.
* m4/po.m4: Likewise.
* m4/printf-posix.m4: Likewise.
* m4/progtest.m4: Likewise.
* m4/threadlib.m4: Likewise.
* m4/uintmax_t.m4: Likewise.
* m4/visibility.m4: Likewise.
* po/Makefile.am: Remove.
* po/Makefile.in.in: New file, from gettext. ($(DOMAIN).pot-update): Support POTFILES-shell.
* po/Makevars: New file.
* po/POTFILES-shell: Rename to ...
* po/POTFILES-shell.in: ... this. Update.
* po/POTFILES: Rename to ...
* po/POTFILES.in: ... this. Update.
* po/Rules-quot: New file, from gettext.
* po/boldquot.sed: Likewise.
* po/[email protected]: Likewise.
* po/[email protected]: Likewise.
* po/insert-header.sin: Likewise.
* po/quot.sed: Likewise.
* po/remove-potcdate.sin: Likewise.
=== modified file 'configure.ac'
configure.ac +1 -1
@@ -934,7 +934,7 @@ fi AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([grub-core/Makefile]) AC_CONFIG_FILES([grub-core/gnulib/Makefile]) -AC_CONFIG_FILES([po/Makefile]) +AC_CONFIG_FILES([po/Makefile.in]) AC_CONFIG_FILES([docs/Makefile]) AC_CONFIG_FILES([util/bash-completion.d/Makefile]) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
=== modified file 'grub-core/gnulib/Makefile.am'
gnulib/Makefile.am +24 -1
@@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline progname regex +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex AUTOMAKE_OPTIONS = 1.5 gnits
@@ -322,12 +322,35 @@ EXTRA_libgnu_a_SOURCES += getopt.c getop ## end gnulib module getopt-posix +## begin gnulib module gettext + +# This is for those projects which use "gettextize --intl" to put a source-code +# copy of libintl into their package. In such projects, every Makefile.am needs +# -I$(top_builddir)/intl, so that <libintl.h> can be found in this directory. +# For the Makefile.ams in other directories it is the maintainer's +# responsibility; for the one from gnulib we do it here. +# This option has no effect when the user disables NLS (because then the intl +# directory contains no libintl.h file) or when the project does not use +# "gettextize --intl". +AM_CPPFLAGS += -I$(top_builddir)/intl + +EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath + +## end gnulib module gettext + ## begin gnulib module gettext-h libgnu_a_SOURCES += gettext.h ## end gnulib module gettext-h +## begin gnulib module havelib + + +EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath + +## end gnulib module havelib + ## begin gnulib module intprops
=== added file 'm4/gettext.m4'
gettext.m4 +401 -0
401 lines not on this page · raw message
=== added file 'm4/glibc2.m4'
glibc2.m4 +30 -0
@@ -0,0 +1,30 @@ +# glibc2.m4 serial 2 +dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Test for the GNU C Library, version 2.0 or newer. +# From Bruno Haible. + +AC_DEFUN([gt_GLIBC2], + [ + AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer], + [ac_cv_gnu_library_2], + [AC_EGREP_CPP([Lucky GNU user], + [ +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ >= 2) + Lucky GNU user + #endif +#endif + ], + [ac_cv_gnu_library_2=yes], + [ac_cv_gnu_library_2=no]) + ] + ) + AC_SUBST([GLIBC2]) + GLIBC2="$ac_cv_gnu_library_2" + ] +)
=== modified file 'm4/gnulib-cache.m4'
gnulib-cache.m4 +2 -1
@@ -15,7 +15,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline progname regex +# gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([])
@@ -25,6 +25,7 @@ gl_MODULES([ fnmatch getdelim getline + gettext progname regex ])
=== modified file 'm4/gnulib-comp.m4'
gnulib-comp.m4 +28 -0
@@ -45,7 +45,9 @@ AC_DEFUN([gl_EARLY], # Code from module getline: # Code from module getopt-gnu: # Code from module getopt-posix: + # Code from module gettext: # Code from module gettext-h: + # Code from module havelib: # Code from module include_next: # Code from module intprops: # Code from module langinfo:
@@ -150,9 +152,13 @@ AC_DEFUN([gl_INIT], gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) # Code from module getopt-posix: gl_FUNC_GETOPT_POSIX + # Code from module gettext: + dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. + AM_GNU_GETTEXT_VERSION([0.18.1]) # Code from module gettext-h: AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) + # Code from module havelib: # Code from module include_next: # Code from module intprops: # Code from module langinfo:
@@ -400,6 +406,7 @@ AC_DEFUN([gltests_LIBSOURCES], [ AC_DEFUN([gl_FILE_LIST], [ build-aux/arg-nonnull.h build-aux/c++defs.h + build-aux/config.rpath build-aux/warn-on-use.h lib/alloca.c lib/alloca.in.h
@@ -517,16 +524,30 @@ AC_DEFUN([gl_FILE_LIST], [ m4/getdelim.m4 m4/getline.m4 m4/getopt.m4 + m4/gettext.m4 + m4/glibc2.m4 m4/glibc21.m4 m4/gnulib-common.m4 + m4/iconv.m4 m4/include_next.m4 + m4/intdiv0.m4 + m4/intl.m4 + m4/intldir.m4 + m4/intlmacosx.m4 + m4/intmax.m4 m4/intmax_t.m4 + m4/inttypes-pri.m4 m4/inttypes_h.m4 m4/langinfo_h.m4 + m4/lcmessage.m4 + m4/lib-ld.m4 + m4/lib-link.m4 + m4/lib-prefix.m4 m4/localcharset.m4 m4/locale-fr.m4 m4/locale-ja.m4 m4/locale-zh.m4 + m4/lock.m4 m4/longlong.m4 m4/malloc.m4 m4/mbrtowc.m4
@@ -538,7 +559,11 @@ AC_DEFUN([gl_FILE_LIST], [ m4/mmap-anon.m4 m4/multiarch.m4 m4/nl_langinfo.m4 + m4/nls.m4 + m4/po.m4 + m4/printf-posix.m4 m4/printf.m4 + m4/progtest.m4 m4/rawmemchr.m4 m4/realloc.m4 m4/regex.m4
@@ -560,8 +585,11 @@ AC_DEFUN([gl_FILE_LIST], [ m4/strnlen.m4 m4/sys_wait_h.m4 m4/sysexits.m4 + m4/threadlib.m4 + m4/uintmax_t.m4 m4/unistd_h.m4 m4/vasnprintf.m4 + m4/visibility.m4 m4/vsnprintf.m4 m4/warn-on-use.m4 m4/wchar_h.m4
=== added file 'm4/iconv.m4'
iconv.m4 +256 -0
256 lines not on this page · raw message
=== added file 'm4/intdiv0.m4'
intdiv0.m4 +87 -0
87 lines not on this page · raw message
=== added file 'm4/intl.m4'
intl.m4 +300 -0
300 lines not on this page · raw message
=== added file 'm4/intldir.m4'
intldir.m4 +19 -0
@@ -0,0 +1,19 @@ +# intldir.m4 serial 2 (gettext-0.18) +dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +AC_PREREQ([2.52]) + +dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory. +AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
=== added file 'm4/intlmacosx.m4'
intlmacosx.m4 +56 -0
56 lines not on this page · raw message
=== added file 'm4/intmax.m4'
intmax.m4 +36 -0
@@ -0,0 +1,36 @@ +# intmax.m4 serial 6 (gettext-0.18.2) +dnl Copyright (C) 2002-2005, 2008-2010 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Test whether the system has the 'intmax_t' type, but don't attempt to +dnl find a replacement if it is lacking. + +AC_DEFUN([gt_TYPE_INTMAX_T], +[ + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stddef.h> +#include <stdlib.h> +#if HAVE_STDINT_H_WITH_UINTMAX +#include <stdint.h> +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include <inttypes.h> +#endif + ]], + [[intmax_t x = -1; + return !x;]])], + [gt_cv_c_intmax_t=yes], + [gt_cv_c_intmax_t=no])]) + if test $gt_cv_c_intmax_t = yes; then + AC_DEFINE([HAVE_INTMAX_T], [1], + [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) + fi +])
=== added file 'm4/inttypes-pri.m4'
inttypes-pri.m4 +42 -0
42 lines not on this page · raw message
=== added file 'm4/lcmessage.m4'
lcmessage.m4 +35 -0
@@ -0,0 +1,35 @@ +# lcmessage.m4 serial 7 (gettext-0.18.2) +dnl Copyright (C) 1995-2002, 2004-2005, 2008-2010 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <[email protected]>, 1995. + +# Check whether LC_MESSAGES is available in <locale.h>. + +AC_DEFUN([gt_LC_MESSAGES], +[ + AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <locale.h>]], + [[return LC_MESSAGES]])], + [gt_cv_val_LC_MESSAGES=yes], + [gt_cv_val_LC_MESSAGES=no])]) + if test $gt_cv_val_LC_MESSAGES = yes; then + AC_DEFINE([HAVE_LC_MESSAGES], [1], + [Define if your <locale.h> file defines LC_MESSAGES.]) + fi +])
=== added file 'm4/lib-ld.m4'
lib-ld.m4 +109 -0
109 lines not on this page · raw message
=== added file 'm4/lib-link.m4'
lib-link.m4 +775 -0
775 lines not on this page · raw message
=== added file 'm4/lib-prefix.m4'
lib-prefix.m4 +224 -0
224 lines not on this page · raw message
=== added file 'm4/lock.m4'
lock.m4 +41 -0
41 lines not on this page · raw message
=== added file 'm4/nls.m4'
nls.m4 +32 -0
@@ -0,0 +1,32 @@ +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl This file can can be used in projects which are not available under +dnl the GNU General Public License or the GNU Library General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Library General Public License, and the rest of the GNU +dnl gettext package package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper <[email protected]>, 1995-2000. +dnl Bruno Haible <[email protected]>, 2000-2003. + +AC_PREREQ([2.50]) + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE([nls], + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT([$USE_NLS]) + AC_SUBST([USE_NLS]) +])
=== added file 'm4/po.m4'
po.m4 +449 -0
410 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
=== added file 'm4/printf-posix.m4'
printf-posix.m4 +48 -0
48 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
=== added file 'm4/progtest.m4'
progtest.m4 +91 -0
91 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
=== added file 'm4/threadlib.m4'
threadlib.m4 +362 -0
362 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
=== added file 'm4/uintmax_t.m4'
uintmax_t.m4 +30 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
=== added file 'm4/visibility.m4'
visibility.m4 +77 -0
77 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
=== removed file 'po/Makefile.am'
=== added file 'po/Makefile.in.in'
Makefile.in.in +464 -0
464 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
=== added file 'po/Makevars'
Makevars +41 -0
41 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
=== renamed file 'po/POTFILES-shell' => 'po/POTFILES-shell.in'
POTFILES-shell.in renamed from POTFILES-shell +2 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
=== renamed file 'po/POTFILES' => 'po/POTFILES.in'
POTFILES.in renamed from POTFILES +113 -76
189 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
=== added file 'po/Rules-quot'
Rules-quot +47 -0
47 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
=== added file 'po/boldquot.sed'
boldquot.sed +10 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
=== added file 'po/[email protected]'
[email protected] +25 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
=== added file 'po/[email protected]'
[email protected] +22 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
=== added file 'po/insert-header.sin'
insert-header.sin +23 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
=== added file 'po/quot.sed'
quot.sed +6 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
=== added file 'po/remove-potcdate.sin'
remove-potcdate.sin +19 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
Colin Watson [[email protected]]
Part of the diff is not shown here. View the raw message.