]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
5 months agoUpdate to the newest gnulib.
Bruno Haible [Thu, 24 Apr 2025 20:13:55 +0000 (22:13 +0200)] 
Update to the newest gnulib.

5 months agoxgettext: D: Allow comments between the parts of concatenated string literals.
Bruno Haible [Wed, 23 Apr 2025 17:50:04 +0000 (19:50 +0200)] 
xgettext: D: Allow comments between the parts of concatenated string literals.

* gettext-tools/src/x-d.c (is_add_expression_with_tilde): New function.
(is_string_literal, string_literal_accumulate_pieces): Use it.
* gettext-tools/tests/xgettext-d-2: Add another test case regarding string
concatenation.

5 months agoxgettext: Go: More unit tests.
Bruno Haible [Wed, 23 Apr 2025 16:54:41 +0000 (18:54 +0200)] 
xgettext: Go: More unit tests.

* gettext-tools/tests/xgettext-go-6: Add more test cases regarding string
concatenation.

5 months agoRefactor: Make format-lua.c more similar to format-elisp.c.
Bruno Haible [Wed, 23 Apr 2025 14:50:34 +0000 (16:50 +0200)] 
Refactor: Make format-lua.c more similar to format-elisp.c.

* gettext-tools/src/format-lua.c (format_parse): Allocate the final spec on the
heap only once parsing was successful.

5 months agobuild: Simplify.
Bruno Haible [Tue, 22 Apr 2025 13:28:41 +0000 (15:28 +0200)] 
build: Simplify.

* gettext-runtime/configure.ac: Don't test whether setlocale exists.

5 months agoUpdate after gnulib changed.
Bruno Haible [Wed, 16 Apr 2025 14:29:46 +0000 (16:29 +0200)] 
Update after gnulib changed.

* gitsub.sh: Update from gnulib.

5 months agoUpdate after gnulib changed.
Bruno Haible [Tue, 15 Apr 2025 11:17:58 +0000 (13:17 +0200)] 
Update after gnulib changed.

* libtextstyle/autogen.sh: Don't avoid module 'locale-h'. vasnprintf now needs
localeconv, and localeconv depends on locale-h.

5 months agobuild: Simplify D configuration-time support.
Bruno Haible [Tue, 15 Apr 2025 10:58:43 +0000 (12:58 +0200)] 
build: Simplify D configuration-time support.

* gettext-runtime/configure.ac: Don't search for the D compiler a second time
(already done by gt_DCOMP).
* gettext-tools/configure.ac: Likewise.

6 months agobuild: Simplify last commit.
Bruno Haible [Wed, 2 Apr 2025 12:47:40 +0000 (14:47 +0200)] 
build: Simplify last commit.

* gettext-tools/src/Makefile.am (LIBXGETTEXTX): Remove variable.

6 months agobuild: Make it possible to compile x-go.c with GCC 11 in 1 GB of RAM.
Bruno Haible [Wed, 2 Apr 2025 12:39:28 +0000 (14:39 +0200)] 
build: Make it possible to compile x-go.c with GCC 11 in 1 GB of RAM.

* gettext-tools/src/Makefile.am (LIBXGETTEXTX, libxgettextx_a_SOURCES,
libxgettextx_a_CPPFLAGS, libxgettextx_a_CFLAGS): New variables.
(xgettext_SOURCES): Remove x-go.c.
(noinst_LIBRARIES, xgettext_LDADD, xgettext_DEPENDENCIES): Add $(LIBXGETTEXTX).

6 months agobuild: Make it possible to compile tree-sitter with GCC 11 in 1 GB of RAM.
Bruno Haible [Wed, 2 Apr 2025 12:13:47 +0000 (14:13 +0200)] 
build: Make it possible to compile tree-sitter with GCC 11 in 1 GB of RAM.

* gettext-tools/src/Makefile.am (libxgettextts1_a_CFLAGS,
libxgettextts2_a_CFLAGS, libxgettextts3_a_CFLAGS, libxgettextts4_a_CFLAGS): New
variables.

6 months agogettextize: Fix last commit.
Bruno Haible [Wed, 2 Apr 2025 12:08:22 +0000 (14:08 +0200)] 
gettextize: Fix last commit.

* gettext-tools/m4/Makefile.am (OLD_M4_FILES): New variable.
(uninstall-macros): Delete only these files from @aclocaldir@.

6 months agogettextize: Fix bad interactions between autoreconf and autopoint.
Bruno Haible [Wed, 2 Apr 2025 12:07:39 +0000 (14:07 +0200)] 
gettextize: Fix bad interactions between autoreconf and autopoint.

Reported by Sebastian Pipping <sebastian@pipping.org>
in <https://savannah.gnu.org/bugs/index.php?66968>.

* gettext-tools/m4/Makefile.am (aclocaldir): Remove variable.
(pkgdatadir, macrosdir): Add variables.
(macros_DATA): Renamed from aclocal_DATA.
(install-data-local, uninstall-local, uninstall-macros): New targets.
* gettext-tools/misc/gettextize.in: Copy the *.m4 files from
$datadir/gettext/m4, not from $datadir/aclocal.
* gettext-tools/doc/gettext.texi (aclocal): Don't recommend to add option
--install to ACLOCAL_MFLAGS. Instead, recommend one-time use of --system-acdir.
* PACKAGING: Expect *.m4 files in $prefix/share/gettext/m4, not in
$prefix/share/aclocal.
* NEWS: Mention the fix.

6 months agoexamples: Add hello-d example.
Bruno Haible [Tue, 1 Apr 2025 21:11:13 +0000 (23:11 +0200)] 
examples: Add hello-d example.

