]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
3 months agoc-format: Accept null precision.
Bruno Haible [Sat, 21 Jun 2025 21:49:24 +0000 (23:49 +0200)] 
c-format: Accept null precision.

* gettext-tools/src/format-c-parse.h: Fix comment regarding the precision and
the ISO C23 size specifiers.
* gettext-tools/tests/format-c-1: Add a test case with null precision.

3 months agoboost-format: Accept null precision.
Bruno Haible [Sat, 21 Jun 2025 21:45:59 +0000 (23:45 +0200)] 
boost-format: Accept null precision.

* gettext-tools/src/format-boost.c: Fix comment regarding the precision.
* gettext-tools/tests/format-boost-1: Add a test case with null precision.

3 months agoawk-format: Accept null precision.
Bruno Haible [Sat, 21 Jun 2025 21:31:17 +0000 (23:31 +0200)] 
awk-format: Accept null precision.

Proof that it's valid:
$ echo 3.1415926 | gawk '{ printf "%.f", $1 }'

* gettext-tools/src/format-awk.c: Fix comment regarding the precision.
* gettext-tools/tests/format-awk-1: Add a test case with null precision.

3 months agoxgettext: Shell: Reject \u and \U escape sequences that produce surrogates.
Bruno Haible [Sat, 21 Jun 2025 04:49:23 +0000 (06:49 +0200)] 
xgettext: Shell: Reject \u and \U escape sequences that produce surrogates.

* gettext-tools/src/x-sh.c (read_word): Reject \u and \U values in the range
0xD800..0xDFFF.
* gettext-tools/tests/xgettext-sh-9: Add more test cases.

3 months agoxgettext: Shell: Bump phase1_pushback buffer size.
Bruno Haible [Sat, 21 Jun 2025 04:46:55 +0000 (06:46 +0200)] 
xgettext: Shell: Bump phase1_pushback buffer size.

* gettext-tools/src/x-sh.c (phase1_pushback): Bump size to 9.
* gettext-tools/tests/xgettext-sh-8: Add more test cases.

3 months agoxgettext: Shell: Recognize \u and \U escape sequences in $'...' strings.
Bruno Haible [Sat, 21 Jun 2025 00:53:23 +0000 (02:53 +0200)] 
xgettext: Shell: Recognize \u and \U escape sequences in $'...' strings.

* gettext-tools/src/xg-mixed-string.h (mixed_string_remove_prefix,
mixed_string_buffer_equals, mixed_string_buffer_startswith,
mixed_string_buffer_cloned_result): New declarations.
* gettext-tools/src/xg-mixed-string.c (mixed_string_remove_prefix): New
function.
(mixed_string_buffer_is_empty): Also test the absence of utf16_surr.
(mixed_string_buffer_equals, mixed_string_buffer_startswith,
mixed_string_buffer_cloned_result): New functions.
* gettext-tools/src/x-sh.c (struct token): Remove type.
(init_token, free_token, grow_token, string_of_token): Remove functions.
(struct word): Change type of 'token' field.
(free_word): Update.
(string_of_word, substring_of_word): Remove functions.
(read_word): Call mixed_string_buffer_init instead of init_token,
mixed_string_buffer_destroy instead of free_token,
mixed_string_buffer_append_char instead of grow_token. Update accesses to
wp->token. Recognize \u and \U escape sequences in $'...' strings.
(read_command): Call mixed_string_buffer_cloned_result instead of
string_of_word. Update accesses to inner.token.
* gettext-tools/tests/xgettext-sh-7: Use --from-code option.
* gettext-tools/tests/xgettext-sh-9: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention this and the previous change.

3 months agoxgettext: Shell: Recognize \c escape sequences in $'...' strings.
Bruno Haible [Sat, 21 Jun 2025 00:53:18 +0000 (02:53 +0200)] 
xgettext: Shell: Recognize \c escape sequences in $'...' strings.

* gettext-tools/src/x-sh.c (read_word): Recognize \c escape sequences.
* gettext-tools/tests/xgettext-sh-1: Add test cases with ASCII $'...' strings.

3 months agotests: Avoid a test failure with valgrind.
Bruno Haible [Fri, 20 Jun 2025 23:14:09 +0000 (01:14 +0200)] 
tests: Avoid a test failure with valgrind.

* gettext-tools/tests/xgettext-python-9: Filter out the valgrind traces.

4 months agoFix 'make installcheck' failure on Cygwin.
Bruno Haible [Fri, 20 Jun 2025 00:48:46 +0000 (02:48 +0200)] 
Fix 'make installcheck' failure on Cygwin.

* gettext-tools/configure.ac (INSTALLED_LIBINTL, INSTALLED_LIBGETTEXTPO_DEPS):
New variables.
* gettext-tools/install-tests/Makefile.am (installcheck): Use
INSTALLED_LIBGETTEXTPO_DEPS.

4 months agoReject the dysfunctional gettext in Solaris libc, other than Solaris 11.4.
Bruno Haible [Thu, 19 Jun 2025 20:34:27 +0000 (22:34 +0200)] 
Reject the dysfunctional gettext in Solaris libc, other than Solaris 11.4.

This fixes a 'make installcheck' failure.

