Bruno Haible [Sun, 4 Nov 2018 18:41:53 +0000 (19:41 +0100)]
xgettext: New test of concatenation of strings with escape sequences.
Reported by Morten Welinder <mwelinder@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2015-12/msg00017.html>
and <https://savannah.gnu.org/bugs/?46756>.
* gettext-tools/tests/xgettext-c-23: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Wed, 24 Oct 2018 23:41:42 +0000 (01:41 +0200)]
po, examples: Change .po -> .gmo rules to consider the newest changes to the POT file.
Reported by Claude Paroz <claude@2xlibre.net>
in <https://savannah.gnu.org/bugs/?50910>.
* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Set MSGMERGE_FOR_MSGFMT_OPTION.
* gettext-runtime/po/Makefile.in.in (MSGMERGE): Use GNU msgmerge, even if not
first in $PATH.
(MSGMERGE_FOR_MSGFMT_OPTION): New variable.
(.po.gmo): Depend on the POT file. Use msgmerge on the fly, to take into
account the most recent POT file changes.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise, also for the .po.qm,
update-properties, update-classes targets.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile
(MSGMERGE_FOR_MSGFMT_OPTION): New variable.
($(STRINGSFILES)): Depend on the POT file. Use msgmerge on the fly, to take
into account the most recent POT file changes.
Bruno Haible [Wed, 24 Oct 2018 23:09:38 +0000 (01:09 +0200)]
msgmerge: New option --for-msgfmt.
* gettext-tools/src/msgmerge.c (for_msgfmt): New variable.
(long_options): Add option --for-msgfmt.
(main): Handle option --for-msgfmt.
(usage): Document option --for-msgfmt.
(match_domain): When --for-msgfmt is given, omit untranslated and fuzzy messages
from the result.
(merge): When --for-msgfmt is given, don't add obsolete messages to the result.
* gettext-tools/tests/msgmerge-26: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/msgmerge.texi: Mention the option --for-msgfmt.
* NEWS: Mention the change.
Bruno Haible [Wed, 24 Oct 2018 23:03:32 +0000 (01:03 +0200)]
Add ability to write PO files without translator comment lines.
* gettext-tools/src/write-po.h (message_print_style_comment): New declaration.
* gettext-tools/src/write-po.c (print_comment): New variable.
(message_print_style_comment): New function.
(message_print_comment): Output nothing if print_comment is false.
* gettext-runtime/po/Makefile.in.in: Use $(srcdir)/stamp-po instead of stamp-po.
Talk about "version control system", not CVS.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise.
* gettext-tools/examples/po/Makefile.am: Likewise.
* gettext-tools/examples/check-examples (func_check_dist_vpath): Verify the
stamp-po file does not exist in the build dir, except when using the older
Makefile.in.in infrastructure.
* NEWS: Mention the change.
* gettext-runtime/po/Makefile.in.in (maintainer-clean): Remove the .pot file.
* gettext-tools/examples/hello-*/po/Makefile.am (MAINTAINERCLEANFILES): Add
the .pot file.
* gettext-tools/examples/po/Makefile.am (MAINTAINERCLEANFILES): Likewise.
* gettext-tools/examples/check-examples (func_check_maintainerclean,
func_check_maintainerclean_vpath): Verify the .pot file is removed after
'make maintainer-clean', except when using the older Makefile.in.in
infrastructure.
Bruno Haible [Tue, 23 Oct 2018 22:46:52 +0000 (00:46 +0200)]
examples: Add support for msgmerge --previous.
This mirrors the Makefile.in.in change from 2016-07-01.
* gettext-tools/examples/hello-*/po/Makefile.am ($(POFILES), update-po): Use
option --previous when the msgmerge program supports it.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.
Bruno Haible [Tue, 23 Oct 2018 22:45:52 +0000 (00:45 +0200)]
examples: Support reading header comments from file.
This mirrors the Makefile.in.in change from 2015-09-01 with the amendment
from today.
* gettext-tools/examples/hello-*/po/Makefile.am ($(DOMAIN).pot-update):
Replace header entry with the content of $(DOMAIN).pot-header, if exists.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.
Bruno Haible [Tue, 23 Oct 2018 22:31:23 +0000 (00:31 +0200)]
examples: Avoid grepping through monster files.
This mirrors the Makefile.in.in change from 2010-06-12.
Reported by Jim Meyering <jim@meyering.net>.
* gettext-tools/examples/hello-*/po/Makefile.am (($(DOMAIN).pot-update): When
GNU find is available, avoid grepping through monster files.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.
Bruno Haible [Tue, 23 Oct 2018 22:21:31 +0000 (00:21 +0200)]
po: When doing msgmerge --version, use the correct msgmerge program.
This reverts the patch from
<https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00000.html>.
Rationale:
<https://lists.gnu.org/archive/html/bug-gettext/2018-10/msg00000.html>.
* gettext-runtime/po/Makefile.in.in ($(POFILES)): Use $(MSGMERGE_UPDATE),
not $(MSGMERGE).
Bruno Haible [Tue, 23 Oct 2018 20:48:46 +0000 (22:48 +0200)]
intl: Improve support for per-thread locales on Solaris 11.4.
* gettext-runtime/intl/localename.c: Update from gnulib:
Handle HAVE_SOLARIS114_LOCALES through Solaris specific code.
* gettext-runtime/intl/localename-table.in.h: Update from gnulib's
localename-table.h.
* gettext-runtime/intl/localename-table.c: Update from gnulib.
* gettext-runtime/m4/intl-thread-locale.m4: Renamed from
gettext-runtime/m4/intlsolaris.m4.
(gt_INTL_THREAD_LOCALE_NAME): Renamed from gt_INTL_SOLARIS. Define
HAVE_SOLARIS114_LOCALES instead of HAVE_NAMELESS_LOCALES.
* gettext-runtime/m4/intl.m4: Update from gnulib:
(AM_INTL_SUBDIR): Require gt_INTL_THREAD_LOCALE_NAME. Test for 'uselocale'. Set
HAVE_NAMELESS_LOCALES.
(gt_INTL_SUBDIR_CORE): Don't invoke gt_INTL_SOLARIS. Don't set
HAVE_NAMELESS_LOCALES here.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): List intl-thread-locale.m4, not
intlsolaris.m4.
* gettext-tools/m4/Makefile.am (aclocal_DATA): List intl-thread-locale.m4, not
intlsolaris.m4.
* gettext-tools/misc/gettextize.in (m4filelist): List intl-thread-locale.m4, not
intlsolaris.m4.
* Makefile.am (distcheck-hook): Check intl-thread-locale.m4, not intlsolaris.m4.
* gettext-tools/doc/gettext.texi (aclocal): List intl-thread-locale.m4, not
intlsolaris.m4.
* PACKAGING: List intl-thread-locale.m4, not intlsolaris.m4.
Bruno Haible [Mon, 22 Oct 2018 23:02:02 +0000 (01:02 +0200)]
intl: Add support for per-thread locales on Solaris 11.4.
Relies on the recent changes to the 'localename' module in gnulib.
* gettext-runtime/intl/localename.c: Apply changes from gnulib.
* gettext-runtime/intl/localename-table.h: New file, from gnulib.
* gettext-runtime/intl/localename-table.c: New file, from gnulib.
* gettext-runtime/intl/libgnuintl.in.h (newlocale, duplocale, freelocale): New
overriding declarations.
* gettext-runtime/intl/Makefile.in (HEADERS): Add localename-table.h.
(SOURCES): Add localename-table.c.
(OBJECTS): Add localename-table.$lo.
(localename-table.lo): New target.
(libgnuintl.h, libintl.h): Substitute also HAVE_NAMELESS_LOCALES.
* gettext-runtime/m4/intl.m4: Apply changes from gnulib:
(gt_INTL_SUBDIR_CORE): Don't test for 'uselocale' and 'getlocalename_l'.
Instead, invoke gt_INTL_SOLARIS. Set HAVE_NAMELESS_LOCALES.
* gettext-runtime/m4/intlsolaris.m4: New file, from gnulib.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Add it.
* gettext-tools/m4/Makefile.am (aclocal_DATA): Add intlsolaris.m4.
* gettext-tools/misc/gettextize.in (m4filelist): Add intlsolaris.m4.
* Makefile.am (distcheck-hook): Verify that intlsolaris.m4 is consistent with
gnulib.
* gettext-tools/doc/gettext.texi (aclocal): Add intlsolaris.m4 to the file list.
* PACKAGING: Add intlsolaris.m4 to the list of installed files.
* NEWS: Mention the change.
Bruno Haible [Sun, 21 Oct 2018 08:35:25 +0000 (10:35 +0200)]
New subdirectory system-tests.
* gettext-tools/system-tests/Makefile.am: New file.
* gettext-tools/system-tests/README: New file.
* gettext-tools/system-tests/run-test: New file.
* gettext-tools/system-tests/testlocale.c: New file.
* gettext-tools/system-tests/intl-1-prg.c: New file.
* gettext-tools/system-tests/intl-3-prg.c: New file.
* gettext-tools/system-tests/intl-4-prg.c: New file.
* gettext-tools/system-tests/intl-5-prg.c: New file.
* gettext-tools/system-tests/intl-setlocale-1-prg.c: New file.
* gettext-tools/system-tests/intl-setlocale-2-prg.c: New file.
* gettext-tools/system-tests/intl-thread-1-prg.c: New file.
* gettext-tools/system-tests/intl-thread-2-prg.c: New file.
* gettext-tools/system-tests/intl-thread-3-prg.c: New file.
* gettext-tools/system-tests/format-c-3-prg.c: New file.
* gettext-tools/system-tests/format-c-4-prg.c: New file.
* gettext-tools/system-tests/format-c-5-prg.c: New file.
* gettext-tools/system-tests/plural-1-prg.c: New file.
* gettext-tools/Makefile.am (SUBDIRS): Add system-tests.
* gettext-tools/configure.ac (TEST_SYSTEM_LIBINTL): New conditional.
(AC_CONFIG_FILES): Add system-tests/Makefile.
* gettext-tools/tests/init.cfg: Include init-env from the tests/ directory.
* gettext-tools/tests/intl-5-prg.c: When USE_SYSTEM_LIBINTL is defined, use the
system's <libintl.h>.
* gettext-tools/tests/intl-setlocale-1-prg.c: Likewise.
* gettext-tools/tests/intl-setlocale-2-prg.c: Likewise.
* gettext-tools/tests/intl-thread-1-prg.c: Likewise.
* gettext-tools/tests/intl-thread-2-prg.c: Likewise.
* gettext-tools/tests/intl-thread-3-prg.c: Likewise.
* gettext-tools/tests/intl-1-prg.c: When USE_SYSTEM_LIBINTL is defined, use the
system's <libintl.h>.
* gettext-tools/tests/intl-3-prg.c: Likewise.
* gettext-tools/tests/intl-4-prg.c: Likewise.
* gettext-tools/tests/format-c-3-prg.c: Likewise.
* gettext-tools/tests/format-c-4-prg.c: Likewise.
* gettext-tools/tests/plural-1-prg.c: Likewise.
* gettext-tools/tests/format-c-5-prg.c: When USE_SYSTEM_LIBINTL is defined, use
the system's <libintl.h> and setenv instead of xsetenv, and no fake setlocale.
* gettext-tools/tests/format-c-3: When USE_SYSTEM_LIBINTL is defined, try
$LOCALE_FR and $LOCALE_FR_UTF8.
* gettext-tools/tests/format-c-4: Likewise.
* gettext-tools/tests/plural-1: Likewise.
* gettext-tools/tests/format-c-5: When USE_SYSTEM_LIBINTL is defined, try fa_IR
and fa_IR.UTF-8.
Bruno Haible [Sat, 20 Oct 2018 15:54:03 +0000 (17:54 +0200)]
Rename test gettext-7 to intl-thread-3 and support more platforms.
* gettext-tools/tests/intl-thread-3: Renamed from gettext-tools/tests/gettext-7.
Don't limit to fixed set of platforms.
* gettext-tools/tests/intl-thread-3-prg.c: Renamed from
gettext-tools/tests/gettext-7-prg.c. Expect locale names as arguments.
* gettext-tools/tests/intl-thread-3.po: Renamed from
gettext-tools/tests/gettext-7.po.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Sun, 21 Oct 2018 17:59:28 +0000 (19:59 +0200)]
Make the intl-thread-2 test effective on Solaris 11.
* gettext-tools/m4/locale-de.m4: New file, based on locale-fr.m4 from gnulib.
* gettext-tools/m4/Makefile.am (EXTRA_DIST): Add it.
* gettext-tools/configure.ac: Invoke gt_LOCALE_DE_UTF8.
* gettext-tools/tests/init-env.in: Set LOCALE_DE_UTF8.
* gettext-tools/tests/intl-thread-2: Use a German instead of a Turkish locale.
Bruno Haible [Sat, 20 Oct 2018 15:34:23 +0000 (17:34 +0200)]
Rename test gettext-6 to intl-thread-2 and support more platforms.
* gettext-tools/tests/intl-thread-2: Renamed from gettext-tools/tests/gettext-6.
Don't limit to fixed set of platforms.
* gettext-tools/tests/intl-thread-2-prg.c: Renamed from
gettext-tools/tests/gettext-6-prg.c. Expect locale names as arguments.
* gettext-tools/tests/intl-thread-2-1.po: Renamed from
gettext-tools/tests/gettext-6-2.po. Convert to UTF-8.
* gettext-tools/tests/intl-thread-2-2.po: Renamed from
gettext-tools/tests/gettext-6-1.po. Convert to UTF-8.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Sat, 20 Oct 2018 14:58:33 +0000 (16:58 +0200)]
New test intl-thread-1.
* gettext-tools/tests/intl-thread-1: New file.
* gettext-tools/tests/intl-thread-1-prg.c: New file.
* gettext-tools/tests/intl-thread-1.po: New file.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Sat, 20 Oct 2018 12:21:39 +0000 (14:21 +0200)]
New test intl-2.
* gettext-tools/tests/intl-2: New file.
* gettext-tools/tests/intl-2-1.po: New file.
* gettext-tools/tests/intl-2-2.po: New file.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Sat, 20 Oct 2018 11:53:09 +0000 (13:53 +0200)]
New test intl-1.
* gettext-tools/tests/intl-1: New file.
* gettext-tools/tests/intl-1-prg.c: New file.
* gettext-tools/tests/intl-1.po: New file.
* gettext-tools/tests/Makefile.am: Update.
Bruno Haible [Thu, 18 Oct 2018 18:46:29 +0000 (20:46 +0200)]
examples: hello-pascal: Fix 'make distcheck'.
* gettext-tools/examples/hello-pascal/Makefile.am (hello$(EXEEXT)): Move
hello.rsj into $(srcdir) only if the new contents differs from the old contents.
Bruno Haible [Thu, 18 Oct 2018 19:35:12 +0000 (21:35 +0200)]
examples: hello-java*: Fix 'make distcheck'.
* gettext-tools/examples/hello-java*/po/Makefile.am (update-properties): Create
the new .properties files in the build dir and move them to $(srcdir) only if
the new contents differs from the old contents.
(update-classes): Likewise, also for .class files.
* gettext-tools/examples/hello-csharp*/po/Makefile.am (MAINTAINERCLEANFILES):
Don't list the $(RESOURCESDLLFILES) here.
(maintainer-clean-local): Instead, remove them and their parent directories
here.
Bruno Haible [Wed, 17 Oct 2018 20:03:55 +0000 (22:03 +0200)]
examples: hello-java*: Fix "make dist".
* gettext-runtime/m4/po.m4 (AM_POSTPROCESS_PO_MAKEFILE): Change PROPERTIESFILES
and CLASSFILES to contain files in $(srcdir), not in $(top_srcdir).
* gettext-tools/examples/hello-java*/Makefile.am (hello.jar): Fetch the catalogs
from the po/ directory.
* gettext-tools/examples/hello-java*/po/Makefile.am (MAINTAINERCLEANFILES):
Add the .properties and the .class files.
(EXTRA_DIST): Add the .properties files.
(update-properties, update-classes): Generate the .properties and .class files
in the po/ directory, not in the top-level directory.
* gettext-tools/examples/hello-java*/autoclean.sh: Remove the catalogs in
the po/ directory, not in the top-level directory.
Bruno Haible [Wed, 17 Oct 2018 12:55:58 +0000 (14:55 +0200)]
examples: Fix 'make' failures in VPATH builds.
* gettext-tools/examples/hello-java*/Makefile.am (hello_RESOURCES,
MAINTAINERCLEANFILES): Remove variables.
(hello.jar): Use two jar commands, to combine .class files from the build dir
with .properties files from the source dir.
* gettext-tools/examples/hello-java*/po/Makefile.am (update-properties,
update-classes): Reference the .pot file in the source dir, not in the build
dir.
(echo-catalogs): Include the fallback catalog.
* gettext-tools/examples/hello-pascal/Makefile.am (hello_SOURCES): Add $(srcdir)
prefix.
(hello$(EXEEXT)): Use -o option to specify where the object file and the
executable file shall be created.
Bruno Haible [Tue, 16 Oct 2018 01:14:41 +0000 (03:14 +0200)]
examples: hello-pascal: Update.
* gettext-tools/examples/hello-pascal/configure.ac (PPC): Test for ppcx64 if
ppc386 is not found.
* gettext-tools/examples/hello-pascal/hello.rst: Remove file.
* gettext-tools/examples/hello-pascal/Makefile.am: hello.rsj replaces hello.rst.
(SUBDIRS): Proceed in current directory before recursing into po/.
* gettext-tools/examples/hello-pascal/po/Makefile.am (POTFILES): hello.rsj
replaces hello.rst.
* gettext-tools/examples/hello-pascal/autoclean.sh: Remove hello.rsj.
* gettext-tools/examples/hello-c++-widgets/autogen.sh: Pull in some more .m4
files.
* gettext-tools/examples/hello-c++-widgets/autoclean.sh: Remove them.
Bruno Haible [Tue, 2 Oct 2018 13:25:53 +0000 (15:25 +0200)]
Fix conflict between different uses of GETTEXTLIBDIR.
Rationale: The programs installed in $(prefix)/lib/gettext/ are at different
locations before installation: some are in the source tree, some are in the
build tree.
* gettext-tools/src/msginit.c (project_id, project_id_version): Test
GETTEXTLIBDIR_SRCDIR, not GETTEXTLIBDIR.
(plural_forms): Test GETTEXTLIBDIR_BUILDDIR, not GETTEXTLIBDIR.
* gettext-tools/tests/msginit-3: Set GETTEXTLIBDIR_SRCDIR, not GETTEXTLIBDIR.
* gettext-tools/tests/msginit-4: Set both GETTEXTLIBDIR_SRCDIR and
GETTEXTLIBDIR_BUILDDIR.
Bruno Haible [Tue, 2 Oct 2018 12:57:22 +0000 (14:57 +0200)]
Fix conflict between different uses of GETTEXTDATADIR.
* gettext-tools/src/read-tcl.c (msgdomain_read_tcl): Test GETTEXTTCLDIR, not
GETTEXTDATADIR.
* gettext-tools/tests/msgunfmt-tcl-1: Set GETTEXTTCLDIR, not GETTEXTDATADIR.