]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
3 months agoSimplify code: The syntax-check flags are only used inside xgettext.
Bruno Haible [Mon, 30 Jun 2025 11:49:13 +0000 (13:49 +0200)] 
Simplify code: The syntax-check flags are only used inside xgettext.

* gettext-tools/src/message.h: Improve comments regarding do_syntax_check.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Don't manipulate
do_syntax_check field.
* gettext-tools/src/msgmerge.c (message_merge): Likewise.
* gettext-tools/src/read-catalog-special.h (parse_comment_special): Change 'scp'
parameter to a pointer.
* gettext-tools/src/read-catalog-special.c (parse_comment_special): Support a
null 'scp' argument.
* gettext-tools/src/read-catalog.h (DEFAULT_CATALOG_READER_TY): Remove
do_syntax_check field.
* gettext-tools/src/read-catalog.c (default_constructor,
default_copy_comment_state, default_reset_comment_state,
default_comment_special): Don't reference do_syntax_check field.

3 months agoexamples: Extend the hello-sh example, part 2.
Bruno Haible [Sun, 29 Jun 2025 07:08:45 +0000 (09:08 +0200)] 
examples: Extend the hello-sh example, part 2.

* gettext-tools/examples/hello-sh/hello-2.sh: New file, based on
gettext-tools/examples/hello-sh/hello-1.sh.
* gettext-tools/examples/hello-sh/hello-3.sh: New file, based on
gettext-tools/examples/hello-sh/hello-2.sh.

3 months agoTweak last commit.
Bruno Haible [Sat, 28 Jun 2025 22:15:04 +0000 (00:15 +0200)] 
Tweak last commit.

* gettext-tools/src/msgcmp.c (main): Tweak whitespace.

3 months agoRefactor: Use gnulib's 'options' module.
Bruno Haible [Sat, 28 Jun 2025 21:48:03 +0000 (23:48 +0200)] 
Refactor: Use gnulib's 'options' module.

* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC, GNULIB_MODULES_TOOLS_FOR_SRC): Add
'options'. Remove 'getopt-gnu'.
* gettext-runtime/src/envsubst.c: Include options.h instead of <getopt.h>.
(long_options): Remove variable.
(main): Define options array here. Call start_options, get_next_option instead
of getopt_long().
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-runtime/src/printf_gettext.c: Likewise.
* gettext-runtime/src/printf_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.

3 months agoUpdate to the newest gnulib.
Bruno Haible [Sat, 28 Jun 2025 21:40:06 +0000 (23:40 +0200)] 
Update to the newest gnulib.

3 months agoAdhere to GNU Coding Style.
Bruno Haible [Sat, 28 Jun 2025 21:38:03 +0000 (23:38 +0200)] 
Adhere to GNU Coding Style.

* gettext-runtime/src/envsubst.c (main): Use common 'switch' indentation.
* gettext-tools/src/hostname.c (main): Likewise.
* gettext-tools/src/recode-sr-latin.c (main): Likewise.
* gettext-tools/src/urlget.c (main): Likewise.
* gettext-tools/tests/tstgettext.c (main): Likewise.
* gettext-tools/tests/tstngettext.c (main): Likewise.

3 months agoxgettext: Remove undocumented no-op option '-W'.
Bruno Haible [Sat, 28 Jun 2025 08:19:51 +0000 (10:19 +0200)] 
xgettext: Remove undocumented no-op option '-W'.

This was a regression from 2015-01-29.

* gettext-tools/src/xgettext.c (main): Remove short option '-W'.

3 months agomsgconv, msgen, msgfilter, msggrep, msgmerge: The option '-n' takes no argument.
Bruno Haible [Sat, 28 Jun 2025 00:12:58 +0000 (02:12 +0200)] 
msgconv, msgen, msgfilter, msggrep, msgmerge: The option '-n' takes no argument.

This was a regression from 2014-03-24.

