Bruno Haible [Mon, 13 Apr 2020 20:41:54 +0000 (22:41 +0200)]
examples: Use infrastructure from gettext version 0.20.2.
* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 0.20.2.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.
Bruno Haible [Sun, 5 Apr 2020 13:08:34 +0000 (15:08 +0200)]
po, examples: In the .po -> .gmo rules, really consider the newest changes to the POT file.
Reported by Petr Ovtchenkov <ptr@void-ptr.info> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-04/msg00000.html>.
Helped by Paul Smith.
* gettext-runtime/po/Makefile.in.in (.po.gmo): Write dependency on the POT file
as a target rule, since inference rules don't support prerequisites.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise, also for the .po.qm
rule.
* NEWS: Mention the fix.
libtextstyle: Enable large files and, on Linux, 64-bit inodes support.
* libtextstyle/autogen.sh (GNULIB_MODULES): Add 'largefile' to enable
large files support on systems where this is not the default and 64-bit
inodes in 32-bit applications on Linux.
Bruno Haible [Tue, 24 Dec 2019 16:37:04 +0000 (17:37 +0100)]
build: Fix build failures on HP-UX 11.31/hppa with cc.
* gnulib-local/lib/libxml/parser.c (struct _xmlDefAttrs): Don't use ISO C 99
syntax with this compiler.
* gettext-runtime/intl/plural-exp.h (HAVE_STRUCT_INITIALIZER): Set to 0 with
this compiler.
Bruno Haible [Tue, 24 Dec 2019 16:37:00 +0000 (17:37 +0100)]
libtextstyle: Don't erase the .sym.in file if 'sed' is not GNU sed.
* libtextstyle/lib/Makefile.am (libtextstyle.sym.in): Test the exit status of
the declared.sh command. Preserve the existing libtextstyle.sym if it failed.
Bruno Haible [Sun, 24 Nov 2019 23:40:08 +0000 (00:40 +0100)]
libcroco: Improve copyright headers.
The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.
* libtextstyle/gnulib-local/lib/libcroco/*: Inline the COPYRIGHT file where
applicable. Add copyright header.
* libtextstyle/gnulib-local/lib/libcroco/libcroco-config.h: Add copyright header.
Bruno Haible [Sun, 24 Nov 2019 18:57:37 +0000 (19:57 +0100)]
libxml: Improve copyright headers.
The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.
* gnulib-local/lib/libxml/*: Inline this directory's COPYING file where
applicable. Add FSF copyright header.
* gnulib-local/lib/libxml/trionan.c: Add copyright header.
Bruno Haible [Sun, 24 Nov 2019 18:53:45 +0000 (19:53 +0100)]
glib: Improve copyright headers.
The copyright headers should be unambiguous even if a single file is copied from
the GNU gettext package and used elsewhere. Reported by John Darrington.
Bruno Haible [Fri, 4 Oct 2019 15:59:22 +0000 (17:59 +0200)]
build: Fix the build error in gettext-tools/examples/po.
Reported by Nick Alcock <nix@esperi.org.uk>
at <https://savannah.gnu.org/bugs/?56529>.
* gettext-tools/examples/po/Makefile.am (USE_BUILT_PROGS): New variable.
(hello-*.pot): Use it.
($(srcdir)/../hello-*/po/$(LL).po): Likewise.
* HACKING: Remove the workaround.
Bruno Haible [Fri, 4 Oct 2019 09:47:18 +0000 (11:47 +0200)]
build: Don't fetch gnulib a second time in libtextstyle.
* autogen.sh: Set GNULIB_SRCDIR when invoking libtextstyle/autogen.sh.
* libtextstyle/autogen.sh: Remove all git operations. Look at the GNULIB_SRCDIR
environment variable. Ignore the GNULIB_TOOL environment variable.
Bruno Haible [Sun, 29 Sep 2019 12:29:41 +0000 (14:29 +0200)]
xgettext: Fix parsing of XML tags that end in /> and have attributes.
Reported by Matej Marusak <marusak.matej@gmail.com>
in <https://savannah.gnu.org/bugs/?56848>.
* gettext-tools/src/x-javascript.c (phase5_get): After reading a string, reset
the lexical_context to the previous one, not to lc_outside. When reading /> at
the end of an XML element, decrement xml_element_depth.
* gettext-tools/tests/xgettext-javascript-6: Add a test.
Bruno Haible [Sun, 1 Sep 2019 15:51:31 +0000 (17:51 +0200)]
build: Add support for shallow-cloning of subdirectories.
* gitsub.sh (func_usage): Document allowed git options with 'git pull'.
(func_pull): Accept GIT_OPTIONS argument.
(pull): Parse git options before complaining about too many arguments.
Pass the git options to func_pull.
Bruno Haible [Sun, 25 Aug 2019 21:37:44 +0000 (23:37 +0200)]
xgettext: Assume that Python source files are in UTF-8 by default.
Reported by ilias iliadis <apiuano-bugs@yahoo.gr>
at <https://savannah.gnu.org/bugs/?55231>.
* gettext-tools/src/xg-encoding.h (xgettext_global_source_encoding): Allow a
NULL value.
* gettext-tools/src/xg-encoding.c (xgettext_global_source_encoding): Likewise.
* gettext-tools/src/xgettext.c (main): Initialize
xgettext_global_source_encoding with NULL, not "ASCII". Handle a NULL
xgettext_global_source_encoding.
(extract_from_file): Use ASCII as default for xgettext_global_source_encoding.
* gettext-tools/src/x-javascript.c (extract_javascript): Likewise.
* gettext-tools/src/x-python.c (phase2_getc): Signal an error when encountering
an invalid or incomplete UTF-8 character.
(set_current_file_source_encoding): In the error message, use
xgettext_current_file_source_encoding instead of
xgettext_global_source_encoding.
(extract_python): Use UTF-8 as default for xgettext_global_source_encoding.
* gettext-tools/tests/xgettext-python-3: Verify that if the source file has no
magic coding comment but is UTF-8 encoded, xgettext succeeds.
* NEWS: Mention the change.
Bruno Haible [Thu, 22 Aug 2019 14:36:59 +0000 (16:36 +0200)]
xgettext: Handle newlines in Lua long bracket literal strings correctly.
Reported by Frans de Jonge <fransdejonge@gmail.com>
at <https://savannah.gnu.org/bugs/?56794>.
* gettext-tools/src/x-lua.c (phase3_get): Test for EOF first. After an opening
long bracket, swallow one newline.
* gettext-tools/tests/xgettext-lua-1: Add tests for newlines in long brackets.
* gettext-tools/tests/xgettext-lua-2: Update comment.
Bruno Haible [Mon, 19 Aug 2019 08:24:30 +0000 (10:24 +0200)]
doc: Fix documentation of gettext, ngettext programs.
* gettext-runtime/doc/rt-gettext.texi: Clarify when the additional newline is
emitted.
* gettext-runtime/doc/rt-ngettext.texi: Remove '\c' from the list of recognized
escape sequences.
Bruno Haible [Sun, 18 Aug 2019 23:34:34 +0000 (01:34 +0200)]
xgettext: Fix parsing of escaped single-quote characters in shell parser.
Reported by Markus Gothe <nietzsche@lysator.liu.se>
at <https://savannah.gnu.org/bugs/?49809>.
* gettext-tools/src/x-sh.c (phase2_getc): Handle the case c == '\''
&& !open_singlequote && !open_doublequote differently.
* gettext-tools/tests/xgettext-sh-1: Add test with an escape single-quote.
Bruno Haible [Sun, 18 Aug 2019 11:27:30 +0000 (13:27 +0200)]
Don't extract Icon values from .desktop files into POT files.
Reported by Piotr Drąg <piotrdrag@gmail.com>
at <https://savannah.gnu.org/support/?108887>
and by Will Thompson <wjt@endlessm.com>
at <https://savannah.gnu.org/bugs/?56543>.
There was a discussion starting at
<https://lists.freedesktop.org/archives/xdg/2019-June/014158.html>.
The most interesting posts in this thread were
<https://lists.freedesktop.org/archives/xdg/2019-June/014164.html>
<https://lists.freedesktop.org/archives/xdg/2019-June/014167.html>.
* gettext-tools/doc/gettext.texi (Icons): New subsubsection.
* gettext-tools/src/read-desktop.c (desktop_add_default_keywords): Don't add
"Icon".
* gettext-tools/src/x-desktop.c: Update comments.
* gettext-tools/doc/xgettext.texi (Desktop): Remove 'Icon' from the list of
extracted keys.
* gettext-tools/tests/xgettext-desktop-2: New file.
* gettext-tools/tests/msgfmt-desktop-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* NEWS: Mention the change.
Bruno Haible [Sun, 28 Jul 2019 17:21:32 +0000 (19:21 +0200)]
xgettext: Fix parsing of JavaScript template literals inside functions.
Reported by Dmitry Vinnik <vinnik.dmitry07@gmail.com>
in <https://savannah.gnu.org/bugs/?56678>.
* gettext-tools/src/x-javascript.c (brace_depths, brace_depths_alloc): New
variables.
(brace_depth): Remove variable.
(new_brace_depth_level): New function.
(phase5_get): Invoke it. Access the top of the brace_depths stack.
(extract_javascript): Don't set brace_depth. Invoke new_brace_depth_level
instead.
* gettext-tools/tests/xgettext-javascript-7: Test template literals inside a
function.
Bruno Haible [Thu, 4 Jul 2019 14:27:33 +0000 (16:27 +0200)]
build: Fix build errors with MSVC.
* gettext-tools/libgettextpo/exported.sh.in: Remove one level of eval.
* gettext-tools/libgettextpo/Makefile.am (config.h): Redirect compiler output to
stderr. Remove symbols that contain an '@'.
* libtextstyle/lib/Makefile.am (config.h): Likewise.
Bruno Haible [Sun, 19 May 2019 11:10:06 +0000 (13:10 +0200)]
msgmerge: Fix behaviour of --for-msgfmt on PO files with no translations.
Reported by Don Lawrence <dlawrence@iecok.com>
in <https://lists.freedesktop.org/archives/p11-glue/2019-May/000700.html>
via Daiki Ueno
in <https://lists.gnu.org/archive/html/bug-gettext/2019-05/msg00124.html>.
* gettext-tools/src/msgmerge.c (main): Treat force_po like true if for_msgfmt
is true.
* gettext-tools/tests/msgmerge-26: Add test of PO file with no translations.
Bruno Haible [Sat, 18 May 2019 22:33:19 +0000 (00:33 +0200)]
build: Restore the ability to build gettext-tools separately, part 2.
* gettext-tools/configure.ac: New option --with-installed-csharp-dll.
(USE_INSTALLED_CSHARP_DLL): New conditional.
* gettext-tools/src/Makefile.am (CSHARP_DLL_DIR): New variable.
(msgunfmt.net.exe): Use it.
* configure.ac: Filter out --with-installed-csharp-dll from inherited --help
output.
* PACKAGING: Document that gettext-tools's configure needs to be invoked with
--with-installed-csharp-dll.
Bruno Haible [Sat, 18 May 2019 21:33:06 +0000 (23:33 +0200)]
build: Restore the ability to build gettext-tools separately, part 1.
Reported by Hanspeter Niederstrasser <nieder@users.sourceforge.net>
in <https://savannah.gnu.org/bugs/?56333>.
Code based on patch by Miguel Ángel Arruga Vivas <rosen644835@gmail.com>.
* autogen.sh: Copy libtextstyle.m4 for use by gettext-tools.
* gettext-tools/configure.ac: New option --with-installed-libtextstyle.
(USE_INSTALLED_LIBTEXTSTYLE): New conditional.
* gettext-tools/src/Makefile.am (textstyle.h): Disable rule if
USE_INSTALLED_LIBTEXTSTYLE is true.
(LT_LIBTEXTSTYLE): New variable.
(libgettextsrc_la_LDFLAGS): Use it instead of hardcoding a relative filename of
libtextstyle.la.
* configure.ac: Filter out --with-installed-libtextstyle from inherited --help
output.
* Makefile.am (distcheck-hook): Compare different copies of libtextstyle.m4.
* PACKAGING: Document that gettext-tools's configure needs to be invoked with
--with-installed-libtextstyle.
Bruno Haible [Mon, 20 May 2019 19:26:30 +0000 (21:26 +0200)]
Update after gnulib changed.
* gettext-runtime/intl/setlocale.c (search): Optimize away a redundant strcmp()
invocation.
(locales_with_principal_territory): New array.
(langcmp, get_main_locale_with_same_language): New functions.
(locales_with_principal_language): New array.
(terrcmp, get_main_locale_with_same_territory): New functions.
(rpl_setlocale): When setlocale_single failed, try again with a locale that is
more likely to exist. Don't warn if the environment variable SETLOCALE_VERBOSE
is not set.
Bruno Haible [Mon, 20 May 2019 01:04:18 +0000 (03:04 +0200)]
Update after gnulib changed.
* gettext-runtime/m4/intlmacosx.m4 (gt_INTL_MACOSX): Don't test for
CFLocaleCopyCurrent.
* gettext-runtime/intl/localename.c: Remove includes for
HAVE_CFLOCALECOPYCURRENT.
(gl_locale_name_environ, gl_locale_name_default): Remove code for
HAVE_CFLOCALECOPYCURRENT.
Bruno Haible [Sat, 11 May 2019 22:21:16 +0000 (00:21 +0200)]
Update bug reporting instructions.
* README: Tell users to report bugs in the bug tracker or by email. Use the
mailing list address, not the alias.
* gettext-runtime/libasprintf/README: Likewise.
* gettext-tools/doc/gettext.texi (Introduction): Likewise.
(Plural forms): Use the mailing list address, not the alias.
* configure.ac (AC_INIT): Use the mailing list address, not the alias.
* gettext-runtime/configure.ac (AC_INIT): Likewise.
* gettext-tools/configure.ac (AC_INIT): Likewise.
* gettext-tools/examples/configure.ac (AC_INIT): Likewise.
* gettext-runtime/po/Makevars (MSGID_BUGS_ADDRESS): Use the mailing list
address, not the alias.
* gettext-tools/po/Makevars (MSGID_BUGS_ADDRESS): Likewise.
* gettext-tools/examples/po/Makefile.am (MSGID_BUGS_ADDRESS): Likewise.
* gettext-tools/examples/hello-*/po/Makevars (MSGID_BUGS_ADDRESS): Likewise.
* gettext-tools/examples/hello-*/po/Makefile.am (MSGID_BUGS_ADDRESS): Likewise.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile (MSGID_BUGS_ADDRESS):
Likewise.
* gettext-tools/examples/hello-c++-kde/hello.cc (main): Likewise.
* gettext-runtime/src/envsubst.c (main): Move URL out of translatable string.
(usage): Tell users to report bugs in the bug tracker or by email. Use the
mailing list address, not the alias.
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-tools/src/cldr-plurals.c: Likewise.
* gettext-tools/src/hostname.c: Likewise.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/recode-sr-latin.c: Likewise.
* gettext-tools/src/urlget.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.
* gettext-tools/tests/tstgettext.c: Likewise.
* gettext-tools/tests/tstngettext.c: Likewise.
* gettext-tools/misc/autopoint.in (func_usage): Tell users to report bugs in the
bug tracker or by email. Use the mailing list address, not the alias.
* gettext-tools/misc/convert-archive.in (func_usage): Likewise.
* gettext-tools/misc/gettextize.in (func_usage): Likewise.