<https://www.illumos.org/issues/13423> has been reported more than 4 years ago.
I don't have hope that they will fix it, ever.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): On Solaris other than
Solaris 11.4, don't use the gettext() function in libc.
* gettext-tools/tests/init.cfg (prepare_locale_): Remove function.
* gettext-tools/tests/format-c-3: Remove prepare_locale_ invocations.
* gettext-tools/tests/format-c-4: Likewise.
* gettext-tools/tests/format-c-5: Likewise.
* gettext-tools/tests/intl-0: Likewise.
* gettext-tools/tests/intl-1: Likewise.
* gettext-tools/tests/intl-2: Likewise.
* gettext-tools/tests/intl-3: Likewise.
* gettext-tools/tests/intl-4: Likewise.
* gettext-tools/tests/intl-6: Likewise.
* gettext-tools/tests/intl-7: Likewise.
* gettext-tools/tests/intl-thread-1: Likewise.
* gettext-tools/tests/intl-thread-2: Likewise.
* gettext-tools/tests/intl-thread-3: Likewise.
* gettext-tools/tests/lang-bash: Likewise.
* gettext-tools/tests/lang-c: Likewise.
* gettext-tools/tests/lang-c++: Likewise.
* gettext-tools/tests/lang-c++20: Likewise.
* gettext-tools/tests/lang-c++26: Likewise.
* gettext-tools/tests/lang-clisp: Likewise.
* gettext-tools/tests/lang-csharp: Likewise.
* gettext-tools/tests/lang-d: Likewise.
* gettext-tools/tests/lang-gawk: Likewise.
* gettext-tools/tests/lang-go: Likewise.
* gettext-tools/tests/lang-guile: Likewise.
* gettext-tools/tests/lang-java: Likewise.
* gettext-tools/tests/lang-javascript: Likewise.
* gettext-tools/tests/lang-librep: Likewise.
* gettext-tools/tests/lang-lua: Likewise.
* gettext-tools/tests/lang-modula2: Likewise.
* gettext-tools/tests/lang-objc: Likewise.
* gettext-tools/tests/lang-pascal: Likewise.
* gettext-tools/tests/lang-perl-1: Likewise.
* gettext-tools/tests/lang-perl-2: Likewise.
* gettext-tools/tests/lang-php: Likewise.
* gettext-tools/tests/lang-python-1: Likewise.
* gettext-tools/tests/lang-python-2: Likewise.
* gettext-tools/tests/lang-ruby: Likewise.
* gettext-tools/tests/lang-rust: Likewise.
* gettext-tools/tests/lang-sh: Likewise.
* gettext-tools/tests/lang-smalltalk: Likewise.
* gettext-tools/tests/lang-tcl: Likewise.
* gettext-tools/tests/lang-vala: Likewise.
* gettext-tools/tests/msgfmt-20: Likewise.
* gettext-tools/tests/plural-1: Likewise.
* NEWS: Mention the change.

4 months agoFix 'make installcheck' failure on Cygwin.
Bruno Haible [Thu, 19 Jun 2025 16:04:34 +0000 (18:04 +0200)] 
Fix 'make installcheck' failure on Cygwin.

* gettext-runtime/configure.ac (INSTALLED_LIBINTL): Add $LIBICONV.

4 months agoDeprecate the gfc-internal-format flag.
Bruno Haible [Thu, 19 Jun 2025 11:36:10 +0000 (13:36 +0200)] 
Deprecate the gfc-internal-format flag.

* gettext-tools/src/format-gfc-internal.c: Update comment.
* gettext-tools/doc/gettext.texi (PO Files): Mark gfc-internal-format as
deprecated.
(gfc-internal-format): Mention "up to GCC 14".

4 months agoxgettext: GCC-source: Disable gfc-format-internal recognition.
Bruno Haible [Thu, 19 Jun 2025 11:36:04 +0000 (13:36 +0200)] 
xgettext: GCC-source: Disable gfc-format-internal recognition.

* gettext-tools/src/x-c.h (SCANNERS_C): Replace formatstring_gfc_internal with
NULL.
* gettext-tools/tests/format-gfc-internal-1: Remove file.
* gettext-tools/tests/Makefile.am (TESTS): Remove it.

4 months agoStrengthen gcc-internal-format: Check that %< %>, %r %R, %{ %} come in pairs.
Bruno Haible [Thu, 19 Jun 2025 11:35:55 +0000 (13:35 +0200)] 
Strengthen gcc-internal-format: Check that %< %>, %r %R, %{ %} come in pairs.

* gettext-tools/src/format-gcc-internal.c (format_parse): New local variables
in_quote_group, in_color_group, in_url_group. Add pairing checks for %< %>,
%r %R, %{ %}.
* gettext-tools/tests/format-gcc-internal-1: Update.
* gettext-tools/tests/format-gcc-internal-2: Update.

4 months agoUpdate gcc-internal-format for GCC 15.
Bruno Haible [Thu, 19 Jun 2025 11:35:46 +0000 (13:35 +0200)] 
Update gcc-internal-format for GCC 15.

Reported by Roland Illig, Andrew Pinski, Jakub Jelinek in
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119684>.
Also reported by Roland Illig in
<https://savannah.gnu.org/bugs/?50450>, <https://savannah.gnu.org/bugs/?50461>.

* gettext-tools/src/format-gcc-internal.c: Update for GCC 15.
* gettext-tools/tests/format-gcc-internal-1: Likewise.
* gettext-tools/tests/format-gcc-internal-2: Likewise.
* gettext-tools/doc/gettext.texi (gcc-internal-format): Likewise.

4 months agogettext-runtime: Fix "make installcheck" failure on MSVC with --enable-shared.
Bruno Haible [Thu, 19 Jun 2025 11:35:05 +0000 (13:35 +0200)] 
gettext-runtime: Fix "make installcheck" failure on MSVC with --enable-shared.

* gettext-runtime/intl/Makefile.am (libintl.h): Insert '__declspec (dllimport)'
in the variable declarations, like in libgnuintl.h.

4 months agogettext-tools: Implement 'installcheck' target.
Bruno Haible [Thu, 19 Jun 2025 09:49:30 +0000 (11:49 +0200)] 
gettext-tools: Implement 'installcheck' target.

* gettext-tools/install-tests/test-version.c: New file.
* gettext-tools/install-tests/test-api.c: New file.
* gettext-tools/install-tests/de.po: New file.
* gettext-tools/install-tests/Makefile.am: New file.
* gettext-tools/configure.ac (PATH_SEPARATOR, AUGMENT_SHLIBPATH): New variables.
(AC_CONFIG_FILES): Add install-tests/Makefile.
* gettext-tools/Makefile.am (SUBDIRS): Add install-tests.

4 months agogettext-runtime: Implement 'installcheck' target.
Bruno Haible [Thu, 19 Jun 2025 09:46:19 +0000 (11:46 +0200)] 
gettext-runtime: Implement 'installcheck' target.