* gettext-tools/src/msgconv.c (main): Change "n:" to "n" in getopt_long
argument.
* gettext-tools/src/msgen.c (main): Likewise.
* gettext-tools/src/msgfilter.c (main): Likewise.
* gettext-tools/src/msggrep.c (main): Likewise.
* gettext-tools/src/msgmerge.c (main): Likewise.

3 months agoShell: Document two more approaches.
Bruno Haible [Fri, 27 Jun 2025 21:19:00 +0000 (23:19 +0200)] 
Shell: Document two more approaches.

* gettext-tools/doc/lang-sh.texi (sh): Tweaks.
(sh - Three approaches): New subsubsection.
(The gettext.sh approach): New subsubsection, incorporating the "gettext.sh"
subsubsection.
(The printf approach, The printf_gettext approach): New subsubsections.
(Preparing for gettext.sh): Renamed from "Preparing Shell Scripts".
(Preparing for printf, Preparing for printf_gettext): New subsubsections.
* gettext-tools/doc/gettext.texi: Update detailed node list.
* NEWS: Mention the change.

3 months agoexamples: Extend the hello-sh example.
Bruno Haible [Fri, 27 Jun 2025 21:18:54 +0000 (23:18 +0200)] 
examples: Extend the hello-sh example.

* gettext-tools/examples/hello-sh/hello-1.sh: Renamed from
gettext-tools/examples/hello-sh/hello.sh.
* gettext-tools/examples/hello-sh/hello-2.sh: New file, based on
gettext-tools/examples/hello-sh/hello-1.sh.
* gettext-tools/examples/hello-sh/hello-3.sh: New file, based on
gettext-tools/examples/hello-sh/hello-2.sh.
* gettext-tools/examples/hello-sh/configure.ac: Update AC_CONFIG_SRCDIR
invocation and AC_CONFIG_FILES invocations.
* gettext-tools/examples/hello-sh/Makefile.am (bin_SCRIPTS): Remove hello.
Add hello-1, hello-2, hello-3.
* gettext-tools/examples/hello-sh/po/Makefile.am (POTFILES): Remove hello.sh.
Add hello-1.sh, hello-2.sh, hello-3.sh.
* gettext-tools/examples/po/Makefile.am (POTFILES): Update accordingly.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES): Update file list.

3 months agoShell: Add another unit test.
Bruno Haible [Fri, 27 Jun 2025 21:18:50 +0000 (23:18 +0200)] 
Shell: Add another unit test.

* gettext-tools/tests/lang-sh-3: New file, based on
gettext-tools/tests/lang-sh-2.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

3 months agobuild: Use module 'kwset' from gnulib.
Bruno Haible [Thu, 26 Jun 2025 20:15:27 +0000 (22:15 +0200)] 
build: Use module 'kwset' from gnulib.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_LIBGREP): Add kwset.
(GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES): Update.
* gettext-tools/libgrep/m-fgrep.c (Fcompile, Fexecute): Update for changed kwset
API.
* gettext-tools/libgrep/kwset.h: Remove file.
* gettext-tools/libgrep/kwset.c: Remove file.
* gettext-tools/libgrep/Makefile.am (libgrep_a_SOURCES): Remove kwset.h,
kwset.c.

3 months agoUpdate to the newest gnulib.
Bruno Haible [Thu, 26 Jun 2025 20:05:41 +0000 (22:05 +0200)] 
Update to the newest gnulib.

3 months agobuild: Update regarding current gnulib.
Bruno Haible [Thu, 26 Jun 2025 19:40:01 +0000 (21:40 +0200)] 
build: Update regarding current gnulib.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES): Update.

3 months agobuild: Fix "make distcheck" failure.
Bruno Haible [Wed, 25 Jun 2025 04:56:21 +0000 (06:56 +0200)] 
build: Fix "make distcheck" failure.