* gettext-tools/examples/hello-d/INSTALL: New file.
* gettext-tools/examples/hello-d/autogen.sh: New file.
* gettext-tools/examples/hello-d/autoclean.sh: New file.
* gettext-tools/examples/hello-d/hello.d.in: New file.
* gettext-tools/examples/hello-d/Makefile.am: New file.
* gettext-tools/examples/hello-d/configure.ac: New file.
* gettext-tools/examples/hello-d/m4/Makefile.am: New file.
* gettext-tools/examples/hello-d/po/LINGUAS: New file.
* gettext-tools/examples/hello-d/po/Makefile.am: New file.
* gettext-tools/examples/installpaths.in: Define also includedir.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add hello-d.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for hello-d.
(hello-d.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-d.
($(srcdir)/../hello-d/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-d as well.
* gettext-tools/examples/README: Mention hello-d.
* gettext-tools/doc/lang-d.texi: Likewise.
* NEWS: Likewise.

6 months agoD support: Add a unit test.
Bruno Haible [Tue, 1 Apr 2025 15:20:31 +0000 (17:20 +0200)] 
D support: Add a unit test.

* autogen.sh (GNULIB_MODULES_TOOLS_OTHER): Add d, dcomp-script.
* gettext-tools/configure.ac: Set and substitute BUILDD.
* gettext-tools/tests/init-env.in: Propagate D_CHOICE, BUILDD.
* gettext-tools/tests/lang-d: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

6 months agoD support: Add D support in the tools.
Bruno Haible [Tue, 1 Apr 2025 09:51:08 +0000 (11:51 +0200)] 
D support: Add D support in the tools.

* autopull.sh: Check out tree-sitter-d. Set TREE_SITTER_D_VERSION.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add unistr/u16-check,
unistr/u16-to-u8, unistr/u32-check, unistr/u32-to-u8.
* gettext-tools/build-aux/tree-sitter-d-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_D_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter-d source code and
patch.
* gettext-tools/doc/lang-d.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (PO Files): Mention d-format.
(No string concatenation): Mention string concatenation and string interpolation
in D.
(Translators for other Languages): New subsection "D Format Strings".
(List of Programming Languages): Include lang-d.texi.
* gettext-tools/doc/xgettext.texi: Document the -L D option.
* gettext-tools/src/message.h (format_d): New enum value.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_d.
* gettext-tools/src/format-d.c: New file, based on
gettext-tools/src/format-lisp.c.
* gettext-tools/src/format.h (formatstring_d): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add formatstring_d.
* gettext-tools/src/x-d.h: New file.
* gettext-tools/src/x-d.c: New file, based on gettext-tools/src/x-rust.c and
gettext-tools/src/x-go.c.
* gettext-tools/src/html5-entities.h: New file.
* gettext-tools/src/xgettext.c: Include x-d.h.
(flag_table_d): New variable.
(main): Invoke init_flag_table_d, x_d_extract_all, x_d_keyword.
(usage): Document the -L D option.
(xgettext_record_flag): Support format_d.
(language_to_extractor, extension_to_language): Support D.
* gettext-tools/src/xg-message.c (decide_is_format, remember_a_message_plural):
Add better heuristic for c-format and d-format.
* gettext-tools/src/FILES: Mention format-d.c, x-d.h, x-d.c, html5-entities.h.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add x-d.h, html5-entities.h.
(FORMAT_SOURCE): Add format-d.c.
(libxgettextts2_a_SOURCES): Add d-parser.c, d-scanner.c.
(xgettext_SOURCES): Add x-d.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-d.c.
* gettext-tools/po/POTFILES.in: Add src/format-d.c, src/x-d.c.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export formatstring_d.
* gettext-tools/tests/format-d-1: New file.
* gettext-tools/tests/format-d-2: New file.
* gettext-tools/tests/xgettext-d-1: New file.
* gettext-tools/tests/xgettext-d-2: New file.
* gettext-tools/tests/xgettext-d-3: New file.
* gettext-tools/tests/xgettext-d-4: New file.
* gettext-tools/tests/xgettext-d-5: New file, based on
gettext-tools/tests/xgettext-rust-5.
* gettext-tools/tests/xgettext-d-6: New file, based on
gettext-tools/tests/xgettext-rust-7.
* gettext-tools/tests/testdata/dprog.utf-8.d: New file.
* gettext-tools/tests/testdata/dprog.utf-8+bom.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/testdata/dprog.utf-16be.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/testdata/dprog.utf-16le.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/testdata/dprog.utf-32be.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/testdata/dprog.utf-32le.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
(EXTRA_DIST): Add the new testdata files.
* NEWS: Mention the D support.

6 months agoD support: Add the runtime library.
Bruno Haible [Tue, 1 Apr 2025 00:18:40 +0000 (02:18 +0200)] 
D support: Add the runtime library.

* gnulib-local/m4/d.m4: New file.
* gnulib-local/modules/d: New file.
* gnulib-local/Makefile.am (EXTRA_DIST): Add d.m4 and the 'd' module.
* autogen.sh (GNULIB_MODULES_RUNTIME_OTHER): Add d, dcomp-script.
* gettext-runtime/intl-d/Makefile.am: New file.
* gettext-runtime/intl-d/gnu/libintl/package.d: New file.
* gettext-runtime/intl-d/gnu/libintl/libintl.d: New file.
* gettext-runtime/intl-d/gnu/libintl/internal/low.d: New file.
* gettext-runtime/configure.ac: Invoke gt_D_CHOICE, gt_DCOMP. Set the variable
BUILDD and the Automake conditional BUILD_D.
* gettext-runtime/Makefile.am (SUBDIRS): Add intl-d.
* NEWS: Mention libintl_d.a.
* gettext-runtime/NEWS: Likewise.
* PACKAGING: Add the sources and binary for the libintl_d library.
* DEPENDENCIES: Mention the D compiler and runtime.

6 months agoUpdate to the newest gnulib.
Bruno Haible [Tue, 1 Apr 2025 00:25:15 +0000 (02:25 +0200)] 
Update to the newest gnulib.

6 months agoObjective-C: xgettext: Strengthen tests.
Bruno Haible [Thu, 27 Mar 2025 18:09:57 +0000 (19:09 +0100)] 
Objective-C: xgettext: Strengthen tests.

* gettext-tools/tests/xgettext-objc-1: Add test cases with format strings.

6 months agodoc: Small updates.
Bruno Haible [Tue, 25 Mar 2025 21:38:49 +0000 (22:38 +0100)] 
doc: Small updates.

Reported by Michael Chirico <michaelchirico4@gmail.com>.

* gettext-tools/doc/gettext.texi (The LANGUAGE variable): Rephrase
recommendation for Norwegian users.
(Header Entry): Remove statement about old versions of Emacs.

6 months agoRefactor: Use more of c-ctype.h.
Bruno Haible [Sun, 23 Mar 2025 19:17:56 +0000 (20:17 +0100)] 
Refactor: Use more of c-ctype.h.

* gettext-tools/src/format-awk.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-boost.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-c-parse.h (isdigit): Remove macro.
(format_parse_entrails): Use c_isdigit instead.
* gettext-tools/src/format-c++-brace.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-elisp.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-gcc-internal.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-gfc-internal.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-go.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-java-printf.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-javascript.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-librep.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-lua.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-pascal.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-perl.c (isdigit): Remove macro.
(c_isnonzerodigit): Renamed from isnonzerodigit.
(format_parse): Use c_isdigit instead of isdigit.
* gettext-tools/src/format-php.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-python.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-ruby.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.
* gettext-tools/src/format-tcl.c (isdigit): Remove macro.
(format_parse): Use c_isdigit instead.

6 months agoComment cleanup.
Bruno Haible [Sun, 23 Mar 2025 18:39:28 +0000 (19:39 +0100)] 
Comment cleanup.

* gettext-tools/src/format-rust.c: Remove obsolete comment.

6 months agoUpdate after gnulib changed.
Bruno Haible [Sat, 22 Mar 2025 12:20:36 +0000 (13:20 +0100)] 
Update after gnulib changed.

* gettext-runtime/intl/setlocale.c: Include setlocale-fixes.h instead of
setlocale-messages.h.
(setlocale_unixlike) [__ANDROID__]: Use setlocale_fixed instead of setlocale.
(setlocale_improved): On Android, use setlocale_fixed_null instead of setlocale.

6 months agoUpdate to the newest gnulib.
Bruno Haible [Sat, 22 Mar 2025 12:20:27 +0000 (13:20 +0100)] 
Update to the newest gnulib.

6 months agoAvoid bit rot of unused code.
Bruno Haible [Fri, 21 Mar 2025 22:55:42 +0000 (23:55 +0100)] 
Avoid bit rot of unused code.

* gettext-tools/src/format-lisp.c: Include attribute.h.
(intersection): Mark with MAYBE_UNUSED instead of '#ifdef unused'.
* gettext-tools/src/format-scheme.c (intersection): Likewise.
* gettext-tools/src/x-csharp.c (phase5_ungetc): Likewise.
* gettext-tools/src/x-php.c (phase3_ungetc): Likewise.

6 months agoSimplify strtoul() invocation.
Bruno Haible [Fri, 21 Mar 2025 21:37:12 +0000 (22:37 +0100)] 
Simplify strtoul() invocation.

* gnulib-local/lib/markup.c: Don't include <errno.h>.
(unescape_string_inplace): Don't reset or test errno.

6 months agoWork around an strtoul() misfeature.
Bruno Haible [Fri, 21 Mar 2025 18:44:33 +0000 (19:44 +0100)] 
Work around an strtoul() misfeature.

* gettext-runtime/src/ngettext.c: Include <ctype.h>.
(main): When parsing a nonnegative number, disallow leading whitespace and sign.
* gettext-tools/tests/tstngettext.c: Include <ctype.h>.
(worker_thread): When parsing a nonnegative number, disallow leading whitespace
and sign.
* gnulib-local/lib/markup.c (unescape_string_inplace): When parsing a numeric
character entity, disallow leading whitespace and sign, and report a too large
number as "non-permitted character" rather than "Numerical result out of range".
* gettext-tools/src/msgfmt.c (main): When parsing the '-a' argument, disallow
leading whitespace and sign and check whether the value is a power of 2.
* gettext-tools/src/read-stringtable.c: Include c-ctype.h.
(comment_line_end): When parsing a line number, disallow leading whitespace and
sign.

6 months agoRefactor.
Bruno Haible [Thu, 20 Mar 2025 16:04:11 +0000 (17:04 +0100)] 
Refactor.

* gettext-tools/src/x-rust.c (ts_language_symbol, ts_language_field): Follow GNU
coding style.
* gettext-tools/src/x-go.c (ts_language_symbol, ts_language_field): Likewise.
* gettext-tools/src/x-typescript-impl.h (ts_language_symbol, ts_language_field):
Likewise.

6 months agoMakevars template: Fix small mistake.
Bruno Haible [Thu, 20 Mar 2025 11:02:45 +0000 (12:02 +0100)] 
Makevars template: Fix small mistake.

* gettext-tools/po/Makevars.template: Correct statement about copyright.
* gettext-runtime/po/Makevars: Likewise.
* gettext-tools/po/Makevars: Likewise.
* gettext-tools/examples/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-*/po/Makevars: Likewise.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile: Likewise.

6 months agodoc: Fix small mistake.
Bruno Haible [Thu, 20 Mar 2025 10:48:58 +0000 (11:48 +0100)] 
doc: Fix small mistake.

* gettext-tools/doc/xgettext.texi: Correct statement about copyright.

6 months agodoc: Mention strings with embedded expressions in TypeScript.
Bruno Haible [Tue, 11 Mar 2025 13:52:02 +0000 (14:52 +0100)] 
doc: Mention strings with embedded expressions in TypeScript.

* gettext-tools/doc/gettext.texi (No string concatenation): Mention
"template literals" in TypeScript.

6 months agoAdd TypeScript support.
Bruno Haible [Tue, 11 Mar 2025 08:55:56 +0000 (09:55 +0100)] 
Add TypeScript support.

* autopull.sh: Check out tree-sitter-typescript. Set
TREE_SITTER_TYPESCRIPT_VERSION.
* gettext-tools/build-aux/tree-sitter-typescript-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_TYPESCRIPT_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter-typescript source
code and patch.
* gettext-tools/doc/lang-typescript.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (No string concatenation): Mention string
concatenation in TypeScript.
(List of Programming Languages): Include lang-typescript.texi.
* gettext-tools/doc/xgettext.texi: Document the -L TypeScript and -L TSX
options.
* gettext-tools/src/x-typescript-impl.h: New file.
* gettext-tools/src/x-typescript.h: New file.
* gettext-tools/src/x-typescript.c: New file.
* gettext-tools/src/x-typescriptx.h: New file.
* gettext-tools/src/x-typescriptx.c: New file.
* gettext-tools/src/xgettext.c: Include x-typescript.h, x-typescriptx.h.
(flag_table_typescript, flag_table_typescriptx): New variables.
(main): Invoke init_flag_table_typescript, init_flag_table_typescriptx,
x_typescript_extract_all, x_typescriptx_extract_all, x_typescript_keyword,
x_typescriptx_keyword.
(usage): Document the -L TypeScript and -L TSX options.
(xgettext_record_flag): Support format_javascript with TypeScript and TSX.
(language_to_extractor, extension_to_language): Support TypeScript and TSX.
* gettext-tools/src/FILES: Mention x-typescript.h, x-typescript.c,
x-typescriptx.h, x-typescriptx.c, x-typescript-impl.h.
* gettext-tools/src/Makefile.am (noinst_LIBRARIES): Reference LIBXGETTEXTTS.
(noinst_HEADERS): Add x-typescript.h, x-typescriptx.h, x-typescript-impl.h.
(LIBXGETTEXTTS): Add libxgettextts3.a, libxgettextts4.a.
(libxgettextts3_a_SOURCES, libxgettextts3_a_CPPFLAGS): New variables.
(libxgettextts4_a_SOURCES, libxgettextts4_a_CPPFLAGS): New variables.
(xgettext_SOURCES): Add x-typescript.c, x-typescriptx.c.
* gettext-tools/tests/xgettext-javascript-6: Improve comments.
* gettext-tools/tests/xgettext-typescript-1: New file, based on
gettext-tools/tests/xgettext-javascript-1.
* gettext-tools/tests/xgettext-typescript-2: New file, based on
gettext-tools/tests/xgettext-javascript-2.
* gettext-tools/tests/xgettext-typescript-3: New file, based on
gettext-tools/tests/xgettext-javascript-3.
* gettext-tools/tests/xgettext-typescript-4: New file, based on
gettext-tools/tests/xgettext-javascript-4.
* gettext-tools/tests/xgettext-typescript-5: New file, based on
gettext-tools/tests/xgettext-javascript-5.
* gettext-tools/tests/xgettext-typescript-6: New file, based on
gettext-tools/tests/xgettext-javascript-6.
* gettext-tools/tests/xgettext-typescript-7: New file, based on
gettext-tools/tests/xgettext-javascript-7.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
* NEWS: Mention the TypeScript support.

6 months agoxgettext: Go: Refactor.
Bruno Haible [Tue, 11 Mar 2025 08:53:48 +0000 (09:53 +0100)] 
xgettext: Go: Refactor.

* gettext-tools/src/x-go.c (handle_comments): Remove 'contents' parameter.
(extract_from_function_call, extract_from_node): Update.

6 months agoexamples: Fix "make install".
Bruno Haible [Mon, 10 Mar 2025 06:33:04 +0000 (07:33 +0100)] 
examples: Fix "make install".

* gettext-tools/examples/Makefile.am (EXAMPLESFILES): Match actual file list.

6 months agoxgettext: Rust: Refactor, part 2.
Bruno Haible [Sun, 9 Mar 2025 13:48:40 +0000 (14:48 +0100)] 
xgettext: Rust: Refactor, part 2.

* gettext-tools/src/x-rust.c (handle_comments, string_literal_value): Remove
'contents' parameter.
(extract_from_function_call, extract_from_function_call_like,
extract_from_node): Update.

6 months agoFix a comment.
Bruno Haible [Sun, 9 Mar 2025 13:47:53 +0000 (14:47 +0100)] 
Fix a comment.

* gettext-tools/src/x-javascript.h: Fix typo in comment.

6 months agoexamples: Add hello-go-http example.
Bruno Haible [Sat, 8 Mar 2025 12:30:44 +0000 (13:30 +0100)] 
examples: Add hello-go-http example.

* gettext-tools/examples/hello-go-http/INSTALL: New file.
* gettext-tools/examples/hello-go-http/autogen.sh: New file.
* gettext-tools/examples/hello-go-http/autoclean.sh: New file.
* gettext-tools/examples/hello-go-http/example1/hello1ml.go.in: New file.
* gettext-tools/examples/hello-go-http/example1/go.mod.in: New file.
* gettext-tools/examples/hello-go-http/example1/Makefile.am: New file.
* gettext-tools/examples/hello-go-http/Makefile.am: New file.
* gettext-tools/examples/hello-go-http/configure.ac: New file.
* gettext-tools/examples/hello-go-http/m4/Makefile.am: New file.
* gettext-tools/examples/hello-go-http/po/LINGUAS: New file.
* gettext-tools/examples/hello-go-http/po/Makefile.am: New file.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-go-http.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-go-http.
(hello-go-http.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-go-http.
($(srcdir)/../hello-go-http/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-go-http as well.
* gettext-tools/examples/README: Mention hello-go-http.
* gettext-tools/doc/lang-go.texi: Likewise.
* NEWS: Likewise.

6 months agoexamples: Add hello-go example.
Bruno Haible [Sat, 8 Mar 2025 12:19:41 +0000 (13:19 +0100)] 
examples: Add hello-go example.

* gettext-tools/examples/hello-go/INSTALL: New file.
* gettext-tools/examples/hello-go/autogen.sh: New file.
* gettext-tools/examples/hello-go/autoclean.sh: New file.
* gettext-tools/examples/hello-go/example1/hello1sl.go.in: New file.
* gettext-tools/examples/hello-go/example1/hello1ml.go.in: New file.
* gettext-tools/examples/hello-go/example1/go.mod.in: New file.
* gettext-tools/examples/hello-go/example1/Makefile.am: New file.
* gettext-tools/examples/hello-go/example2/hello2sl.go.in: New file.
* gettext-tools/examples/hello-go/example2/go.mod.in: New file.
* gettext-tools/examples/hello-go/example2/Makefile.am: New file.
* gettext-tools/examples/hello-go/example3/hello3ml.go.in: New file.
* gettext-tools/examples/hello-go/example3/go.mod.in: New file.
* gettext-tools/examples/hello-go/example3/Makefile.am: New file.
* gettext-tools/examples/hello-go/Makefile.am: New file.
* gettext-tools/examples/hello-go/configure.ac: New file.
* gettext-tools/examples/hello-go/m4/Makefile.am: New file.
* gettext-tools/examples/hello-go/po/LINGUAS: New file.
* gettext-tools/examples/hello-go/po/Makefile.am: New file.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-go.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-go.
(hello-go.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-go.
($(srcdir)/../hello-go/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-go as well.
* gettext-tools/examples/README: Mention hello-go.
* gettext-tools/doc/lang-go.texi: Likewise.
* NEWS: Likewise.

6 months agotests: Fix autopoint-3 test failure on macOS.
Bruno Haible [Fri, 7 Mar 2025 21:14:42 +0000 (22:14 +0100)] 
tests: Fix autopoint-3 test failure on macOS.

* gettext-tools/tests/autopoint-3 (MAKE): Set to 'gmake' only if gmake exists.

6 months agoGo: Add integration test.
Bruno Haible [Fri, 7 Mar 2025 17:41:55 +0000 (18:41 +0100)] 
Go: Add integration test.

* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC): Add gocomp-script.
* gettext-tools/tests/init-env.in (GO_CHOICE, GO): New variables.
* gettext-tools/tests/lang-go: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* HACKING: Document dependencies for lang-go.

6 months agoUpdate to the newest gnulib.
Bruno Haible [Fri, 7 Mar 2025 17:39:59 +0000 (18:39 +0100)] 
Update to the newest gnulib.

6 months agotests: Fix autopoint-3 test failure on Solaris 11.
Bruno Haible [Fri, 7 Mar 2025 17:02:44 +0000 (18:02 +0100)] 
tests: Fix autopoint-3 test failure on Solaris 11.

* gettext-tools/tests/autopoint-3 (MAKE): Set to 'gmake' on macOS, Solaris, AIX.

6 months agoAdd Go support.
Bruno Haible [Fri, 7 Mar 2025 11:24:50 +0000 (12:24 +0100)] 
Add Go support.

* autopull.sh: Check out tree-sitter-go. Set TREE_SITTER_GO_VERSION.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add carray-list, hash-map,
hash-set, xlist, xmap, xset, xstring-buffer-reversed.
* gettext-tools/build-aux/tree-sitter-go-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_GO_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter-go source code and
patch.
* gettext-tools/doc/lang-go.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (PO Files): Mention go-format.
(No string concatenation): Mention string concatenation in Go.
(Translators for other Languages): New subsection "Go Format Strings".
(List of Programming Languages): Include lang-go.texi.
* gettext-tools/doc/xgettext.texi: Document the -L Go option.
* gettext-tools/src/message.h (format_go): New enum value.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_go.
* gettext-tools/src/format-go.c: New file.
* gettext-tools/src/format.h (formatstring_go): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add formatstring_go.
* gettext-tools/src/x-go.h: New file.
* gettext-tools/src/x-go.c: New file.
* gettext-tools/src/xgettext.c: Include x-go.h.
(flag_table_go): New variable.
(main): Invoke init_flag_table_go, x_go_extract_all, x_go_keyword.
(usage): Document the -L Go option.
(xgettext_record_flag): Support format_go.
(language_to_extractor, extension_to_language): Support Go.
* gettext-tools/src/FILES: Mention format-go.c, x-go.h, x-go.c.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add x-go.h.
(FORMAT_SOURCE): Add format-go.c.
(libxgettextts2_a_SOURCES): Add go-parser.c.
(xgettext_SOURCES): Add x-go.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-go.c.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export formatstring_go.
* gettext-tools/tests/format-go-1: New file.
* gettext-tools/tests/format-go-2: New file.
* gettext-tools/tests/xgettext-go-1: New file.
* gettext-tools/tests/xgettext-go-2: New file.
* gettext-tools/tests/xgettext-go-3: New file.
* gettext-tools/tests/xgettext-go-4: New file.
* gettext-tools/tests/xgettext-go-5: New file.
* gettext-tools/tests/xgettext-go-6: New file.
* gettext-tools/tests/xgettext-go-7: New file.
* gettext-tools/tests/xgettext-go-8: New file.
* gettext-tools/tests/xgettext-go-9: New file.
* gettext-tools/tests/xgettext-go-10: New file.
* gettext-tools/tests/xgettext-go-11: New file.
* gettext-tools/tests/xgettext-go-12: New file.
* gettext-tools/tests/xgettext-go-13: New file.
* gettext-tools/tests/xgettext-go-14: New file.
* gettext-tools/tests/xgettext-go-15: New file.
* gettext-tools/tests/xgettext-go-16: New file.
* gettext-tools/tests/xgettext-go-17: New file.
* gettext-tools/tests/xgettext-go-18: New file.
* gettext-tools/tests/xgettext-go-stackovfl-1: New file.
* gettext-tools/tests/xgettext-go-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
* NEWS: Mention the Go support.

7 months agotests: Rust: Small fix.
Bruno Haible [Tue, 4 Mar 2025 21:09:57 +0000 (22:09 +0100)] 
tests: Rust: Small fix.

* gettext-tools/tests/xgettext-rust-7: Fix a typo.

7 months agotests: Prefer 'cat <<\EOF' to 'cat <<EOF' whenever possible.
Bruno Haible [Tue, 4 Mar 2025 15:50:35 +0000 (16:50 +0100)] 
tests: Prefer 'cat <<\EOF' to 'cat <<EOF' whenever possible.

Rationale: Not interpreting $ and \ in the here documents is a better default
than interpreting them.

* gettext-tools/tests/xgettext-*: Write 'cat <<\EOF' instead of 'cat <<EOF',
when no shell dollar-substitution and backslash-interpretation is needed.

7 months agobuild: Improve wording in './configure --help'.
Bruno Haible [Sat, 1 Mar 2025 15:05:31 +0000 (16:05 +0100)] 
build: Improve wording in './configure --help'.

Reported by Benno Schulenberg <bensberg@telfort.nl> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-03/msg00000.html>.

* configure.ac: Use a dummy version number named 'package', not 'dummy'.
* gettext-runtime/configure.ac: Likewise.
* gettext-runtime/intl/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.
* gettext-tools/examples/configure.ac: Likewise.
* libtextstyle/configure.ac: Likewise.

7 months agoexamples: Use #| (previous) lines in the PO files.
Bruno Haible [Tue, 25 Feb 2025 17:03:47 +0000 (18:03 +0100)] 
examples: Use #| (previous) lines in the PO files.

* gettext-tools/examples/po/Makefile.am ($(POFILES), update-po): Pass --lang and
--previous options to msgmerge.

7 months agoRelease 0.24 v0.24
Bruno Haible [Tue, 25 Feb 2025 13:44:17 +0000 (14:44 +0100)] 
Release 0.24

7 months agoexamples: Use infrastructure from gettext version 0.24.
Bruno Haible [Tue, 25 Feb 2025 12:41:30 +0000 (13:41 +0100)] 
examples: Use infrastructure from gettext version 0.24.

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

7 months agoexamples: Make hello-rust pass the check.
Bruno Haible [Tue, 25 Feb 2025 12:39:56 +0000 (13:39 +0100)] 
examples: Make hello-rust pass the check.

* gettext-tools/examples/check-examples (func_check_dist): Ignore the
till-present 'target' directory in hello-rust.
(func_check_dist_vpath): Likewise.

7 months agoexamples: Fix hello-c++-gnome3.
Bruno Haible [Tue, 25 Feb 2025 11:19:17 +0000 (12:19 +0100)] 
examples: Fix hello-c++-gnome3.

* gettext-tools/examples/hello-c++-gnome3/autoclean.sh: Remove po/Makefile.in.in.

7 months agoUpdate translations from TP.
Bruno Haible [Tue, 25 Feb 2025 10:10:15 +0000 (11:10 +0100)] 
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.

7 months agoPrepare for 0.24 release.
Bruno Haible [Tue, 25 Feb 2025 10:04:01 +0000 (11:04 +0100)] 
Prepare for 0.24 release.

* gettext-runtime/doc/matrix.texi: Update from TP.
* gettext-runtime/doc/nls.texi (STATUS): Update.
* gettext-runtime/m4/gettext.m4: Update comments.
* gettext-runtime/m4/nls.m4: Likewise.
* gettext-runtime/m4/progtest.m4: Likewise.
* 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/intl/Makefile.am (LTV_*): Bump to 12:3:4.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 2:4:2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:13:5.
* gettext-runtime/src/envsubst.c (main): Update copyright year in --version
output.
* gettext-runtime/src/gettext.c (main): Likewise.
* gettext-runtime/src/gettext.sh.in (func_version): Likewise.
* gettext-runtime/src/ngettext.c (main): Likewise.
* gettext-tools/src/cldr-plurals.c (main): Likewise.
* gettext-tools/src/hostname.c (main): Likewise.
* gettext-tools/src/msgattrib.c (main): Likewise.
* gettext-tools/src/msgcat.c (main): Likewise.
* gettext-tools/src/msgcmp.c (main): Likewise.
* gettext-tools/src/msgcomm.c (main): Likewise.
* gettext-tools/src/msgconv.c (main): Likewise.
* gettext-tools/src/msgen.c (main): Likewise.
* gettext-tools/src/msgexec.c (main): Likewise.
* gettext-tools/src/msgfilter.c (main): Likewise.
* gettext-tools/src/msgfmt.c (main): Likewise.
* gettext-tools/src/msggrep.c (main): Likewise.
* gettext-tools/src/msginit.c (main): Likewise.
* gettext-tools/src/msgmerge.c (main): Likewise.
* gettext-tools/src/msgunfmt.c (main): Likewise.
* gettext-tools/src/msguniq.c (main): Likewise.
* gettext-tools/src/recode-sr-latin.c (main): Likewise.
* gettext-tools/src/urlget.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* gettext-tools/misc/convert-archive.in (func_version): Likewise.
* gettext-tools/misc/gettextize.in (func_version): Likewise.
* gettext-tools/misc/autopoint.in: Likewise. Accept version 0.24.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.24.
* NEWS: Update.

7 months agoUpdate to the newest gnulib.
Bruno Haible [Tue, 25 Feb 2025 08:55:24 +0000 (09:55 +0100)] 
Update to the newest gnulib.

7 months agoxgettext: Implement a "reproducible" POT-Creation-Date value.
Bruno Haible [Mon, 24 Feb 2025 19:44:30 +0000 (20:44 +0100)] 
xgettext: Implement a "reproducible" POT-Creation-Date value.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add vc-mtime.
* gettext-tools/src/xgettext.c: Include vc-mtime.h, msgl-header.h.
(has_some_mtimes, max_of_mtimes, some_mtimes_failed): New variables.
(long_options): Add --reference option.
(main): Implement --reference option. Invoke consider_vc_mtime for the
--files-from option.
(usage): Document the --reference option.
(consider_vc_mtime): New function.
(read_exclusion_file, extract_from_file, extract_from_xml_file: Invoke
consider_vc_mtime.
(construct_header): Don't compute the value of POT-Creation-Date here.
(finalize_header): Compute it here.
* gettext-tools/doc/xgettext.texi: Document the --reference option.
* NEWS: Mention the change.

7 months agoUpdate after gnulib changed.
Bruno Haible [Sun, 23 Feb 2025 06:38:50 +0000 (07:38 +0100)] 
Update after gnulib changed.

* gettext-runtime/intl/setlocale.c: Include setlocale-messages.h.
(lc_messages_name): Remove variable.

7 months agoUpdate to the newest gnulib.
Bruno Haible [Sun, 23 Feb 2025 06:25:24 +0000 (07:25 +0100)] 
Update to the newest gnulib.

7 months agoPrepare for prerelease.
Bruno Haible [Wed, 19 Feb 2025 06:37:20 +0000 (07:37 +0100)] 
Prepare for prerelease.

* gettext-tools/po/POTFILES.in: Update file list.

7 months agoUpdate to the newest gnulib.
Bruno Haible [Wed, 19 Feb 2025 06:32:24 +0000 (07:32 +0100)] 
Update to the newest gnulib.

7 months agoUpdate after gnulib changed.
Bruno Haible [Tue, 18 Feb 2025 19:55:06 +0000 (20:55 +0100)] 
Update after gnulib changed.

7 months agolibtextstyle: Avoid an error localeconv_used_without_requesting_gnulib_module_localec...
Bruno Haible [Tue, 18 Feb 2025 15:16:38 +0000 (16:16 +0100)] 
libtextstyle: Avoid an error localeconv_used_without_requesting_gnulib_module_localeconv on mingw.

* libtextstyle/autogen.sh: Avoid module 'locale-h'.

7 months agoexamples: Add hello-c-http example.
Bruno Haible [Wed, 12 Feb 2025 09:54:08 +0000 (10:54 +0100)] 
examples: Add hello-c-http example.

* gettext-tools/examples/hello-c-http/INSTALL: New file.
* gettext-tools/examples/hello-c-http/autogen.sh: New file, based on
gettext-tools/examples/hello-c/autogen.sh.
* gettext-tools/examples/hello-c-http/autoclean.sh: New file, based on
gettext-tools/examples/hello-c/autoclean.sh.
* gettext-tools/examples/hello-c-http/hello-server.c: New file.
* gettext-tools/examples/hello-c-http/Makefile.am: New file, based on
gettext-tools/examples/hello-c/Makefile.am.
* gettext-tools/examples/hello-c-http/configure.ac: New file, based on
gettext-tools/examples/hello-c/configure.ac.
* gettext-tools/examples/hello-c-http/m4/Makefile.am: New file, copied from
gettext-tools/examples/hello-c/m4/Makefile.am.
* gettext-tools/examples/hello-c-http/po/POTFILES.in: New file.
* gettext-tools/examples/hello-c-http/po/Makevars: New file, copied from
gettext-tools/examples/hello-c/po/Makevars.
* gettext-tools/examples/hello-c-http/po/LINGUAS: New file, copied from
gettext-tools/examples/hello-c/po/LINGUAS.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-c-http.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-c-http.
(hello-c-http.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-c-http.
($(srcdir)/../hello-c-http/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-c-http as well.
* gettext-tools/examples/README: Mention hello-c-http.
* NEWS: Likewise.

7 months agointl: Update info about Galician and Tamil.
Bruno Haible [Thu, 13 Feb 2025 05:08:04 +0000 (06:08 +0100)] 
intl: Update info about Galician and Tamil.

* gettext-runtime/intl/setlocale.c (locales_with_principal_territory): Galician
is mostly spoken in Spain, not Portugal. Tamil is mostly spoken in India, not
Sri Lanka.

7 months agomsginit: Update info about Galician and Tamil.
Bruno Haible [Wed, 12 Feb 2025 09:39:35 +0000 (10:39 +0100)] 
msginit: Update info about Galician and Tamil.

* gettext-tools/src/msginit.c (catalogname_for_locale): Galician is mostly
spoken in Spain, not Portugal. Tamil is mostly spoken in India, not Sri Lanka.

7 months agoxgettext: Rust: Support named format string arguments.
Bruno Haible [Tue, 11 Feb 2025 10:37:40 +0000 (11:37 +0100)] 
xgettext: Rust: Support named format string arguments.

Reported by Kévin Commaille <zecakeh@tedomum.fr>
in <https://savannah.gnu.org/bugs/?56774>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add unictype/property-xid-start,
unictype/property-xid-continue.
(GNULIB_MODULES_LIBGETTEXTPO): Likewise.
* gettext-tools/src/format-rust.c (struct named_arg): New type.
(struct spec): Add fields named_arg_count, named.
(named_arg_compare): New function.
(format_parse): Recognize named arguments.
(format_check): Search for differences also between the named arguments.
(format_print): Print also the named arguments.
* gettext-tools/tests/format-rust-1: Add test cases for named arguments.
* gettext-tools/tests/format-rust-2: Likewise.
* gettext-tools/doc/gettext.texi (rust-format): Describe rust-format in detail.

7 months agoxgettext: Rust: Fix comments.
Bruno Haible [Tue, 11 Feb 2025 08:25:57 +0000 (09:25 +0100)] 
xgettext: Rust: Fix comments.

* gettext-tools/src/x-rust.c: Fix reference to the Rust specification.

7 months agoRefactor.
Bruno Haible [Tue, 11 Feb 2025 08:49:08 +0000 (09:49 +0100)] 
Refactor.

* gettext-tools/src/format-ruby.c (format_parse): Use two different variables
named_allocated, numbered_allocated, instead of a single variable (assuming that
INVALID_MIXES_NAMED_UNNAMED is called when it should).

7 months agodoc: Suggest to not use ngettext() in a specific case.
Ivan Krylov [Mon, 10 Feb 2025 07:49:44 +0000 (08:49 +0100)] 
doc: Suggest to not use ngettext() in a specific case.

Edits from Ivan Krylov <ikrylov@disroot.org> at
<https://lists.gnu.org/archive/html/bug-gettext/2025-02/msg00000.html>
and Bruno Haible.

* gettext-tools/doc/gettext.texi (Plural forms): Suggest to not use ngettext()
in singular/plural cases without a number in the strings.

Copyright-paperwork-exempt: Yes

7 months agoRefactor: Allow for better static analysis, fixing some GCC analyzer warnings.
Bruno Haible [Sun, 9 Feb 2025 21:50:17 +0000 (22:50 +0100)] 
Refactor: Allow for better static analysis, fixing some GCC analyzer warnings.

* gettext-tools/src/cldr-plural.y: Define SB_NO_APPENDF.
* gettext-tools/src/its.c: Likewise.
* gettext-tools/src/read-desktop.c: Likewise.
* gettext-tools/src/read-properties.c: Likewise.
* gettext-tools/src/x-awk.c: Likewise.
* gettext-tools/src/x-c.c: Likewise.
* gettext-tools/src/x-java.c: Likewise.
* gettext-tools/src/x-javascript.c: Likewise.
* gettext-tools/src/x-lua.c: Likewise.
* gettext-tools/src/x-perl.c: Likewise.
* gettext-tools/src/x-php.c: Likewise.
* gettext-tools/src/x-python.c: Likewise.
* gettext-tools/src/x-rst.c: Likewise.
* gettext-tools/src/x-smalltalk.c: Likewise.
* gettext-tools/src/x-vala.c: Likewise.
* gettext-tools/src/x-ycp.c: Likewise.

7 months agoxgettext: Rust: Refactor.
Bruno Haible [Sun, 9 Feb 2025 21:26:49 +0000 (22:26 +0100)] 
xgettext: Rust: Refactor.

* gettext-tools/src/x-rust.c (contents): New variable.
(extract_from_function_call, extract_from_function_call_like,
extract_from_node): Remove the 'contents' parameter.
(extract_rust): Update.

7 months agoxgettext: Handle out-of-memory situation.
Bruno Haible [Sat, 8 Feb 2025 07:49:16 +0000 (08:49 +0100)] 
xgettext: Handle out-of-memory situation.

* gettext-tools/src/x-perl.c: Include xstring-desc.h.
(extract_quotelike): Call xsd_c instead of sd_c.
* gettext-tools/src/x-rust.c: Include xstring-desc.h.
(string_literal_value): Call xsd_c instead of sd_c. Call sb_xappend_desc
instead of sb_append_desc.

7 months agodoc: Sort programming languages consistently.
Bruno Haible [Wed, 5 Feb 2025 10:52:03 +0000 (11:52 +0100)] 
doc: Sort programming languages consistently.

* gettext-tools/doc/gettext.texi (No string concatenation): Sort the programming
languages like elsewhere in the doc.

8 months agobuild: Remove undesired output from autopull.sh.
Bruno Haible [Tue, 4 Feb 2025 00:44:49 +0000 (01:44 +0100)] 
build: Remove undesired output from autopull.sh.

* autopull.sh (func_git_clone_shallow): Silence the initial branch hint.

8 months agoFix last two commits.
Bruno Haible [Tue, 4 Feb 2025 00:40:01 +0000 (01:40 +0100)] 
Fix last two commits.

8 months agolibtextstyle: Improve namespacing.
Bruno Haible [Tue, 4 Feb 2025 00:03:53 +0000 (01:03 +0100)] 
libtextstyle: Improve namespacing.

* gettext-tools/libgettextpo/Makefile.am (COMPILATION_UNITS): Fix reference to
LIBOBJS variable.
(config.h): Remove leading part of the elements of
$(lts_libtextstyle_LTLIBOBJS).

8 months agoUpdate after gnulib changed.
Bruno Haible [Mon, 3 Feb 2025 23:50:06 +0000 (00:50 +0100)] 
Update after gnulib changed.

* gettext-tools/libgettextpo/Makefile.am (config.h): Remove leading part of the
elements of $(libgnu_la_LIBADD).

8 months agoUpdate to the newest gnulib.
Bruno Haible [Mon, 3 Feb 2025 23:48:56 +0000 (00:48 +0100)] 
Update to the newest gnulib.

8 months agoRust: Update .gitignore.
Bruno Haible [Mon, 3 Feb 2025 17:08:23 +0000 (18:08 +0100)] 
Rust: Update .gitignore.

8 months agoRust: Reference the example in the documentation.
Bruno Haible [Mon, 3 Feb 2025 07:24:09 +0000 (08:24 +0100)] 
Rust: Reference the example in the documentation.

* gettext-tools/doc/lang-rust.texi: Reference the example.

8 months agoJava: Doc comments.
Bruno Haible [Mon, 3 Feb 2025 06:27:46 +0000 (07:27 +0100)] 
Java: Doc comments.

* gettext-tools/doc/lang-java.texi: Add comments.

8 months agoSort programming languages like in the documentation.
Bruno Haible [Sun, 2 Feb 2025 10:39:54 +0000 (11:39 +0100)] 
Sort programming languages like in the documentation.

* gettext-tools/src/xgettext.c (usage): For the -L, -a, -k, --flag options, sort
the list of programming languages like in the documentation. Add Guile, Rust,
GSettings, that were forgotten earlier.
* gettext-tools/doc/xgettext.texi: Likewise.
* gettext-tools/examples/README: Sort the examples like the programming
languages in the documentation.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Likewise.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Likewise.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS, hello-*.pot,
SMALLPOFILES_FOR_lang, $(srcdir)/../hello-*/po/$(LL).po): Likewise.

8 months agotests: Fix a comment.
Bruno Haible [Sun, 2 Feb 2025 02:39:53 +0000 (03:39 +0100)] 
tests: Fix a comment.

* gettext-tools/tests/format-lua-2: Fix comment.

8 months agodoc: Explain why localizations are in separate files.
Bruno Haible [Sat, 1 Feb 2025 17:38:53 +0000 (18:38 +0100)] 
doc: Explain why localizations are in separate files.

* gettext-tools/doc/gettext.texi (Overview): Explain why the MO files should
not be embedded in the executable.

8 months agotests: Fix a comment.
Bruno Haible [Wed, 29 Jan 2025 14:31:59 +0000 (15:31 +0100)] 
tests: Fix a comment.

* gettext-tools/tests/lang-rust: Fix comment.

8 months agointl: Fix undefined behaviour.
Bruno Haible [Wed, 29 Jan 2025 11:30:02 +0000 (12:30 +0100)] 
intl: Fix undefined behaviour.

Found using clang's undefined-behaviour sanitizer:
CC="clang -fsanitize=undefined -fno-sanitize-recover=undefined".
It reported errors
dcigettext.c:1219:25: runtime error: applying non-zero offset 8 to null pointer
because the code was computing
    outbuf = freemem + sizeof (size_t);
where freemem == NULL.

* gettext-runtime/intl/dcigettext.c (_nl_find_msg): Initialize outbuf only after
having verified that freemem_size >= sizeof (size_t).

8 months agoxgettext: Rust: Fix xgettext-rust-stackovfl-* failures on MSVC 14/x86_64.
Bruno Haible [Wed, 29 Jan 2025 11:05:42 +0000 (12:05 +0100)] 
xgettext: Rust: Fix xgettext-rust-stackovfl-* failures on MSVC 14/x86_64.

* autogen.sh (GNULIB_MODULES_TOOLS_OTHER): Add test-xfail.
* gettext-tools/src/Makefile.am (xgettext_LDFLAGS): On MSVC, use a larger
stack size.

8 months agoexamples: Add hello-rust example.
Bruno Haible [Tue, 28 Jan 2025 15:47:10 +0000 (16:47 +0100)] 
examples: Add hello-rust example.

* gettext-tools/examples/hello-rust/INSTALL: New file.
* gettext-tools/examples/hello-rust/autogen.sh: New file.
* gettext-tools/examples/hello-rust/autoclean.sh: New file.
* gettext-tools/examples/hello-rust/Cargo.toml.in: New file.
* gettext-tools/examples/hello-rust/src/main.rs.in: New file.
* gettext-tools/examples/hello-rust/Makefile.am: New file.
* gettext-tools/examples/hello-rust/configure.ac: New file.
* gettext-tools/examples/hello-rust/m4/Makefile.am: New file.
* gettext-tools/examples/hello-rust/po/Makefile.am: New file.
* gettext-tools/examples/hello-rust/po/LINGUAS: New file.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-rust.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-rust.
(hello-rust.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-rust.
($(srcdir)/../hello-rust/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-rust as well.
(func_check): Add a more useful body.
* gettext-tools/examples/README: Mention hello-rust.
* NEWS: Likewise.

8 months agoRust: Add lang-rust unit test.
Bruno Haible [Tue, 28 Jan 2025 10:45:28 +0000 (11:45 +0100)] 
Rust: Add lang-rust unit test.

* gettext-tools/tests/init.cfg (this_test_is_longrunning_): New function.
* gettext-tools/tests/lang-rust: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* HACKING: Reorder. Document prerequisites for Rust unit test.

8 months agoAdd Rust support.
Bruno Haible [Tue, 28 Jan 2025 10:11:56 +0000 (11:11 +0100)] 
Add Rust support.

* autopull.sh (func_git_clone_shallow): New function, based on
gnulib/top/bootstrap-funclib.sh.
Check out tree-sitter and tree-sitter-rust.
Create gettext-tools/tree-sitter.cfg.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add strnlen,
unictype/property-white-space.
(GNULIB_MODULES_LIBGETTEXTPO): Likewise.
* gettext-tools/build-aux/tree-sitter-portability.diff: New file.
* gettext-tools/build-aux/tree-sitter-rust-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_VERSION, TREE_SITTER_RUST_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter configuration,
source code, and patches.
* gettext-tools/doc/lang-rust.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (PO Files): Mention rust-format.
(Translators for other Languages): New subsection "Rust Format Strings".
(List of Programming Languages): Include lang-rust.texi.
* gettext-tools/doc/xgettext.texi: Document the -L Rust option.
* gettext-tools/src/message.h (format_rust): New enum value.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_rust.
* gettext-tools/src/format-rust.c: New file.
* gettext-tools/src/format.h (formatstring_rust): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add formatstring_rust.
* gettext-tools/src/x-rust.h: New file.
* gettext-tools/src/x-rust.c: New file.
* gettext-tools/src/xgettext.c: Include x-rust.h.
(main): Invoke init_flag_table_rust, x_rust_extract_all, x_rust_keyword.
(usage): Document the -L Rust option.
(xgettext_record_flag): Support format_rust.
(language_to_extractor, extension_to_language): Support Rust.
* gettext-tools/src/FILES: Mention format-rust.c, x-rust.h, x-rust.c.
* gettext-tools/src/Makefile.am (noinst_LIBRARIES): New variable.
(noinst_HEADERS): Add x-rust.h.
(AM_CPPFLAGS): Add a -I option for tree-sitter.
(FORMAT_SOURCE): Add format-rust.c.
(LIBXGETTEXTTS): New variable.
(libxgettextts1_a_SOURCES, libxgettextts1_a_CPPFLAGS): New variables.
(libxgettextts2_a_SOURCES, libxgettextts2_a_CPPFLAGS): New variables.
(xgettext_SOURCES): Add x-rust.c.
(xgettext_LDADD, xgettext_DEPENDENCIES): Add $(LIBXGETTEXTTS).
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-rust.c.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export formatstring_rust.
* gettext-tools/tests/format-rust-1: New file.
* gettext-tools/tests/format-rust-2: New file.
* gettext-tools/tests/xgettext-rust-1: Fix string literal concatenation test.
Fix -k options.
* gettext-tools/tests/xgettext-rust-2: Fix gettext invocations.
* gettext-tools/tests/xgettext-rust-3: Fix string literal concatenation test.
Test multiline strings.
* gettext-tools/tests/xgettext-rust-4: Tweak.
* gettext-tools/tests/xgettext-rust-5: Fix test identifier.
* gettext-tools/tests/xgettext-rust-6: New file.
* gettext-tools/tests/xgettext-rust-7: New file.
* gettext-tools/tests/xgettext-rust-stackovfl-1: New file.
* gettext-tools/tests/xgettext-rust-stackovfl-2: New file.
* gettext-tools/tests/xgettext-rust-stackovfl-3: New file.
* gettext-tools/tests/xgettext-rust-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
* check-copyright-headers (func_check_file): Ignore tree-sitter files.
* NEWS: Mention the Rust support.

8 months agoPrepare for Rust support.
Kévin Commaille [Tue, 28 Jan 2025 10:08:52 +0000 (11:08 +0100)] 
Prepare for Rust support.

* gettext-tools/tests/xgettext-rust-1: New file, based on
gettext-tools/tests/xgettext-csharp-1.
* gettext-tools/tests/xgettext-rust-2: New file, based on
gettext-tools/tests/xgettext-csharp-2.
* gettext-tools/tests/xgettext-rust-3: New file, based on
gettext-tools/tests/xgettext-csharp-3.
* gettext-tools/tests/xgettext-rust-4: New file, based on
gettext-tools/tests/xgettext-csharp-4.
* gettext-tools/tests/xgettext-rust-5: New file, based on
gettext-tools/tests/xgettext-csharp-7.

8 months agoexamples: Improve autoclean.sh.
Bruno Haible [Tue, 28 Jan 2025 20:54:52 +0000 (21:54 +0100)] 
examples: Improve autoclean.sh.

* gettext-tools/examples/hello-c-gnome3/autoclean.sh: Do also the equivalent of
"make maintainer-clean".
* gettext-tools/examples/hello-c++-gnome3/autoclean.sh: Likewise.
* gettext-tools/examples/hello-c++-kde/autoclean.sh: Likewise.
* gettext-tools/examples/hello-csharp/autoclean.sh: Likewise.
* gettext-tools/examples/hello-csharp-forms/autoclean.sh: Likewise.
* gettext-tools/examples/hello-pascal/autoclean.sh: Likewise.

8 months agoexamples: Assume autoconf >= 2.60.
Bruno Haible [Tue, 28 Jan 2025 16:55:38 +0000 (17:55 +0100)] 
examples: Assume autoconf >= 2.60.

* gettext-tools/examples/hello-clisp/configure.ac: Compute localedir based on
${datarootdir}, not ${datadir}.
* gettext-tools/examples/hello-gawk/configure.ac: Likewise.
* gettext-tools/examples/hello-guile/configure.ac: Likewise.
* gettext-tools/examples/hello-librep/configure.ac: Likewise.
* gettext-tools/examples/hello-pascal/configure.ac: Likewise.
* gettext-tools/examples/hello-perl/configure.ac: Likewise.
* gettext-tools/examples/hello-php/configure.ac: Likewise.
* gettext-tools/examples/hello-python/configure.ac: Likewise.
* gettext-tools/examples/hello-ruby/configure.ac: Likewise.
* gettext-tools/examples/hello-sh/configure.ac: Likewise.
* gettext-tools/examples/hello-smalltalk/configure.ac: Likewise.

8 months agolibtextstyle: Update after 2025-01-24 change.
Bruno Haible [Tue, 28 Jan 2025 14:55:54 +0000 (15:55 +0100)] 
libtextstyle: Update after 2025-01-24 change.

8 months agoformat-ruby: Fix error handling.
Bruno Haible [Tue, 28 Jan 2025 10:04:52 +0000 (11:04 +0100)] 
format-ruby: Fix error handling.

* gettext-tools/src/format-ruby.c (format_parse): Respect FDI_SET constraint.

8 months agoformat-python-brace: Fix error handling.
Bruno Haible [Tue, 28 Jan 2025 10:03:32 +0000 (11:03 +0100)] 
format-python-brace: Fix error handling.

* gettext-tools/src/format.h (FDI_SET): Improve comment.
* gettext-tools/src/format-python-brace.c (parse_directive): Improve error
messages. Respect FDI_SET constraint.

8 months agoMention the GNU make requirement more prominently.
Bruno Haible [Mon, 27 Jan 2025 10:45:48 +0000 (11:45 +0100)] 
Mention the GNU make requirement more prominently.

* NEWS: Mention the GNU make requirement.

8 months agobuild: Update package version handling after gnulib changed.
Bruno Haible [Tue, 28 Jan 2025 09:37:33 +0000 (10:37 +0100)] 
build: Update package version handling after gnulib changed.

* configure.ac: Drop postprocessing of git-version-gen output.
* gettext-runtime/configure.ac: Likewise.
* gettext-runtime/intl/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.
* gettext-tools/examples/configure.ac: Likewise.

8 months agoUpdate to the newest gnulib.
Bruno Haible [Tue, 28 Jan 2025 09:34:27 +0000 (10:34 +0100)] 
Update to the newest gnulib.

8 months agobuild: Update package version handling after gnulib changed.
Bruno Haible [Sat, 25 Jan 2025 05:49:42 +0000 (06:49 +0100)] 
build: Update package version handling after gnulib changed.

* configure.ac: Invoke AC_INIT with arguments. Invoke gl_INIT_PACKAGE_VERSION
instead of gl_INIT_PACKAGE.
* gettext-runtime/configure.ac: Likewise.
* gettext-runtime/intl/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.
* gettext-tools/examples/configure.ac: Likewise.
* libtextstyle/configure.ac: Likewise.

8 months agoUpdate to the newest gnulib.
Bruno Haible [Sat, 25 Jan 2025 05:46:22 +0000 (06:46 +0100)] 
Update to the newest gnulib.