* gettext-runtime/install-tests/test-version.c: New file.
* gettext-runtime/install-tests/test-api.c: New file.
* gettext-runtime/install-tests/itest.pot: New file.
* gettext-runtime/install-tests/locale/en_US/LC_MESSAGES/itest.mo: New file.
* gettext-runtime/install-tests/Makefile.am: New file.
* gettext-runtime/configure.ac (INSTALLED_LIBINTL, PATH_SEPARATOR,
AUGMENT_SHLIBPATH): New variables.
(AC_CONFIG_FILES): Add install-tests/Makefile.
* gettext-runtime/Makefile.am (SUBDIRS): Add install-tests.

4 months agolibtextstyle: Implement 'installcheck' target.
Bruno Haible [Thu, 19 Jun 2025 09:42:59 +0000 (11:42 +0200)] 
libtextstyle: Implement 'installcheck' target.

* libtextstyle/install-tests/test-version.c: New file.
* libtextstyle/install-tests/test-api.c: New file.
* libtextstyle/install-tests/Makefile.am: New file.
* libtextstyle/configure.ac (AUGMENT_SHLIBPATH): New variable.
(AC_CONFIG_FILES): Add install-tests/Makefile.
* libtextstyle/Makefile.am (SUBDIRS): Add install-tests.

4 months agobuild: Simplify.
Bruno Haible [Sat, 14 Jun 2025 17:47:28 +0000 (19:47 +0200)] 
build: Simplify.

* gettext-runtime/configure.ac (LIBSCHED): Remove variable.

4 months agoImprove config.log traces.
Bruno Haible [Thu, 12 Jun 2025 17:12:19 +0000 (19:12 +0200)] 
Improve config.log traces.

* gettext-runtime/m4/progtest.m4 (AM_PATH_PROG_WITH_TEST): Emit the configure
line number into config.log.

4 months agobuild: Simplify handling of exported symbols on Windows, part 2.
Bruno Haible [Sun, 8 Jun 2025 21:09:37 +0000 (23:09 +0200)] 
build: Simplify handling of exported symbols on Windows, part 2.

* gettext-tools/configure.ac (WINDOWS_MSVC): New conditional.
* gnulib-local/modules/gettext-tools-misc (Makefile.am): Re-add the
--export-all-symbols linker option.
* gettext-tools/src/Makefile.am (libgettextsrc_la_LDFLAGS): Re-add the
--export-all-symbols linker option.

4 months agogettext.m4: Recognize the shared GNU libintl on MSVC.
Bruno Haible [Sat, 7 Jun 2025 03:01:34 +0000 (05:01 +0200)] 
gettext.m4: Recognize the shared GNU libintl on MSVC.

Reported by Kirill Makurin <maiddaisuki@outlook.com>
in <https://lists.gnu.org/archive/html/bug-m4/2025-06/msg00000.html>.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): On MSVC, don't try to use
_nl_msg_cat_cntr.
* NEWS: Mention it.

4 months agobuild: Simplify handling of exported symbols on Windows.
Bruno Haible [Sat, 7 Jun 2025 01:43:13 +0000 (03:43 +0200)] 
build: Simplify handling of exported symbols on Windows.

* gnulib-local/modules/gettext-tools-misc (Makefile.am): Don't compile
gettextlib-exports.c. Don't add now-redundant --export-all-symbols linker
option. Don't use GETTEXTLIB_EXPORTS_FLAGS.
* gettext-tools/src/Makefile.am (libgettextsrc_la_SOURCES): Don't add
gettextsrc-exports.c.
(libgettextsrc_la_LDFLAGS): Don't add now-redundant --export-all-symbols linker
option.
(libgettextsrc_la_CPPFLAGS): Don't add $(GETTEXTLIB_EXPORTS_FLAGS).
* gettext-tools/configure.ac (GETTEXTLIB_EXPORTS_FLAGS): Remove variable.
* gettext-tools/woe32dll/gettextlib-exports.c: Remove file.
* gettext-tools/woe32dll/gettextsrc-exports.c: Remove file.
* gettext-tools/woe32dll/export.h: Update comments.

4 months agobuild: Fix build error on MSVC with --enable-shared.
Bruno Haible [Fri, 6 Jun 2025 17:44:05 +0000 (19:44 +0200)] 
build: Fix build error on MSVC with --enable-shared.

* autogen.sh: Avoid the float-h-tests, since they reference the variables
gl_FLT_SNAN, gl_DBL_SNAN, gl_LDBL_SNAN.

4 months agobuild: Fix build failure on Cygwin and mingw without preinstalled libunistring.
Bruno Haible [Fri, 6 Jun 2025 13:34:31 +0000 (15:34 +0200)] 
build: Fix build failure on Cygwin and mingw without preinstalled libunistring.

* gettext-tools/configure.ac: Define DLL_VARIABLE and LIBGETTEXTSRC_DLL_VARIABLE
on Cygwin and mingw like on MSVC.

4 months agolibtextstyle: Fix build failure on Cygwin < 3.4.6.
Bruno Haible [Fri, 6 Jun 2025 10:56:05 +0000 (12:56 +0200)] 
libtextstyle: Fix build failure on Cygwin < 3.4.6.

* libtextstyle/lib/Makefile.am (config.h): Don't rename the _imp_ variable
associated with the gl_get_setlocale_null_lock function.

4 months agotests: xgettext-scheme-6: Fix potential conflict with xgettext-scheme-7.
Bruno Haible [Thu, 5 Jun 2025 19:43:31 +0000 (21:43 +0200)] 
tests: xgettext-scheme-6: Fix potential conflict with xgettext-scheme-7.

* gettext-tools/tests/xgettext-scheme-6: Use common file name idiom.

4 months agobuild: Fix "make install" in MSVC builds with --enable-shared.
Bruno Haible [Thu, 5 Jun 2025 19:43:27 +0000 (21:43 +0200)] 
build: Fix "make install" in MSVC builds with --enable-shared.

The problem was that intl-8.dll was not installed with execute permissions.

* gettext-runtime/intl/Makefile.am (install-exec-libintl): Use $(INSTALL),
not $(INSTALL_DATA), with libtool --mode=install.
* INSTALL.windows: Remove constraint to use --disable-shared on MSVC.