* gettext-runtime/man/*.x: Add copyright and license header.

3 months agoxgettext: Shell: Recognize printf_gettext, printf_ngettext invocations.
Bruno Haible [Wed, 25 Jun 2025 02:16:09 +0000 (04:16 +0200)] 
xgettext: Shell: Recognize printf_gettext, printf_ngettext invocations.

* gettext-tools/src/x-sh.c (init_keywords, init_flag_table_sh): Add knowledge
about printf_gettext and printf_ngettext.
(read_command): Recognize '-c' option of printf_gettext and printf_ngettext.
* gettext-tools/tests/xgettext-sh-1: Add test cases with printf_gettext and
printf_ngettext.
* gettext-tools/doc/xgettext.texi: Document it.

3 months agogettext-runtime: New programs 'printf_gettext', 'printf_ngettext'.
Bruno Haible [Wed, 25 Jun 2025 02:16:03 +0000 (04:16 +0200)] 
gettext-runtime: New programs 'printf_gettext', 'printf_ngettext'.

* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC): Add c-ctype, c-strtold,
fzprintf-posix, mbrtoc32, mbszero, quote, stdint-h, strtoimax, strtold,
strtoumax, xstrtold.
* gettext-runtime/src/printf-command.h: New file.
* gettext-runtime/src/printf-command.c: New file.
* gettext-runtime/src/printf_gettext.c: New file.
* gettext-runtime/src/Makefile.am (bin_PROGRAMS): Add printf_gettext,
printf_ngettext.
(noinst_LIBRARIES, libgrtsrc_a_SOURCES): New variables.
(printf_gettext_SOURCES, printf_gettext_CFLAGS, printf_gettext_LDFLAGS): New
variables.
(printf_ngettext_SOURCES, printf_ngettext_CFLAGS, printf_ngettext_LDFLAGS): New
variables.
(LDADD): Add libgrtsrc.a.
* gettext-runtime/po/POTFILES.in: Add src/printf-command.c,
src/printf_gettext.c, src/printf_ngettext.c.
* gettext-runtime/man/printf_gettext.x: New file.
* gettext-runtime/man/printf_ngettext.x: New file.
* gettext-runtime/man/Makefile.am (man_aux): Add printf_gettext.x,
printf_ngettext.x.
(man_MAN1GEN): Add printf_gettext.1, printf_ngettext.1.
(man_MAN1IN): Add printf_gettext.1.in, printf_ngettext.1.in.
(man_HTML1GEN): Add printf_gettext.1.html, printf_ngettext.1.html.
(man_HTML1IN): Add printf_gettext.1.html.in, printf_ngettext.1.html.in.
(printf_gettext.1, rintf_ngettext.1, printf_gettext.1.in, printf_ngettext.1.in):
Add dependencies.
(printf_gettext.1.html, printf_ngettext.1.html, printf_gettext.1.html.in,
printf_ngettext.1.html.in): Likewise.
* gettext-runtime/Makefile.am (distdir1): Depend on man/printf_gettext.1 and
man/printf_ngettext.1.
(man/printf_gettext.1, man/printf_ngettext.1): Depend on gen-man1.
(gen-man1): Make src/printf_gettext, src/printf_ngettext and printf_gettext.1,
printf_ngettext.1.
* gettext-runtime/doc/rt-printf_gettext.texi: New file.
* gettext-runtime/doc/rt-printf_ngettext.texi: New file.
* gettext-runtime/doc/Makefile.am (EXTRA_DIST): Add them.
* gettext-tools/doc/lang-sh.texi (printf_gettext Invocation,
printf_ngettext Invocation): New subsubsections.
* gettext-tools/doc/gettext.texi (@direntry): Add printf_gettext, .
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add rt-printf_gettext.texi,
rt-printf_ngettext.texi.
* gettext-runtime/NEWS: Mention the new programs.
* NEWS: Likewise.
* PACKAGING: Add the printf_gettext and printf_ngettext programs and their
documentation.

3 months agogettext-runtime: Improve --help output.
Bruno Haible [Wed, 25 Jun 2025 02:15:58 +0000 (04:15 +0200)] 
gettext-runtime: Improve --help output.

* gettext-runtime/src/gettext.c (usage): Add section title
"Options and arguments".
* gettext-runtime/src/ngettext.c (usage): Likewise.
* gettext-runtime/doc/rt-gettext.texi: Add section titles
"Options and arguments" and "Informative output".
* gettext-runtime/doc/rt-ngettext.texi: Likewise.

3 months agoC++: Add another unit test.
Bruno Haible [Tue, 24 Jun 2025 10:28:21 +0000 (12:28 +0200)] 
C++: Add another unit test.

* gettext-tools/tests/lang-c++-boost: New file, based on
gettext-tools/tests/lang-c++26.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/lang-c.texi: Mention how to use C++ with the Boost library.
* HACKING: Mention the Boost library.

3 months agoShell: Add another unit test.
Bruno Haible [Tue, 24 Jun 2025 05:23:56 +0000 (07:23 +0200)] 
Shell: Add another unit test.

* gettext-tools/tests/lang-sh-1: Renamed from gettext-tools/tests/lang-sh.
* gettext-tools/tests/lang-sh-2: New file, based on
gettext-tools/tests/lang-sh-1.
* gettext-tools/tests/Makefile.am (TESTS): Remove lang-sh. Add lang-sh-1,
lang-sh-2.

3 months agoPython: Add another unit test.
Bruno Haible [Tue, 24 Jun 2025 09:26:42 +0000 (11:26 +0200)] 
Python: Add another unit test.

* gettext-tools/tests/lang-python-2: New file, based on
gettext-tools/tests/lang-python-1.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

3 months agoPython: Update python-brace-format, assuming Python >= 3.1.
Bruno Haible [Tue, 24 Jun 2025 09:24:55 +0000 (11:24 +0200)] 
Python: Update python-brace-format, assuming Python >= 3.1.

* gettext-tools/src/format-python-brace.c (struct toplevel_counters): New type.
(parse_directive): Take a 'struct toplevel_counters *' parameter. Allow empty
argument names at the top-level. But reject format strings with both absolute
argument numbers and unnamed arguments at the top-level.
(parse_upto): Take a 'struct toplevel_counters *' parameter.
(format_parse): Pass a 'struct toplevel_counters *' to parse_upto.
* gettext-tools/tests/format-python-brace-1: Update.
* gettext-tools/tests/format-python-brace-2: Add another test case.
* gettext-tools/doc/lang-python.texi: Add more examples of formatting with
positions.

3 months agoPython: Fix bug in python-brace-format.
Bruno Haible [Tue, 24 Jun 2025 09:15:46 +0000 (11:15 +0200)] 
Python: Fix bug in python-brace-format.

* gettext-tools/src/format-python-brace.c (parse_directive): The name ends
before ':', not before '}'.

3 months agoPython: Remove an obsolete unit test.
Bruno Haible [Tue, 24 Jun 2025 07:59:20 +0000 (09:59 +0200)] 
Python: Remove an obsolete unit test.

Python versions < 2.3 are irrelevant nowadays.

* gettext-tools/tests/lang-python-1: Renamed from
gettext-tools/tests/lang-python-2.
* gettext-tools/tests/Makefile.am (TESTS): Remove lang-python-2.

3 months agoSupport format strings longer than 2 GiB on 64-bit platforms.
Bruno Haible [Mon, 23 Jun 2025 19:20:46 +0000 (21:20 +0200)] 
Support format strings longer than 2 GiB on 64-bit platforms.

* gettext-tools/configure.ac: In config.h, define GCD_WORD_T.
* gettext-tools/src/format-invalid.h: In format strings, use %zu instead of %u.
* gettext-tools/src/format-awk.c: Use size_t instead of 'unsigned int'. In
format strings, use %zu instead of %u.
* gettext-tools/src/format-boost.c: Likewise.
* gettext-tools/src/format-c.c: Likewise.
* gettext-tools/src/format-c-parse.h: Likewise.
* gettext-tools/src/format-c++-brace.c: Likewise.
* gettext-tools/src/format-csharp.c: Likewise.
* gettext-tools/src/format-d.c: Likewise.
* gettext-tools/src/format-elisp.c: Likewise.
* gettext-tools/src/format-gcc-internal.c: Likewise.
* gettext-tools/src/format-gfc-internal.c: Likewise.
* gettext-tools/src/format-go.c: Likewise.
* gettext-tools/src/format-java.c: Likewise.
* gettext-tools/src/format-java-printf.c: Likewise.
* gettext-tools/src/format-javascript.c: Likewise.
* gettext-tools/src/format-kde.c: Likewise.
* gettext-tools/src/format-kde-kuit.c: Likewise.
* gettext-tools/src/format-librep.c: Likewise.
* gettext-tools/src/format-lisp.c: Likewise.
* gettext-tools/src/format-lua.c: Likewise.
* gettext-tools/src/format-modula2.c: Likewise.
* gettext-tools/src/format-pascal.c: Likewise.
* gettext-tools/src/format-perl.c: Likewise.
* gettext-tools/src/format-perl-brace.c: Likewise.
* gettext-tools/src/format-php.c: Likewise.
* gettext-tools/src/format-python.c: Likewise.
* gettext-tools/src/format-python-brace.c: Likewise.
* gettext-tools/src/format-qt.c: Likewise.
* gettext-tools/src/format-qt-plural.c: Likewise.
* gettext-tools/src/format-ruby.c: Likewise.
* gettext-tools/src/format-rust.c: Likewise.
* gettext-tools/src/format-scheme.c: Likewise.
* gettext-tools/src/format-sh.c: Likewise.
* gettext-tools/src/format-sh-printf.c: Likewise.
* gettext-tools/src/format-smalltalk.c: Likewise.
* gettext-tools/src/format-tcl.c: Likewise.
* gettext-tools/src/format.h (get_python_format_unnamed_arg_count): Return
size_t instead of 'unsigned int'.

3 months agoUpdate to the newest gnulib.
Bruno Haible [Mon, 23 Jun 2025 19:20:23 +0000 (21:20 +0200)] 
Update to the newest gnulib.

3 months agogettext-runtime: Fix --help output in relocatable installations.
Bruno Haible [Mon, 23 Jun 2025 19:20:13 +0000 (21:20 +0200)] 
gettext-runtime: Fix --help output in relocatable installations.

* gettext-runtime/src/gettext.c (usage): Show the relocated LOCALEDIR.
* gettext-runtime/src/ngettext.c (usage): Likewise.

3 months agoAdhere to GNU Coding Style.
Bruno Haible [Mon, 23 Jun 2025 19:20:07 +0000 (21:20 +0200)] 
Adhere to GNU Coding Style.

* gettext-runtime/src/gettext.c (usage): Add space after 'printf'.
* gettext-runtime/src/ngettext.c (usage): Likewise.
* gettext-runtime/src/envsubst.c (usage): Likewise.

3 months agoAdd support for Shell printf format strings, part 3.
Bruno Haible [Mon, 23 Jun 2025 19:20:02 +0000 (21:20 +0200)] 
Add support for Shell printf format strings, part 3.

* gettext-tools/src/format-invalid.h (INVALID_FLAG_FOR): New macro.
* gettext-tools/src/format-java-printf.c (INVALID_FLAG_FOR): Remove macro.
* gettext-tools/src/format-sh-printf.c (format_parse): Reject format strings
with invalid flag+specifier combinations.
* gettext-tools/tests/format-sh-printf-1: Add more test cases.
* gettext-tools/doc/gettext.texi (sh-format): Mention the ' flag.

3 months agoAdd support for Shell printf format strings, part 2.
Bruno Haible [Mon, 23 Jun 2025 19:19:56 +0000 (21:19 +0200)] 
Add support for Shell printf format strings, part 2.

* gettext-tools/po/POTFILES.in: Add src/format-sh-printf.c.
* gettext-tools/tests/format-sh-printf-1: Use 'printf' instead of 'echo',
because 'echo' processes escape sequences on macOS, OpenBSD, Solaris.

3 months agoAdd support for Shell printf format strings.
Bruno Haible [Sun, 22 Jun 2025 08:56:33 +0000 (10:56 +0200)] 
Add support for Shell printf format strings.

* gettext-tools/src/message.h (enum format_type): Add format_sh_printf.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_sh_printf.
* gettext-tools/src/format.h (formatstring_sh_printf): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add an entry for
format_sh_printf.
* gettext-tools/src/format-sh-printf.c: New file, based on
gettext-tools/src/format-awk.c.
* gettext-tools/src/FILES: Mention it.
* gettext-tools/src/x-sh.h (SCANNERS_SH): Use formatstring_sh_printf as
secondary format string type.
* gettext-tools/src/xgettext.c (xgettext_record_flag): Update accordingly.
* gettext-tools/src/x-sh.c (init_flag_table_sh): Register gettext, ngettext with
flag 'pass-sh-printf-format'. Register 'printf' with flag 'sh-printf-format'.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-sh-printf.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Likewise.
* gettext-tools/doc/gettext.texi (PO Files): Mention sh-printf-format.
(sh-format): Document also the sh-printf-format strings.
* gettext-tools/doc/lang-sh.texi (sh): Mention the coreutils 'printf' command.
* gettext-tools/tests/xgettext-sh-1: Add a test case with a printf invocation.
* gettext-tools/tests/format-sh-printf-1: New file, based on
gettext-tools/tests/format-awk-1.
* gettext-tools/tests/format-sh-printf-2: New file, based on
gettext-tools/tests/format-awk-2.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* NEWS: Mention the change.

3 months agotcl-format: Accept null precision.
Bruno Haible [Sun, 22 Jun 2025 01:17:40 +0000 (03:17 +0200)] 
tcl-format: Accept null precision.

Proof that it's valid:
$ tclsh
puts [format "%.f" 3.1415926535]

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

3 months agorust-format: Reject null precision.
Bruno Haible [Sun, 22 Jun 2025 01:12:44 +0000 (03:12 +0200)] 
rust-format: Reject null precision.

* gettext-tools/tests/format-rust-1: Add more test cases with null precision.

3 months agoruby-format: Accept null precision.
Bruno Haible [Sun, 22 Jun 2025 01:09:48 +0000 (03:09 +0200)] 
ruby-format: Accept null precision.

Proof that it's valid:
$ ruby
puts "%.f" % 3.1415926535

* gettext-tools/src/format-ruby.c: Clarify comment regarding the precision.
* gettext-tools/tests/format-ruby-1: Add test cases with null precision.

3 months agopython-brace-format: Reject null precision.
Bruno Haible [Sun, 22 Jun 2025 00:58:31 +0000 (02:58 +0200)] 
python-brace-format: Reject null precision.

Proof that it's invalid:
$ python
print("{value:.}".format(value = 3.141592535))

* gettext-tools/tests/format-python-brace-1: Add another test case with null
precision.

3 months agopython-format: Accept null precision.
Bruno Haible [Sun, 22 Jun 2025 00:48:26 +0000 (02:48 +0200)] 
python-format: Accept null precision.

Proof that it's valid:
$ python
print("%(value).f" % { 'value': 3.1415926535 })

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

3 months agophp-format: Reject null precision.
Bruno Haible [Sun, 22 Jun 2025 00:38:50 +0000 (02:38 +0200)] 
php-format: Reject null precision.

Rationale: The handling of null precision in php is buggy,
cf. <https://github.com/php/php-src/issues/18897>.

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

3 months agoperl-format: Accept null precision.
Bruno Haible [Sun, 22 Jun 2025 00:16:38 +0000 (02:16 +0200)] 
perl-format: Accept null precision.

Proof that it's valid:
$ perl
printf "%.f", 3.1415926535

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

3 months agopascal-format: Accept null precision.
Bruno Haible [Sun, 22 Jun 2025 00:11:33 +0000 (02:11 +0200)] 
pascal-format: Accept null precision.

Proof that it's valid:
------------------------- foo.pp -------------------------
program foo;
uses sysutils;
begin
  writeln(format('%.f', [3.1415926535]));
end.
----------------------------------------------------------

* gettext-tools/src/format-pascal.c: Fix comment regarding the precision.
(format_parse): Accept a null precision after '.'.
* gettext-tools/tests/format-pascal-1: Add a test case with null precision.

3 months agolua-format: Accept null precision. Limit width and precision to two digits.
Bruno Haible [Sat, 21 Jun 2025 23:37:58 +0000 (01:37 +0200)] 
lua-format: Accept null precision. Limit width and precision to two digits.

Proof that it's valid:
$ lua
print(string.format("%.f", 3.1415926535))

* gettext-tools/src/format-lua.c: Fix comment regarding the width and the
precision.
(format_parse): Recognize at most two digits for the width. Recognize at most
two digits for the precision.
* gettext-tools/tests/format-lua-1: Add test cases with large width, null
precision, and large precision.

3 months agolibrep-format: Accept null precision.
Bruno Haible [Sat, 21 Jun 2025 23:30:12 +0000 (01:30 +0200)] 
librep-format: Accept null precision.

Proof that it's valid:
$ rep
(format t "%.d" 3.1415926535)

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

3 months agojavascript-format: Reject null precision.
Bruno Haible [Sat, 21 Jun 2025 23:20:32 +0000 (01:20 +0200)] 
javascript-format: Reject null precision.

Proof that it's invalid:
------------------------------- foo.js -------------------------------
const Format = imports.format;
String.prototype.format = Format.format;
print("%.f".format(3.1415916535));
----------------------------------------------------------------------
$ gjs foo.js

* gettext-tools/src/format-invalid.h (INVALID_PRECISION_MISSING): New macro.
* gettext-tools/src/format-java-printf.c (INVALID_PRECISION_MISSING): Remove
macro.
* gettext-tools/src/format-javascript.c: Fix comment regarding the precision.
(format_parse): Report an error if the precision is null (empty).
* gettext-tools/tests/format-javascript-1: Add a test case with null precision.

3 months agojava-printf-format: Reject null precision.
Bruno Haible [Sat, 21 Jun 2025 23:12:35 +0000 (01:12 +0200)] 
java-printf-format: Reject null precision.

Proof that it's invalid:
--------------------------- foo.java ---------------------------
public class foo {
  public static void main(String[] args) {
    System.out.println(String.format("%.f\n", 3.1415926535));
  }
}
----------------------------------------------------------------

* gettext-tools/tests/format-java-printf-1: Add a test case with null precision.

3 months agogo-format: Accept null precision.
Bruno Haible [Sat, 21 Jun 2025 23:08:15 +0000 (01:08 +0200)] 
go-format: Accept null precision.

* gettext-tools/src/format-go.c: Clarify comment regarding the precision.
(format_parse): Accept a null precision after '.'.
* gettext-tools/tests/format-go-1: Add a test case with null precision.

3 months agoelisp-format: Accept null precision.
Bruno Haible [Sat, 21 Jun 2025 22:54:23 +0000 (00:54 +0200)] 
elisp-format: Accept null precision.

Proof that is is valid:
(format "%.f" 3.1415926)

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

3 months agod-format: Accept null precision.
Bruno Haible [Sat, 21 Jun 2025 22:16:28 +0000 (00:16 +0200)] 
d-format: Accept null precision.

Proof that a null precision is valid:
------------------------------- foo.d -------------------------------
import std.stdio;
import std.format;
void main () { writeln (format ("%.f", 3.1415926)); }
---------------------------------------------------------------------

* gettext-tools/tests/format-d-1: Add a test case with null precision.

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.

3 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.

3 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.

3 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.

3 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".

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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.