4 months agobuild: Fix MSVC builds with --enable-shared.
Bruno Haible [Thu, 5 Jun 2025 19:43:23 +0000 (21:43 +0200)] 
build: Fix MSVC builds with --enable-shared.

This was a regression in commit 8e914861708ed459a2ae8157eb60d89375ab46cd
from 2023-09-06.

Thanks to Kirill Makurin <maiddaisuki@outlook.com> for fruitful discussions.

* autogen.sh: Among the gnulib-tests, avoid the modules array-map-tests,
array-oset-tests, carray-list-tests, and uninorm/decomposing-form-tests, since
they use variables from libgettextlib.
* gettext-tools/configure.ac (GL_GNULIB_LIBUNISTRING_DLL_VARIABLE_NAME): New
variable.
(WOE32DLL): New C macro.
(DLL_VARIABLE): On MSVC with --enable-shared, define to '__declspec(dllexport)'
when compiling libgettextlib, and define to '__declspec(dllimport)' when
compiling the programs in src/.
(LIBGETTEXTSRC_DLL_VARIABLE): New C macro.
* gettext-tools/gnulib-lib/Makefile.am (AM_CPPFLAGS): Define the C macro
IN_LIBGETTEXTLIB.
* gettext-tools/src/Makefile.am (libgettextsrc_la_CPPFLAGS): Define the C macro
IN_LIBGETTEXTSRC.
* gettext-tools/src/format.h: Use LIBGETTEXTSRC_DLL_VARIABLE instead of
DLL_VARIABLE.
* gettext-tools/src/message.h: Likewise.
* gettext-tools/src/msgl-cat.h: Likewise.
* gettext-tools/src/plural-table.h: Likewise.
* gettext-tools/src/po-charset.h: Likewise.
* gettext-tools/src/po-error.h: Likewise.
* gettext-tools/src/read-catalog.h: Likewise.
* gettext-tools/src/read-po.h: Likewise.
* gettext-tools/src/read-properties.h: Likewise.
* gettext-tools/src/read-stringtable.h: Likewise.
* gettext-tools/src/sentence.h: Likewise.
* gettext-tools/src/write-po.h: Likewise.
* gettext-tools/src/write-properties.h: Likewise.
* gettext-tools/src/write-stringtable.h: Likewise.
* gettext-tools/src/xerror-handler.h: Likewise.
* gettext-tools/libgettextpo/Makefile.am (config.h): Override the value of
LIBGETTEXTSRC_DLL_VARIABLE.
* gettext-runtime/configure.ac (WOE32DLL): New C macro.
(DLL_VARIABLE): Define to empty always.

4 months agoUpdate to the newest gnulib.
Bruno Haible [Thu, 5 Jun 2025 19:43:19 +0000 (21:43 +0200)] 
Update to the newest gnulib.

4 months agoFix compilation error on MSVC due to conflict of different stdlib.h files.
Bruno Haible [Thu, 5 Jun 2025 19:43:15 +0000 (21:43 +0200)] 
Fix compilation error on MSVC due to conflict of different stdlib.h files.

Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00071.html>.

* autogen.sh: Change gnulib-tool invocation for libgrep.
* gettext-tools/configure.ac (AC_CONFIG_FILES): Add libgrep/gnulib-lib/Makefile.
* gettext-tools/libgrep/Makefile.am: Don't include Makefile.gnulib.
(SUBDIRS): New variable.
(noinst_LIBRARIES): Add libgrep.a.
(AM_CPPFLAGS): Add -I options for gnulib-lib subdirectory.
(libgrep_a_DEPENDENCIES): New variable.
* gettext-tools/libgrep/gnulib-lib/Makefile.am: New file.
* gettext-tools/src/Makefile.am (LIBGREP): Add ../libgrep/gnulib-lib/libgnu.a.

4 months agobuild: Fix some crashes when building with --enable-shared on MSVC, part 2.
Bruno Haible [Mon, 2 Jun 2025 22:32:57 +0000 (00:32 +0200)] 
build: Fix some crashes when building with --enable-shared on MSVC, part 2.

* gettext-tools/woe32dll/gettextlib-exports.c: Export also
gl_carray_list_implementation, gl_hash_map_implementation,
gl_hash_set_implementation, gl_linked_list_implementation.

4 months agotests: Fix test failure when rxgettext is not installed.
Bruno Haible [Mon, 2 Jun 2025 11:05:35 +0000 (13:05 +0200)] 
tests: Fix test failure when rxgettext is not installed.

* gettext-tools/tests/format-ruby-3: Skip test if rxgettext is not installed.

4 months agoUpdate a country name.
Collin Funk [Mon, 2 Jun 2025 05:24:34 +0000 (22:24 -0700)] 
Update a country name.

* gettext-tools/doc/ISO_3166: Use "Eswatini" instead of "Swaziland".
* gettext-tools/doc/iso-3166.texi: Likewise.

4 months agoAdd a NEWS entry.
Bruno Haible [Mon, 2 Jun 2025 00:02:52 +0000 (02:02 +0200)] 
Add a NEWS entry.

* NEWS: Mention the format string heuristic improvements.

4 months agoxgettext: Tcl: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 23:39:20 +0000 (01:39 +0200)] 
xgettext: Tcl: Improve heuristic for format strings.

* gettext-tools/src/format-tcl.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_tcl): Use it.
* gettext-tools/tests/format-tcl-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: Ruby: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 23:36:07 +0000 (01:36 +0200)] 
xgettext: Ruby: Improve heuristic for format strings.

* gettext-tools/src/format-ruby.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_ruby): Use it.
* gettext-tools/tests/format-ruby-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: Python: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 23:26:23 +0000 (01:26 +0200)] 
xgettext: Python: Improve heuristic for format strings.

* gettext-tools/src/format-python.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_python): Use it.
* gettext-tools/tests/format-python-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: PHP: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 23:23:13 +0000 (01:23 +0200)] 
xgettext: PHP: Improve heuristic for format strings.

* gettext-tools/src/format-php.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_php): Use it.
* gettext-tools/tests/format-php-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: Perl: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 23:16:11 +0000 (01:16 +0200)] 
xgettext: Perl: Improve heuristic for format strings.

* gettext-tools/src/format-perl.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_perl): Use it.
* gettext-tools/tests/format-perl-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: librep: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 23:10:52 +0000 (01:10 +0200)] 
xgettext: librep: Improve heuristic for format strings.

* gettext-tools/src/format-librep.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_librep): Use it.
* gettext-tools/tests/format-librep-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: JavaScript: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 23:52:49 +0000 (01:52 +0200)] 
xgettext: JavaScript: Improve heuristic for format strings.

* gettext-tools/src/format-javascript.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_javascript): Use it.
* gettext-tools/tests/format-javascript-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: Go: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 23:01:50 +0000 (01:01 +0200)] 
xgettext: Go: Improve heuristic for format strings.

* gettext-tools/src/format-go.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_go): Use it.
* gettext-tools/tests/format-go-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: Emacs Lisp: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 22:35:16 +0000 (00:35 +0200)] 
xgettext: Emacs Lisp: Improve heuristic for format strings.

* gettext-tools/src/format-elisp.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_elisp): Use it.
* gettext-tools/tests/format-elisp-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: D: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 22:32:14 +0000 (00:32 +0200)] 
xgettext: D: Improve heuristic for format strings.

* gettext-tools/src/format-d.c (struct spec): Add field
'likely_intentional_directives'.
(parse_upto): Increment it for each directive that don't contain a space.
(format_parse): Initialize it.
(format_is_unlikely_intentional): New function.
(formatstring_d): Use it.
* gettext-tools/tests/format-d-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: C++: Improve heuristic for Boost format strings.
Bruno Haible [Sun, 1 Jun 2025 22:17:32 +0000 (00:17 +0200)] 
xgettext: C++: Improve heuristic for Boost format strings.

* gettext-tools/src/format-boost.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_boost): Use it.
* gettext-tools/tests/format-boost-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: C: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 22:11:27 +0000 (00:11 +0200)] 
xgettext: C: Improve heuristic for format strings.

* gettext-tools/src/format-c-parse.h (struct spec): Add field
'likely_intentional_directives'.
(format_parse_entrails): Set it to the number of directives that don't contain
a space.
* gettext-tools/src/format-c.c (format_is_unlikely_intentional): Also test the
'likely_intentional_directives' field.
* gettext-tools/tests/format-c-6: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: awk: Improve heuristic for format strings.
Bruno Haible [Sun, 1 Jun 2025 17:53:09 +0000 (19:53 +0200)] 
xgettext: awk: Improve heuristic for format strings.

* gettext-tools/src/format-awk.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_awk): Use it.
* gettext-tools/tests/format-awk-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoD: Fix handling of %% directive in format string parser.
Bruno Haible [Mon, 2 Jun 2025 00:19:23 +0000 (02:19 +0200)] 
D: Fix handling of %% directive in format string parser.

* gettext-tools/src/format-d.c (parse_upto): Add matching FMTDIR_END also for
the %% directive.

4 months agoAvoid warnings from "gcc -Wextra".
Bruno Haible [Sun, 1 Jun 2025 10:26:40 +0000 (12:26 +0200)] 
Avoid warnings from "gcc -Wextra".

Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00280.html>.

* gnulib-local/lib/gettext.h (gettext, dgettext, dcgettext): Silence
-Wbuiltin-declaration-mismatch warning.

4 months agoFix compilation error on Solaris 11 (regr. 2025-05-28).
Bruno Haible [Sat, 31 May 2025 23:17:42 +0000 (01:17 +0200)] 
Fix compilation error on Solaris 11 (regr. 2025-05-28).

* gnulib-local/lib/gettext.h (gettext, dgettext, dcgettext): On Solaris, use
'char *' as return type.

4 months agobuild: Fix some crashes when building with --enable-shared on MSVC.
Bruno Haible [Sat, 31 May 2025 15:34:38 +0000 (17:34 +0200)] 
build: Fix some crashes when building with --enable-shared on MSVC.

Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00087.html>.

* gnulib-local/lib/gl_carray_list.h.diff: New file.
* gnulib-local/lib/gl_hash_map.h.diff: New file.
* gnulib-local/lib/gl_hash_set.h.diff: New file.
* gnulib-local/lib/gl_linked_list.h.diff: New file.
* gnulib-local/Makefile.am (EXTRA_DIST): Add them.

4 months agobuild: Mark automake 1.18 as supported.
Bruno Haible [Sat, 31 May 2025 13:24:26 +0000 (15:24 +0200)] 
build: Mark automake 1.18 as supported.

* autogen.sh: Update comment.
* m4/fixautomake.m4 (FIX_MAKEFILE_DISTRIB): Likewise.

4 months agodoc: For MSVC, recommend to avoid the preinstalled libunistring.
Bruno Haible [Sat, 31 May 2025 11:32:03 +0000 (13:32 +0200)] 
doc: For MSVC, recommend to avoid the preinstalled libunistring.

This fixes an "initializer is not a constant" error upon use of uninorm_nfc.
Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00076.html>.

* INSTALL.windows: For MSVC, recommend --with-included-libunistring.

4 months agobuild: Tweak option for MSVC.
Bruno Haible [Sat, 31 May 2025 11:04:16 +0000 (13:04 +0200)] 
build: Tweak option for MSVC.

Suggested by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00071.html>.

* gettext-tools/src/Makefile.am (xgettext_LDFLAGS): Use an MSVC option with '-'
instead of '/', for resilience against the (unsupported) MSYS2.

4 months agoAvoid gcc -Wformat-security warnings with --disable-nls.
Bruno Haible [Wed, 28 May 2025 14:50:19 +0000 (16:50 +0200)] 
Avoid gcc -Wformat-security warnings with --disable-nls.

Reported by Holger Hoffstätte <holger@applied-asynchrony.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00225.html>.

* gnulib-local/lib/gettext.h (gettext, dgettext, dcgettext): With gcc in C mode,
define these as inline functions.

5 months agoxgettext: JavaScript: Parse RegExp literals according to ECMA-262 15th edition.
Bruno Haible [Tue, 20 May 2025 17:35:20 +0000 (19:35 +0200)] 
xgettext: JavaScript: Parse RegExp literals according to ECMA-262 15th edition.

Reported by Christian Wasserthal <aperion@fsfe.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00038.html>.

* gettext-tools/src/x-javascript.c (phase5_scan_regexp): Report an error when
end-of-line is reached. Parse character classes. Recognize more modifier flags.
* gettext-tools/tests/xgettext-javascript-2: Add two more test cases.
* NEWS: Mention the change.

5 months agodoc: Update, now that autopull.sh does more than a gnulib checkout.
Bruno Haible [Fri, 16 May 2025 09:31:00 +0000 (11:31 +0200)] 
doc: Update, now that autopull.sh does more than a gnulib checkout.

* autogen.sh: Update comments.
* HACKING: Improve formatting.

5 months agoRefactor: Fix a compiler warning.
Bruno Haible [Sun, 11 May 2025 01:27:45 +0000 (03:27 +0200)] 
Refactor: Fix a compiler warning.

* gettext-tools/src/x-perl.c: Remove a stray ';'.

5 months agoRefactor: Fix typo in function name.
Bruno Haible [Sun, 11 May 2025 01:25:42 +0000 (03:25 +0200)] 
Refactor: Fix typo in function name.

* gettext-tools/src/x-d.c (extract_from_template_instantiation): Renamed from
extract_from_template_instantation.

5 months agoUpdate after gnulib changed.
Bruno Haible [Sun, 11 May 2025 01:24:02 +0000 (03:24 +0200)] 
Update after gnulib changed.

* gettext-tools/src/msgl-iconv.h (convert_string_desc_directly): Change result
type to rw_string_desc_t.
* gettext-tools/src/msgl-iconv.c (convert_string_desc_directly): Likewise.
* gettext-tools/src/its.c (_its_is_valid_simple_gen_xml): Omit casts to
'char *'. Don't use sd_c_casecmp, sd_cmp as function pointers.
* gettext-tools/src/xg-encoding.h (string_desc_from_current_source_encoding):
Change result type to rw_string_desc_t.
* gettext-tools/src/xg-encoding.c (from_current_source_encoding): Return
converted result directly, without a cast.
(string_desc_from_current_source_encoding): Change result type to
rw_string_desc_t. Return converted result directly, without a cast. Invoke
sd_readwrite.
* gettext-tools/src/x-perl.c (get_here_document): Add benign cast.
(extract_quotelike_pass1, extract_quotelike_pass1_utf8): Change result type to
rw_string_desc_t.
(extract_quotelike, extract_triple_quotelike): Update.
(extract_quotelike_pass3): Add benign casts.
(interpolate_keywords): Don't call sd_set_char_at on a string_desc_t.
* gettext-tools/src/x-d.c (handle_comments, is_string_literal,
string_literal_accumulate_pieces, extract_from_function_call,
extract_from_function_call_without_args, extract_from_template_instantation,
extract_from_node): Omit casts to 'char *'.
* gettext-tools/src/x-go.c (string_literal_accumulate_pieces,
string_literal_value, scan_import_spec, get_type_from_type_identifier_node,
get_type_from_type_node, store_type_declaration, get_mvtypes_of_expression,
store_var_spec, store_const_spec, store_function_declaration,
augment_for_type_declaration, augment_for_parameter_list, augment_for_var_spec,
augment_for_const_spec, augment_for_short_variable_declaration, handle_comments,
extract_from_function_call, extract_from_node): Omit casts to 'char *'.
* gettext-tools/src/x-rust.c (handle_comments, string_literal_value): Omit casts
to 'char *'. Add benign casts.
(extract_from_function_call, extract_from_function_call_like,
extract_from_node): Omit casts to 'char *'.
* gettext-tools/src/x-typescript-impl.h (handle_comments,
sbru_prepend_lone_surrogate): Omit casts to 'char *'.
(sbru_xprepend_unicode): Add benign casts.
(string_literal_accumulate_pieces, string_literal_value,
extract_from_function_call, extract_from_node): Omit casts to 'char *'.

5 months agoUpdate to the newest gnulib.
Bruno Haible [Sun, 11 May 2025 01:23:47 +0000 (03:23 +0200)] 
Update to the newest gnulib.

5 months agoRelease 0.25 v0.25
Bruno Haible [Wed, 7 May 2025 16:48:47 +0000 (18:48 +0200)] 
Release 0.25

5 months agoexamples: Use infrastructure from gettext version 0.25.
Bruno Haible [Wed, 7 May 2025 16:07:15 +0000 (18:07 +0200)] 
examples: Use infrastructure from gettext version 0.25.

* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 0.25.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.

5 months agoUpdate translations from TP.
Bruno Haible [Wed, 7 May 2025 13:30:06 +0000 (15:30 +0200)] 
Update translations from TP.

* gettext-runtime/po/*.po: Update from TP.
* gettext-tools/po/*.po: Update from TP.
* gettext-tools/examples/po/*.po: Update from TP.

5 months agoPrepare for 0.25 release.
Bruno Haible [Wed, 7 May 2025 13:06:24 +0000 (15:06 +0200)] 
Prepare for 0.25 release.

* gettext-runtime/doc/matrix.texi: Update from TP.
* gettext-runtime/doc/nls.texi (STATUS): Update.
* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* libtextstyle/version.sh: Update VERSION_NUMBER, RELEASE_DATE.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* gettext-runtime/po/Makefile.in.in: Update Origin.
* gettext-runtime/intl/Makefile.am (LTV_*): Bump to 12:4:4.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 2:5:2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:14:5.
* gettext-tools/misc/autopoint.in: Likewise. Accept version 0.25.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.25.

5 months agodoc: Clarify how to obtain the various autoconf macros.
Bruno Haible [Wed, 7 May 2025 16:03:18 +0000 (18:03 +0200)] 
doc: Clarify how to obtain the various autoconf macros.

* gettext-tools/doc/gettext.texi (autoconf macros): Suggest to use gettextize or
autopoint. Discourage autoreconf.

5 months agoUpdate .gitignore.
Bruno Haible [Wed, 7 May 2025 16:16:48 +0000 (18:16 +0200)] 
Update .gitignore.

5 months agoUpdate to a newer gnulib.
Bruno Haible [Wed, 7 May 2025 11:42:11 +0000 (13:42 +0200)] 
Update to a newer gnulib.

5 months agointl-modula2: Try to fix a build failure on macOS.
Bruno Haible [Tue, 6 May 2025 15:51:58 +0000 (17:51 +0200)] 
intl-modula2: Try to fix a build failure on macOS.

* gettext-runtime/intl-modula2/Makefile.am (libintl_m2_la_LDFLAGS): Revert last
two commits. Instead, use -L and -l options.

5 months agotests: Avoid xgettext-git-1 failure on AIX.
Bruno Haible [Tue, 6 May 2025 08:01:07 +0000 (10:01 +0200)] 
tests: Avoid xgettext-git-1 failure on AIX.

* gettext-tools/tests/xgettext-git-1: Don't use shell pattern matching with
braces.

5 months agointl-modula2: Try to fix a build failure on macOS.
Bruno Haible [Mon, 5 May 2025 20:15:51 +0000 (22:15 +0200)] 
intl-modula2: Try to fix a build failure on macOS.

* gettext-runtime/intl-modula2/Makefile.am (libintl_m2_la_LIBADD): Avoid
automake error.

5 months agointl-modula2: Try to fix a build failure on macOS.
Bruno Haible [Mon, 5 May 2025 19:56:30 +0000 (21:56 +0200)] 
intl-modula2: Try to fix a build failure on macOS.

* gettext-runtime/intl-modula2/Makefile.am (libintl_m2_la_LIBADD): New variable.

5 months agoPACKAGING: Revisit intl-d and intl-modula2 packaging.
Bruno Haible [Mon, 5 May 2025 17:08:55 +0000 (19:08 +0200)] 
PACKAGING: Revisit intl-d and intl-modula2 packaging.

* PACKAGING: Suggest packaging libintl_d and libintl_m2 each in a separate
package.

5 months agoUpdate after gnulib changed.
Bruno Haible [Mon, 5 May 2025 16:55:39 +0000 (18:55 +0200)] 
Update after gnulib changed.

5 months agotests: Avoid xgettext-git-1 failure on native Windows.
Bruno Haible [Sun, 4 May 2025 23:31:34 +0000 (01:31 +0200)] 
tests: Avoid xgettext-git-1 failure on native Windows.

5 months agoUpdate to the newest gnulib.
Bruno Haible [Mon, 5 May 2025 13:08:26 +0000 (15:08 +0200)] 
Update to the newest gnulib.

5 months agodoc: xgettext: More doc regarding --generated.
Bruno Haible [Mon, 5 May 2025 11:24:57 +0000 (13:24 +0200)] 
doc: xgettext: More doc regarding --generated.

Suggested by Vaclav Slavik <vaclav@slavik.io>
at <https://savannah.gnu.org/bugs/?66916>.

* gettext-tools/doc/xgettext.texi: Mention the --generated option in the
--files-from description.

5 months agodoc: Update list of examples.
Bruno Haible [Mon, 5 May 2025 08:03:03 +0000 (10:03 +0200)] 
doc: Update list of examples.

* gettext-tools/doc/lang-c.texi: Update the list of examples.
* gettext-tools/doc/lang-ruby.texi: Mention the hello-ruby example.

5 months agotests: Avoid a lang-modula2 failure.
Bruno Haible [Mon, 5 May 2025 10:24:52 +0000 (12:24 +0200)] 
tests: Avoid a lang-modula2 failure.

* gettext-tools/tests/lang-modula2: Skip the test if gm2 is not working.

5 months agotests: Add a comment regarding a lang-modula2 failure.
Bruno Haible [Mon, 5 May 2025 01:00:58 +0000 (03:00 +0200)] 
tests: Add a comment regarding a lang-modula2 failure.

* gettext-tools/tests/lang-modula2: Add comment.

5 months agointl-modula2: Fix a build failure on Ubuntu 22.04.
Bruno Haible [Mon, 5 May 2025 01:00:00 +0000 (03:00 +0200)] 
intl-modula2: Fix a build failure on Ubuntu 22.04.

* gettext-runtime/configure.ac: Substitute M2SHLIBEXT.
* gettext-runtime/intl-modula2/Makefile.am (libintl_m2_la_LDFLAGS): Attempt
harder to find the libm2pim library.

5 months agobuild: Avoid possible problems due to AC_REQUIRE in if/else branches.
Bruno Haible [Sun, 4 May 2025 23:50:26 +0000 (01:50 +0200)] 
build: Avoid possible problems due to AC_REQUIRE in if/else branches.

* gettext-runtime/configure.ac: Use AS_IF when at least one of the if/else
branches invokes a complicated Autoconf macro.
* gettext-tools/configure.ac: Likewise.

5 months agoAvoid some clang -Wthread-safety-analysis warnings.
Bruno Haible [Sun, 4 May 2025 15:31:11 +0000 (17:31 +0200)] 
Avoid some clang -Wthread-safety-analysis warnings.

* gettext-tools/src/x-typescript-impl.h (sbru_init): Declare with
_GL_ATTRIBUTE_ACQUIRE_CAPABILITY.
(sbru_xdupfree_c): Declare with _GL_ATTRIBUTE_RELEASE_CAPABILITY.

5 months agoxgettext: Allow ignoring specific files in the POT-Creation-Date computation.
Bruno Haible [Sun, 4 May 2025 14:42:38 +0000 (16:42 +0200)] 
xgettext: Allow ignoring specific files in the POT-Creation-Date computation.

Reported by Vaclav Slavik <vaclav@slavik.io>
at <https://savannah.gnu.org/users/vslavik>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add hashkey-string, set.
* gettext-tools/src/xgettext.c: Include gl_set.h, gl_xset.h, gl_hash_set.h,
hashkey-string.h.
(generated_files): New variables.
(long_options): New option '--generated'.
(main): Initialize generated_files. Handle the option '--generated'.
(usage): Document the option '--generated'.
(finalize_header): Filter out the generated_files from the file list.
* gettext-tools/doc/xgettext.texi: Document the option '--generated'.
* gettext-tools/tests/xgettext-git-1: Test the --generated option.
* NEWS: Mention the new option.

5 months agoUpdate to the newest gnulib.
Bruno Haible [Sun, 4 May 2025 16:43:46 +0000 (18:43 +0200)] 
Update to the newest gnulib.

5 months agoUpdate release steps.
Bruno Haible [Sun, 4 May 2025 10:15:14 +0000 (12:15 +0200)] 
Update release steps.

5 months agodoc: Clarify that the minimum needed GCC version is 4.4.
Bruno Haible [Sat, 3 May 2025 11:08:11 +0000 (13:08 +0200)] 
doc: Clarify that the minimum needed GCC version is 4.4.

Rationale: With GCC version 4.1.2 or 4.2.1, all tree-sitter based extractors
in xgettext crash at runtime when compiled with optimization. Whereas
GCC 4.4.7 works fine.

* DEPENDENCIES: State "GCC 4.4 or newer".

5 months agoxgettext: D: Work around a gcc miscompilation bug.
Bruno Haible [Sat, 3 May 2025 01:51:49 +0000 (03:51 +0200)] 
xgettext: D: Work around a gcc miscompilation bug.

* gettext-tools/build-aux/tree-sitter-d-optimization-bug.diff: New file.
* autopull.sh: Apply it.

5 months agoMerge from 0.24.x branch: Prepare for 0.24.1 release.
Bruno Haible [Fri, 2 May 2025 15:19:48 +0000 (17:19 +0200)] 
Merge from 0.24.x branch: Prepare for 0.24.1 release.

* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* libtextstyle/version.sh: Update VERSION_NUMBER, RELEASE_DATE.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* gettext-tools/misc/autopoint.in: Likewise. Accept version 0.24.1.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.24.1.

5 months agobuild: Update after recent gettextize fix.
Bruno Haible [Fri, 2 May 2025 16:30:05 +0000 (18:30 +0200)] 
build: Update after recent gettextize fix.

* gettext-tools/misc/add-to-archive: Look up the *.m4 files in
$datadir/gettext/m4, not $datadir/aclocal.

5 months agoxgettext: Give a hint about --no-git when max_vc_mtime() took more than 10 sec.
Bruno Haible [Fri, 2 May 2025 15:02:17 +0000 (17:02 +0200)] 
xgettext: Give a hint about --no-git when max_vc_mtime() took more than 10 sec.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add getrusage.
* gettext-tools/src/xgettext.c: Include <sys/resource.h>.
(max_mtime): New function.
(finalize_header): Invoke it.

5 months agoxgettext: Add an option to opt-out of the use of git for the POT-Creation-Date.
Bruno Haible [Fri, 2 May 2025 14:06:45 +0000 (16:06 +0200)] 
xgettext: Add an option to opt-out of the use of git for the POT-Creation-Date.

Reported by Serhii Tereshchenko at <https://savannah.gnu.org/bugs/?66865>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add stat-time.
* gettext-tools/src/xgettext.c: Include stat-time.h.
(xgettext_no_git): New variable.
(long_options): Add option '--no-git'.
(main): Handle the option --no-git.
(usage): Document the option --no-git.
(struct accumulator): New type, copied from gnulib/lib/vc-mtime.c.
(accumulate): New function, copied from gnulib/lib/vc-mtime.c.
(max_mtime_without_git): New function, based on gnulib/lib/vc-mtime.c.
(finalize_header): Conditionally invoke max_mtime_without_git instead of
max_vc_mtime.
* gettext-tools/doc/xgettext.texi: Document the option --no-git.
* NEWS: Mention the change.

5 months agotests: Fix test failure with git versions < 2.23.
Bruno Haible [Fri, 2 May 2025 10:35:39 +0000 (12:35 +0200)] 
tests: Fix test failure with git versions < 2.23.

* gettext-tools/tests/xgettext-git-1: Use 'git checkout' instead of
'git restore'.

5 months agoUpdate to the newest gnulib.
Bruno Haible [Fri, 2 May 2025 13:27:52 +0000 (15:27 +0200)] 
Update to the newest gnulib.

5 months agoxgettext: Speed up the computation of the POT-Creation-Date.
Bruno Haible [Thu, 1 May 2025 22:45:01 +0000 (00:45 +0200)] 
xgettext: Speed up the computation of the POT-Creation-Date.

Reported by Serhii Tereshchenko, Arthur, Adam YS, Foucauld Degeorges
at <https://savannah.gnu.org/bugs/?66865>.

* gettext-tools/src/xgettext.c (has_some_mtimes, max_of_mtimes, some_mtimes_failed): Remove variables.
(files_for_vc_mtime): New variable.
(main): Initialize files_for_vc_mtime. Update files_for_vc_mtime instead of calling consider_vc_mtime.
(consider_vc_mtime): Remove function.
(read_exclusion_file, extract_from_file, extract_from_xml_file): Update files_for_vc_mtime instead of calling consider_vc_mtime.
(finalize_header): Call max_vc_mtime.
* NEWS: Mention the speedup.

5 months agoUpdate to the newest gnulib.
Bruno Haible [Thu, 1 May 2025 23:11:50 +0000 (01:11 +0200)] 
Update to the newest gnulib.

5 months agotests: Add a test for xgettext's computation of the POT-Creation-Date.
Bruno Haible [Thu, 1 May 2025 22:38:57 +0000 (00:38 +0200)] 
tests: Add a test for xgettext's computation of the POT-Creation-Date.

* gettext-tools/tests/testdata/repo.tar.gz: New file.
* gettext-tools/tests/xgettext-git-1: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
(EXTRA_DIST): Add testdata/repo.tar.gz.

5 months agobuild: Take the mem-hash-map module from Gnulib now, part 2.
Bruno Haible [Wed, 30 Apr 2025 14:43:06 +0000 (16:43 +0200)] 
build: Take the mem-hash-map module from Gnulib now, part 2.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add next-prime.
* gettext-tools/src/write-mo.c: Include next-prime.h.
* gettext-tools/src/write-qt.c: Likewise.