]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
2 weeks agobuild: Distribute all tree-sitter patches.
Bruno Haible [Sun, 19 Oct 2025 00:54:54 +0000 (02:54 +0200)] 
build: Distribute all tree-sitter patches.

* gettext-tools/Makefile.am (EXTRA_DIST): Add
build-aux/tree-sitter-d-optimization-bug.diff, added on 2025-05-03.

2 weeks agoNew directory gettext-tools/wizard/po-templates/traditional/.
Bruno Haible [Sat, 18 Oct 2025 16:53:20 +0000 (18:53 +0200)] 
New directory gettext-tools/wizard/po-templates/traditional/.

* gettext-tools/wizard/po-templates/traditional/*: New files, moved here from
gettext-runtime/po/.
* gettext-tools/wizard/po-templates/traditional/Makefile.in.in (install-data,
installdirs-data, uninstall-data, dist2): Remove special code for the
'gettext-tools' package.
* gettext-tools/wizard/po-templates/traditional/Makevars.template: Moved here
from gettext-tools/po/.
* autogen.sh: Copy the contents of the gettext-runtime/po/ and gettext-tools/po/
directories from gettext-tools/wizard/po-templates/traditional/.
* gettext-tools/wizard/Makefile.am (pkgdatadir, podir): New variables.
(po_DATA): Add po-templates/traditional/*.
(EXTRA_DIST): Likewise.
(uninstall-sources): Also remove $(podir)/Makevars.
* Makefile.am (distcheck-hook): Update.

3 weeks agodoc: Mention how to localize other data formats.
Bruno Haible [Fri, 17 Oct 2025 07:28:17 +0000 (09:28 +0200)] 
doc: Mention how to localize other data formats.

* gettext-tools/doc/gettext.texi (Data Formats): Mention po4a. Describe how to
localize LibreOffice documents.

3 weeks agopo: Don't msgmerge the PO files through Makefile.in.in.
Bruno Haible [Mon, 13 Oct 2025 22:55:27 +0000 (00:55 +0200)] 
po: Don't msgmerge the PO files through Makefile.in.in.

* gettext-runtime/po/Makefile.in.in (MSGMERGE_UPDATE): Remove variable.
(UPDATEPOFILES): Remove variable.
(POFILESDEPS*): Remove variables.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(mostlyclean): Add *.gpo.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-runtime/po/Makevars (PO_DEPENDS_ON_POT): Remove variable.
* gettext-tools/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/po/Makevars.template (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c-gnome2/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c-gnome3/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c-http/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c++/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c++20/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c++-gnome2/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c++-gnome3/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c++-kde/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-objc/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-objc-gnome2/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c++-wxwidgets/po/Makefile.am (MSGMERGE_UPDATE):
Remove variable.
(UPDATEPOFILES): Remove variable.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(MOSTLYCLEANFILES): Add *.gpo.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-tools/examples/hello-python/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-guile/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-clisp/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-librep/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-rust/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-go/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-go-http/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-ruby/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-sh/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-gawk/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-pascal/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-modula2/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-d/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-ocaml/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-smalltalk/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-perl/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-php/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-ycp/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-c++-qt/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-java/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-java-awt/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-java-swing/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-java-qtjambi/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-csharp/po/Makefile.am (MSGMERGE_UPDATE): Remove
variable.
(UPDATEPOFILES): Remove variable.
(RESOURCESDLLFILES): Change emitted commands to use an intermediate .gpo file.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(MOSTLYCLEANFILES): Add *.gpo.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-tools/examples/hello-csharp-forms/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-tcl/po/Makefile.am (MSGMERGE_UPDATE): Remove
variable.
(UPDATEPOFILES): Remove variable.
(MSGFILES): Change emitted commands to use an intermediate .gpo file.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(MOSTLYCLEANFILES): Add *.gpo.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-tools/examples/hello-tcl-tk/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile (MSGMERGE_UPDATE):
Remove variable.
(UPDATEPOFILES): Remove variable.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-tools/examples/po/Makefile.am (MSGMERGE_OPTIONS): Add
--no-fuzzy-matching --quiet.
(MSGMERGE_UPDATE): Remove variable.
(UPDATEPOFILES): Remove variable.
(GPOFILES): New variable.
(.SUFFIXES): Add '.gpo'. Remove '.nop', '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove rule.
(DISTCLEANFILES): New variable.
(update-po): Don't make $(UPDATEPOFILES). Make the small PO files.
(.nop.po-update): Remove rule.
* gettext-tools/examples/po/mmsmallpo.sh: Use $language.gpo instead of
$language.po.
* gettext-tools/doc/gettext.texi (Translations under Version Control): Remove
documentation of PO_DEPENDS_ON_POT.
(Release Management): Update wording.
* Admin/release-steps: Don't msgmerge the PO files from translationproject.org.
* NEWS: Mention the change.

3 weeks agoexamples: Fix hello-tcl* examples (regression 2024-12-06).
Bruno Haible [Mon, 13 Oct 2025 00:15:25 +0000 (02:15 +0200)] 
examples: Fix hello-tcl* examples (regression 2024-12-06).

* gettext-tools/examples/hello-tcl*/po/Makefile.am (CATALOGS): Use suffix .msg,
not .gmo.

3 weeks agocheck-examples: Update comments.
Bruno Haible [Sun, 12 Oct 2025 20:36:56 +0000 (22:36 +0200)] 
check-examples: Update comments.

* gettext-tools/examples/check-examples: Update comments.

3 weeks agoexamples: Improve error message when there is a mistake in a PO file.
Bruno Haible [Sun, 12 Oct 2025 17:45:27 +0000 (19:45 +0200)] 
examples: Improve error message when there is a mistake in a PO file.

* gettext-tools/examples/hello-*/po/Makefile.am (.po.gmo): Use suffix .gpo
instead of .1po.
* gettext-tools/examples/hello-java*/po/Makefile.am (update-properties,
update-classes): Likewise.
* gettext-tools/examples/hello-c++-qt/po/Makefile.am (.po.qm): Likewise.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile ($(STRINGSFILES)):
Likewise.

3 weeks agoxgettext: Rust: Recognize 'gettextrs::gettext' invocations like 'gettext'
Bruno Haible [Sun, 12 Oct 2025 14:31:10 +0000 (16:31 +0200)] 
xgettext: Rust: Recognize 'gettextrs::gettext' invocations like 'gettext'
invocations.

Reported by Schmiddiii <gnu-savannah@schmidhuberj.de>
at <https://savannah.gnu.org/bugs/?67601>.

* gettext-tools/src/x-rust.c (ts_symbol_scoped_identifier): New variable.
(extract_from_function_call): Accept a scoped_identifier as first argument.
(extract_from_node): Allow a scoped_identifier as callee.
(extract_rust): Initialize ts_symbol_scoped_identifier.
* gettext-tools/tests/xgettext-rust-1: Add another test case.
* gettext-tools/tests/xgettext-rust-6: Likewise.
* NEWS: Mention the fix.

3 weeks agopo: Improve error message when there is a mistake in a PO file.
Bruno Haible [Sun, 12 Oct 2025 11:51:18 +0000 (13:51 +0200)] 
po: Improve error message when there is a mistake in a PO file.

* gettext-runtime/po/Makefile.in.in (.po.gmo): Use suffix .gpo instead of .1po.

3 weeks agopo: Simplify.
Bruno Haible [Sun, 12 Oct 2025 11:42:46 +0000 (13:42 +0200)] 
po: Simplify.

* gettext-runtime/po/Makefile.in.in (.NOEXPORT): Remove workaround for versions
of GNU make from before 1993.

3 weeks agobuild: Move more code into libgettextsrc.
Bruno Haible [Sun, 12 Oct 2025 10:50:54 +0000 (12:50 +0200)] 
build: Move more code into libgettextsrc.

* gettext-tools/src/lang-table.h (language_table, language_table_size,
language_variant_table, language_variant_table_size): Mark as
LIBGETTEXTSRC_DLL_VARIABLE.
* gettext-tools/src/Makefile.am (libgettextsrc_la_SOURCES): Add msgl-fsearch.c,
lang-table.c, plural-count.c.
(msgmerge_SOURCES): Remove msgl-fsearch.c, lang-table.c, plural-count.c.
(msginit_SOURCES): Likewise.
* gettext-tools/src/FILES: Update.

3 weeks agomsginit: Produce a merged PO file instead of failing.
Bruno Haible [Sun, 12 Oct 2025 02:00:26 +0000 (04:00 +0200)] 
msginit: Produce a merged PO file instead of failing.

* gettext-tools/src/msginit.c: Include <omp.h>, msgl-merge.h, backupfile.h,
copy-file.h.
(catalogname): Remove variable.
(main): When the PO file already exists, create a backup file, then merge the
two files.
(usage): Say what happens if the output file already exists.
(struct header_entry_field): New type.
(fresh_fields): Renamed from fields.
(NFIELDS): Remove macro.
(FRESH_FIELDS_LAST_TRANSLATOR): Renamed from FIELD_LAST_TRANSLATOR.
(update_fields): New variable.
(UPDATE_FIELDS_LAST_TRANSLATOR): New macro.
(fill_header): Add 'fresh' parameter. Allocate field_value array on the heap.
* gettext-tools/src/Makefile.am (msginit_SOURCES): Add msgl-fsearch.c,
msgl-merge.c.
(msginit_CFLAGS, msginit_CXXFLAGS): Link with the OpenMP flags.
* gettext-tools/doc/msginit.texi: Say what happens if the output file already
exists.
* gettext-tools/doc/gettext.texi (Creating): Change title. Mention that msginit
can also be used when continuing an existing translation.
* NEWS: Mention the improvement.

3 weeks agoRefactor: Librarify the core of msgmerge.
Bruno Haible [Sun, 12 Oct 2025 00:12:13 +0000 (02:12 +0200)] 
Refactor: Librarify the core of msgmerge.

* gettext-tools/src/msgl-merge.h: New file, based on
gettext-tools/src/msgmerge.c.
* gettext-tools/src/msgl-merge.c: New file, based on
gettext-tools/src/msgmerge.c.
* gettext-tools/src/msgmerge.c: Include msgl-merge.h. Simplify includes.
Remove definitions that are moved to msgl-merge.c.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add msgl-merge.h.
(msgmerge_SOURCES): Add msgl-merge.c.
* gettext-tools/po/POTFILES.in: Add src/msgl-merge.c.

3 weeks agoOCaml: Tweak documentation.
Bruno Haible [Sat, 11 Oct 2025 22:09:13 +0000 (00:09 +0200)] 
OCaml: Tweak documentation.

* gettext-tools/doc/lang-ocaml.texi: Add note regarding format strings.

4 weeks agoFix failure of lang-javascript on macOS 15.
Bruno Haible [Tue, 7 Oct 2025 11:41:04 +0000 (13:41 +0200)] 
Fix failure of lang-javascript on macOS 15.

4 weeks agoUpdate after gnulib changed.
Bruno Haible [Sun, 5 Oct 2025 20:22:28 +0000 (22:22 +0200)] 
Update after gnulib changed.

4 weeks agoRefactor: New subdirectory gettext-tools/wizard/, part 2.
Bruno Haible [Sun, 5 Oct 2025 20:19:36 +0000 (22:19 +0200)] 
Refactor: New subdirectory gettext-tools/wizard/, part 2.

4 weeks agoRefactor: New subdirectory gettext-tools/autotools/.
Bruno Haible [Sun, 5 Oct 2025 16:41:00 +0000 (18:41 +0200)] 
Refactor: New subdirectory gettext-tools/autotools/.

* gettext-tools/Makefile.am (SUBDIRS): Add autotools. Remove misc.
(distdir2): Update.
* gettext-tools/autotools/Makefile.am: Renamed from
gettext-tools/misc/Makefile.am.
* gettext-tools/autotools/archive.dir.tar: Renamed from
gettext-tools/misc/archive.dir.tar.
* gettext-tools/autotools/add-to-archive: Renamed from
gettext-tools/misc/add-to-archive.
* gettext-tools/autotools/cvsuser.c: Renamed from gettext-tools/misc/cvsuser.c.
* gettext-tools/autotools/convert-archive.in: Renamed from
gettext-tools/misc/convert-archive.in.
* gettext-tools/autotools/autopoint.in: Renamed from
gettext-tools/misc/autopoint.in.
* gettext-tools/configure.ac: Update AC_CONFIG_FILES invocations.
* gettext-tools/man/Makefile.am (man_MAN1AUTOTOOLS): Renamed from man_MAN1MISC.
($(man_MAN1AUTOTOOLS)): Renamed from $(man_MAN1MISC).
(autopoint.1): Update.
* gettext-tools/examples/po/Makefile.am (USE_BUILT_PROGS): Update.
* gettext-tools/tests/autopoint-1: Update.
* gettext-tools/tests/autopoint-2: Likewise.
* gettext-tools/tests/autopoint-3: Likewise.
* check-copyright-headers (func_check_file): Update.

4 weeks agoPut archive.dir.tar under version control, part 2.
Bruno Haible [Sun, 5 Oct 2025 16:27:03 +0000 (18:27 +0200)] 
Put archive.dir.tar under version control, part 2.

* gettext-tools/misc/Makefile.am ($(srcdir)/archive.dir.tar): Remove rule.

4 weeks agoRefactor: New subdirectory gettext-tools/wizard/.
Bruno Haible [Sun, 5 Oct 2025 15:33:27 +0000 (17:33 +0200)] 
Refactor: New subdirectory gettext-tools/wizard/.

* gettext-tools/configure.ac: Invoke AC_CONFIG_FILES for wizard/Makefile,
wizard/gettextize, instead of for misc/gettextize.
* gettext-tools/Makefile.am (SUBDIRS): Add wizard.
(distdir2): Recurse into wizard/.
* gettext-tools/wizard/Makefile.am: New file, based on
gettext-tools/misc/Makefile.am.
* gettext-tools/wizard/gettextize.in: Renamed from
gettext-tools/misc/gettextize.in.
* gettext-tools/misc/Makefile.am (bin_SCRIPTS, DISTCLEANFILES): Remove
gettextize.
(install-data-local, uninstall-local, uninstall-sources): Remove rules.
* gettext-tools/man/Makefile.am (man_MAN1WIZARD): New variable.
(man_MAN1MISC): Remove gettextize.1.
($(man_MAN1WIZARD)): New rule.
(gettextize.1): Update.
($(man_MAN1MISC)): Simplify.

5 weeks agoRestore syntax highlighting in Emacs 30 or newer.
Bruno Haible [Thu, 2 Oct 2025 20:50:11 +0000 (22:50 +0200)] 
Restore syntax highlighting in Emacs 30 or newer.

Reported by Sab Pyrope <sab.pyrope@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-03/msg00017.html>
and by Julien Palard <julien@palard.fr> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-10/msg00000.html>.

It's a regression in Emacs 30, in commit
17e26cf57e18c5df2172a7049591d89fc53b3fb6 .

* gettext-tools/emacs/HACKING: Document how to bisect Emacs regressions.
* gettext-tools/emacs/po-mode.el (po-mode-version-string): Bump to 2.31.
(po-mode): Invoke run-mode-hooks instead of run-hooks.
* NEWS: Mention the fix.

5 weeks agoxgettext: Java: Remove unjustified warning "'}' found where ')' was expected".
Bruno Haible [Tue, 30 Sep 2025 22:04:45 +0000 (00:04 +0200)] 
xgettext: Java: Remove unjustified warning "'}' found where ')' was expected".

Reported by Alexander Hubmann-Haidvogel <ahubmann@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-09/msg00000.html>
and by Bjoern Voigt <bjoernv@arcor.de> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-09/msg00023.html>.

* gettext-tools/src/x-java.c (extract_parenthesized): When a semicolon is seen
inside braces, start a new argparser instead of returning.
* gettext-tools/tests/xgettext-java-1: Add test cases with inner classes.

5 weeks agotests: Increase debuggability.
Bruno Haible [Tue, 30 Sep 2025 21:59:22 +0000 (23:59 +0200)] 
tests: Increase debuggability.

* gettext-tools/tests/xgettext-python-9: Show the warnings in the log when
failing.

5 weeks agolibgettextpo: Add API for the workflow flags and the sticky flags.
Bruno Haible [Tue, 30 Sep 2025 13:35:06 +0000 (15:35 +0200)] 
libgettextpo: Add API for the workflow flags and the sticky flags.

Reported by Alexander Potashev <aspotashev@gmail.com>
at <https://savannah.gnu.org/bugs/?67470>.

* gettext-tools/src/message.h (format_flag, not_format_p): New declarations.
* gettext-tools/src/message.c (format_flag): New variable.
(not_format_p): New function.
* gettext-tools/src/write-po.c (make_format_description_string): Add comments.
(significant_format_p): Likewise.
* gettext-tools/libgettextpo/gettext-po.in.h (po_flag_iterator_t): New type.
(po_message_has_workflow_flag, po_message_set_workflow_flag,
po_message_workflow_flags_iterator): New declarations.
(po_message_has_sticky_flag, po_message_set_sticky_flag,
po_message_sticky_flags_iterator): New declarations.
(po_flag_iterator_free, po_flag_next): New declarations.
* gettext-tools/libgettextpo/gettext-po.c (struct po_flag_iterator): New type.
(po_message_has_workflow_flag, po_message_set_workflow_flag,
po_message_workflow_flags_iterator): New functions.
(po_message_get_format): Simplify by using not_format_p.
(po_message_has_sticky_flag, po_message_set_sticky_flag,
po_message_sticky_flags_iterator): New functions.
(po_flag_iterator_free, po_flag_next): New functions.
* gettext-tools/tests/gettextpo-1-prg.c (main): Add more test cases.
* gettext-tools/doc/gettext.texi (po_message_t API): Document the new functions.
(po_flag_iterator_t API): New subsection.
* NEWS: Mention the new functions.

5 weeks agolibgettextpo: New function po_message_get_format.
Bruno Haible [Sat, 27 Sep 2025 11:20:39 +0000 (13:20 +0200)] 
libgettextpo: New function po_message_get_format.

Reported by Alexander Potashev <aspotashev@gmail.com> in
<https://savannah.gnu.org/bugs/?67485>.

* gettext-tools/libgettextpo/gettext-po.in.h (po_message_get_format): New
declaration.
* gettext-tools/libgettextpo/gettext-po.c (po_message_get_format): New function.
* gettext-tools/tests/gettextpo-1-prg.c (main): Test the return value of
po_message_get_format. Add a test case of po_message_set_format with value -1.
* gettext-tools/doc/gettext.texi (po_message_t API): Document
po_message_get_format.
* NEWS: Mention the change.

6 weeks agoUpgrade to libtool 2.6.0.
Bruno Haible [Sun, 21 Sep 2025 22:41:29 +0000 (00:41 +0200)] 
Upgrade to libtool 2.6.0.

* m4/libtool.m4: Update from libtool-2.6.0.
* m4/ltoptions.m4: Likewise.
* m4/ltsugar.m4: Likewise.
* m4/ltversion.m4: Likewise.
* m4/lt~obsolete.m4: Likewise.
* build-aux/ltmain.sh: Likewise.

7 weeks agogettext.h: Avoid warning with gcc < 4.2.
Bruno Haible [Sun, 14 Sep 2025 16:37:36 +0000 (18:37 +0200)] 
gettext.h: Avoid warning with gcc < 4.2.

Reported by Orgad Shaneh <orgads@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-09/msg00183.html>.

* gnulib-local/lib/gettext.h (gettext, dgettext, dcgettext): Don't use attribute
__gnu_inline__ with gcc < 4.2.

7 weeks agolang-javascript: Avoid failure on macOS 13..15.
Bruno Haible [Sun, 14 Sep 2025 07:47:44 +0000 (09:47 +0200)] 
lang-javascript: Avoid failure on macOS 13..15.

* gettext-tools/tests/lang-javascript: On macOS, test only in the UTF-8 locale.

7 weeks agoUpdate after gnulib changed.
Bruno Haible [Sun, 14 Sep 2025 02:43:06 +0000 (04:43 +0200)] 
Update after gnulib changed.

* gettext-tools/libgrep/gnulib-lib/Makefile.am (AM_CPPFLAGS): Add -I option,
so that libintl.h gets found during the compilation of regex.c.

8 weeks agoPut archive.dir.tar under version control.
Bruno Haible [Mon, 8 Sep 2025 14:20:17 +0000 (16:20 +0200)] 
Put archive.dir.tar under version control.

This helps reducing CI failures when alpha.gnu.org is not responding.
It also simplifies the branch handling when a bug-fix release is made
on the maintenance branch of an older release.

* gettext-tools/misc/archive.dir.tar: New file.
* autopull.sh: Don't fetch it from alpha.gnu.org any more.

8 weeks agobuild: Make CI's git hostname rewriting rules apply.
Bruno Haible [Mon, 8 Sep 2025 06:43:32 +0000 (08:43 +0200)] 
build: Make CI's git hostname rewriting rules apply.

* .gitmodules: Canonicalize savannah host name.

2 months agoUpdate after gnulib changed.
Bruno Haible [Wed, 3 Sep 2025 22:40:21 +0000 (00:40 +0200)] 
Update after gnulib changed.

* libtextstyle/tests/Makefile.am (AM_CFLAGS): Initialize.
* gettext-tools/gnulib-tests/Makefile.am (AM_CFLAGS): Initialize.

2 months agoUpdate to the newest gnulib.
Bruno Haible [Wed, 3 Sep 2025 22:30:53 +0000 (00:30 +0200)] 
Update to the newest gnulib.

2 months agodoc: Update table of programming languages.
Bruno Haible [Sat, 23 Aug 2025 23:20:29 +0000 (01:20 +0200)] 
doc: Update table of programming languages.

* gettext-tools/doc/gettext.texi (List of Programming Languages): Update table
in comments.

2 months agoits: Improve libxml error handling.
Bruno Haible [Wed, 13 Aug 2025 20:19:19 +0000 (22:19 +0200)] 
its: Improve libxml error handling.

When there is a non-fatal error, the previous code would just print a message
to stderr and continue the operation, without affecting the exit code.

* gettext-tools/src/its.c: Include <setjmp.h>, <stdarg.h>.
(xml_error_exit): New variable.
(structured_error): Longjmp to xml_error_exit.
(generic_error): New function.
(its_rule_list_add_from_file, its_rule_list_add_from_string,
its_rule_list_extract, its_merge_context_merge, its_merge_context_alloc,
its_merge_context_write): Invoke also xmlSetGenericErrorFunc. Use setjmp to
abort the operation when a non-fatal error occurs.

2 months agoits: Fix error handling.
Bruno Haible [Mon, 11 Aug 2025 14:54:20 +0000 (16:54 +0200)] 
its: Fix error handling.

* gettext-tools/src/its.c (structured_error, its_rule_list_add_from_file,
its_rule_list_add_from_string, its_rule_list_extract, its_merge_context_alloc):
Swap error() arguments.

2 months agoRely more on Gnulib.
Bruno Haible [Sun, 10 Aug 2025 20:03:19 +0000 (22:03 +0200)] 
Rely more on Gnulib.

* gettext-tools/src/write-java.c (S_*): Remove macros, relying on gnulib module
sys_stat-h.
* gettext-tools/src/write-csharp.c (S_*): Likewise.

2 months agoUse standard way of including <config.h>.
Bruno Haible [Sun, 10 Aug 2025 15:34:20 +0000 (17:34 +0200)] 
Use standard way of including <config.h>.

* gettext-runtime/src/*.c: Include <config.h> unconditionally.
* gettext-runtime/libasprintf/lib-asprintf.h: Likewise.
* libtextstyle/lib/color.c: Likewise.
* gnulib-local/lib/markup.c: Likewise.
* gettext-tools/src/*.y: Likewise.
* gettext-tools/src/*.c: Likewise.
* gettext-tools/libgrep/*.c: Likewise.
* gettext-tools/libgettextpo/*.c: Likewise.
* gettext-tools/tests/*.c: Likewise.

3 months agoINSTALL: Tweak wording.
Bruno Haible [Tue, 5 Aug 2025 20:10:35 +0000 (22:10 +0200)] 
INSTALL: Tweak wording.

* INSTALL: Fix a copy-and-paste mistake.

3 months agobuild: Make autogen.sh more reliable.
Bruno Haible [Tue, 5 Aug 2025 20:09:01 +0000 (22:09 +0200)] 
build: Make autogen.sh more reliable.

* autogen.sh: Fail if gnulib-tool fails.

3 months agotests: Fix a lang-go failure.
Bruno Haible [Tue, 5 Aug 2025 06:35:42 +0000 (08:35 +0200)] 
tests: Fix a lang-go failure.

* gettext-tools/tests/lang-go: Add workaround against
"go: GOPROXY list is not the empty string, but contains no entries" error.

3 months agoUpdate after gnulib changed.
Bruno Haible [Mon, 4 Aug 2025 14:28:34 +0000 (16:28 +0200)] 
Update after gnulib changed.

* gettext-tools/tests/Makefile.am (TESTS_ENVIRONMENT): Define top_builddir,
consistently with Gnulib.
* gettext-tools/tests/init-env.in (top_builddir): Remove definition here.

3 months agoUpdate to the newest gnulib.
Bruno Haible [Mon, 4 Aug 2025 14:26:56 +0000 (16:26 +0200)] 
Update to the newest gnulib.

3 months agointl-java: Remove an unused variable.
Bruno Haible [Sun, 3 Aug 2025 18:11:40 +0000 (20:11 +0200)] 
intl-java: Remove an unused variable.

Reported by Coverity.

* gettext-runtime/intl-java/gnu/gettext/GettextResource.java (ngettextnull):
Remove an unused variable.

3 months agolibcroco: Fix double-free and free-after-use bug.
Bruno Haible [Sun, 3 Aug 2025 18:02:26 +0000 (20:02 +0200)] 
libcroco: Fix double-free and free-after-use bug.

Reported by Coverity.

* libtextstyle/gnulib-local/lib/libcroco/cr-sel-eng.c
(cr_sel_eng_unregister_pseudo_class_sel_handler): Don't access or free 'elem'
after it has been freed. Remove always-NULL variable.

3 months agointl: Fix a small memory leak.
Bruno Haible [Sun, 3 Aug 2025 17:34:19 +0000 (19:34 +0200)] 
intl: Fix a small memory leak.

Reported by Coverity.

* gettext-runtime/intl/loadmsgcat.c (_nl_load_domain): Free
sysdep_segment_values before 'goto invalid'.

3 months agoexamples: Fix a compiler warning.
Bruno Haible [Sun, 3 Aug 2025 17:33:22 +0000 (19:33 +0200)] 
examples: Fix a compiler warning.

* gettext-tools/examples/hello-objc-gnustep/Hello.m (Hello): Remove an unused
variable.

3 months agogettext.m4: Fix build on Cygwin with gcc 13 or newer.
Bruno Haible [Fri, 1 Aug 2025 13:17:31 +0000 (15:17 +0200)] 
gettext.m4: Fix build on Cygwin with gcc 13 or newer.

This gcc version links with -lintl -liconv by default, making it appear as if
gettext() et al. were defined in libc. But GNU gettext still needs to build a
new libintl.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): On Cygwin, set
USE_INCLUDED_LIBINTL=yes regardless of the gcc version.

3 months agogettext.m4: Modernize.
Bruno Haible [Fri, 1 Aug 2025 13:03:45 +0000 (15:03 +0200)] 
gettext.m4: Modernize.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Rename configure option
--with-included-gettext to --with-included-libintl. Rename cache
variable nls_cv_force_use_gnu_gettext to gt_cv_force_use_gnu_libintl.
Rename cache variable nls_cv_use_gnu_gettext to gt_cv_use_gnu_libintl.

3 months agotests: Fix a lang-java failure on native Windows with MSVC.
Bruno Haible [Wed, 30 Jul 2025 14:22:32 +0000 (16:22 +0200)] 
tests: Fix a lang-java failure on native Windows with MSVC.

* gettext-tools/tests/lang-java: On native Windows, don't test the UTF-8 locale.

3 months agohostname: Fix a small memory leak.
Bruno Haible [Mon, 28 Jul 2025 14:08:40 +0000 (16:08 +0200)] 
hostname: Fix a small memory leak.

Reported by Coverity.

* gettext-tools/src/hostname.c (print_hostname): Free hostname before returning.

3 months agoFix a small memory leak.
Bruno Haible [Mon, 28 Jul 2025 14:01:40 +0000 (16:01 +0200)] 
Fix a small memory leak.

Reported by Coverity.

* gettext-tools/src/format-python.c (format_parse): Free name before returning.

3 months agoexamples: Add hello-ocaml example.
Bruno Haible [Mon, 28 Jul 2025 08:22:43 +0000 (10:22 +0200)] 
examples: Add hello-ocaml example.

* gettext-tools/examples/hello-ocaml/INSTALL: New file.
* gettext-tools/examples/hello-ocaml/autogen.sh: New file.
* gettext-tools/examples/hello-ocaml/autoclean.sh: New file.
* gettext-tools/examples/hello-ocaml/dune.in: New file.
* gettext-tools/examples/hello-ocaml/dune-project.in: New file.
* gettext-tools/examples/hello-ocaml/hello.ml.in: New file.
* gettext-tools/examples/hello-ocaml/Makefile.am: New file.
* gettext-tools/examples/hello-ocaml/configure.ac: New file.
* gettext-tools/examples/hello-ocaml/m4/Makefile.am: New file.
* gettext-tools/examples/hello-ocaml/po/LINGUAS: New file.
* gettext-tools/examples/hello-ocaml/po/Makefile.am: New file.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-ocaml.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-ocaml.
(hello-ocaml.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-ocaml.
($(srcdir)/../hello-ocaml/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check__hello_ocaml): New function.
* gettext-tools/examples/README: Mention hello-ocaml.
* gettext-tools/doc/lang-ocaml.texi: Likewise.
* NEWS: Likewise.

3 months agoOCaml support: Add a unit test.
Bruno Haible [Mon, 28 Jul 2025 08:16:38 +0000 (10:16 +0200)] 
OCaml support: Add a unit test.

* gettext-tools/tests/lang-ocaml: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* HACKING: Document dependencies for lang-ocaml.

3 months agoOCaml support: Add OCaml support in the tools.
Bruno Haible [Sun, 27 Jul 2025 22:07:10 +0000 (00:07 +0200)] 
OCaml support: Add OCaml support in the tools.

This implements several improvements, compared to
"ocaml-gettext --action extract ...":
  - Comments are extracted.
  - '#, ocaml-format' annotation on f_ arguments.
  - Recognizes concatenated strings, such as ("abc" ^ "def").
  - Supports (s_ "").

* autopull.sh: Check out tree-sitter-ocaml. Set TREE_SITTER_OCAML_VERSION.
* gettext-tools/build-aux/tree-sitter-ocaml-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_OCAML_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter-ocaml source code
and patch.
* gettext-tools/doc/gettext.texi (PO Files): Mention ocaml-format.
(Translators for other Languages): New subsection "OCaml Format Strings".
* gettext-tools/doc/lang-ocaml.texi: Mention all the supported *gettext
functions. Mention format strings with positions.
* gettext-tools/doc/xgettext.texi: Document the OCaml support in more places.
* gettext-tools/src/message.h (format_ocaml): New enum value.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_ocaml.
* gettext-tools/src/format-ocaml.c: New file, based on
gettext-tools/src/format-awk.c.
* gettext-tools/src/format.h (formatstring_ocaml): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add formatstring_ocaml.
* gettext-tools/src/x-ocaml.h (SCANNERS_OCAML): Reference flag_table_ocaml and
formatstring_ocaml.
(extract_ocaml): Declare with first argument of type 'FILE *'.
* gettext-tools/src/x-ocaml.c: Completely rewritten.
* gettext-tools/src/xgettext.c (flag_table_ocaml): New variable.
(usage): Document the OCaml support in more places.
(xgettext_record_flag): Support format_ocaml.
* gettext-tools/src/FILES: Mention format-ocaml.c.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-ocaml.c.
(LIBXGETTEXTTS): Add libxgettextts5.a.
(libxgettextts5_a_*): New variables.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-ocaml.c.
* gettext-tools/po/POTFILES.in: Add src/format-ocaml.c.
* gettext-tools/tests/format-ocaml-1: New file.
* gettext-tools/tests/format-ocaml-2: New file.
* gettext-tools/tests/xgettext-ocaml-1: New file.
* gettext-tools/tests/xgettext-ocaml-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
* NEWS: Mention the OCaml support.

3 months agoRefactor: Simplify.
Bruno Haible [Sun, 27 Jul 2025 07:47:12 +0000 (09:47 +0200)] 
Refactor: Simplify.

* gettext-tools/src/format-python-brace.c (parse_named_field,
parse_numeric_field, parse_directive, parse_upto): Remove 'translated'
parameter.
(format_parse): Update.

3 months agoFix typos in comments.
Bruno Haible [Sun, 27 Jul 2025 07:46:59 +0000 (09:46 +0200)] 
Fix typos in comments.

* gettext-tools/src/format-lua.c: Fix typos in comments.
* gettext-tools/src/format-d.c: Likewise.

3 months agoOCaml support: Add OCaml support in xgettext.
Bruno Haible [Wed, 23 Jul 2025 07:37:23 +0000 (09:37 +0200)] 
OCaml support: Add OCaml support in xgettext.

* gettext-tools/doc/lang-ocaml.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (No string concatenation): Mention string
concatenation in OCaml.
(List of Programming Languages): Include lang-ocaml.texi.
* gettext-tools/doc/xgettext.texi: Document the -L OCaml option.
* gettext-tools/src/x-ocaml.h: New file.
* gettext-tools/src/x-ocaml.c: New file.
* gettext-tools/src/xgettext.c: Include x-ocaml.h.
(flag_table_ocaml): New variable.
(main): Invoke init_flag_table_ocaml, x_ocaml_extract_all, x_ocaml_keyword.
(usage): Document the -L OCaml option.
(language_to_extractor, extension_to_language): Support OCaml.
* gettext-tools/src/FILES: Mention x-ocaml.h, x-ocaml.c.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add x-ocaml.h.
(xgettext_SOURCES): Add x-ocaml.c.
* gettext-tools/po/POTFILES.in: Add src/x-ocaml.c.

3 months agotests: Fix a lang-java failure on native Windows.
Bruno Haible [Tue, 22 Jul 2025 10:40:35 +0000 (12:40 +0200)] 
tests: Fix a lang-java failure on native Windows.

* gettext-tools/tests/lang-java: On native Windows, convert newlines in the
output before comparing.

3 months agotests: Recognize the *-*-windows* config triplets introduced on 2023-06-26.
Bruno Haible [Tue, 22 Jul 2025 10:37:42 +0000 (12:37 +0200)] 
tests: Recognize the *-*-windows* config triplets introduced on 2023-06-26.

* gettext-tools/tests/init-env.in: Treat windows* as equivalent to mingw*.
* gettext-tools/tests/intl-7: Likewise.
* gettext-tools/tests/lang-c: Likewise.
* gettext-tools/tests/lang-c++: Likewise.
* gettext-tools/tests/lang-c++-boost: Likewise.
* gettext-tools/tests/lang-c++20: Likewise.
* gettext-tools/tests/lang-c++26: Likewise.
* gettext-tools/tests/lang-d: Likewise.
* gettext-tools/tests/lang-modula2: Likewise.
* gettext-tools/tests/lang-objc: Likewise.
* gettext-tools/tests/msgfilter-8: Likewise.

3 months agotests: Fix a lang-java failure on native Windows.
Bruno Haible [Mon, 21 Jul 2025 19:18:33 +0000 (21:18 +0200)] 
tests: Fix a lang-java failure on native Windows.

* gettext-tools/tests/init-env.in (CLASSPATH_SEPARATOR): New variable.
* gettext-tools/tests/lang-java: Use it instead of hardcoding ':'.

3 months agoFix typos.
Bruno Haible [Mon, 21 Jul 2025 13:31:01 +0000 (15:31 +0200)] 
Fix typos.

Reported by <Jens.Schleusener@fossies.org>.

* gettext-tools/libgrep/m-regex.c: Fix typo in comments.
* gettext-tools/misc/autopoint.in: Likewise.
* gettext-tools/misc/gettextize.in: Likewise.
* gettext-tools/src/format-python-brace.c: Likewise.
* gettext-tools/src/gnu/gettext/DumpResource.java: Likewise.
* gettext-tools/src/its.h: Likewise.
* gettext-tools/src/locating-rules.h: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/read-catalog-abstract.h: Likewise.
* gettext-tools/src/read-catalog-abstract.c: Likewise.
* gettext-tools/src/read-catalog.h: Likewise.
* gettext-tools/src/read-properties.c: Likewise.
* gettext-tools/src/write-java.c: Likewise.
* gettext-tools/src/write-mo.c: Likewise.
* gettext-tools/src/x-d.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-sh.c: Likewise.
* gettext-tools/emacs/po-mode.el: Fix typos in help and comments.
* gettext-tools/doc/gettext.texi: Fix typos.
* NEWS: Fix typos.

3 months agoexamples: Reenable checking of hello-c-gnome3 and hello-c++-gnome3.
Bruno Haible [Mon, 21 Jul 2025 20:06:25 +0000 (22:06 +0200)] 
examples: Reenable checking of hello-c-gnome3 and hello-c++-gnome3.

* gettext-tools/examples/check-examples (func_check__hello_c_gnome3,
func_check__hello_cxx_gnome3): Reenable most checks.

3 months agoexamples: Make 'check-example' more maintainable.
Bruno Haible [Sun, 20 Jul 2025 15:56:37 +0000 (17:56 +0200)] 
examples: Make 'check-example' more maintainable.

Some examples require specific sets of environment variables.
E.g. hello-go requires a PATH which uses GCC 13 or 14, not GCC 15,
due to <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119098>.

* gettext-tools/examples/check-examples: Rewrite to use one top-level function
per sample, instead of one top-level function for each check.

3 months agoRelease 0.26 v0.26
Bruno Haible [Sat, 19 Jul 2025 20:23:05 +0000 (22:23 +0200)] 
Release 0.26

3 months agoUpdate release steps.
Bruno Haible [Sat, 19 Jul 2025 19:52:47 +0000 (21:52 +0200)] 
Update release steps.

3 months agoexamples: Use infrastructure from gettext version 0.26.
Bruno Haible [Sat, 19 Jul 2025 16:10:30 +0000 (18:10 +0200)] 
examples: Use infrastructure from gettext version 0.26.

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

3 months agoUpdate translations from TP.
Bruno Haible [Sat, 19 Jul 2025 15:19:37 +0000 (17:19 +0200)] 
Update translations from TP.

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

3 months agoPrepare for 0.26 release.
Bruno Haible [Sat, 19 Jul 2025 15:08:04 +0000 (17:08 +0200)] 
Prepare for 0.26 release.

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

3 months agoUpdate to the newest gnulib.
Bruno Haible [Sat, 19 Jul 2025 14:17:39 +0000 (16:17 +0200)] 
Update to the newest gnulib.

3 months agoxgettext: JavaScript: Add one more test.
Bruno Haible [Sat, 19 Jul 2025 06:30:02 +0000 (08:30 +0200)] 
xgettext: JavaScript: Add one more test.

Reported by <fiurgeist@gmail.com>
at <https://savannah.gnu.org/bugs/index.php?67337>.

* gettext-tools/tests/xgettext-javascript-14: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

3 months agomsginit: Fix encoding of second title line, part 2.
Bruno Haible [Fri, 18 Jul 2025 19:38:32 +0000 (21:38 +0200)] 
msginit: Fix encoding of second title line, part 2.

Reported by Matilin Torre <watilin@protonmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-07/msg00024.html>.

To reproduce the problem:
$ LC_ALL=de_DE.ISO-8859-1 msginit -l fr_FR.ISO-8859-1 -i some_utf-8.pot -o fr.po

* gettext-tools/src/msginit.c (output_charset): New variable.
(content_type): Use output_charset.
(get_title): Use output_charset instead of ignoring was_utf8.
(fill_header): Initialize output_charset. Moved logic from content_type()
to here.

3 months agomsginit: Fix encoding of second title line, part 1.
Bruno Haible [Fri, 18 Jul 2025 19:34:55 +0000 (21:34 +0200)] 
msginit: Fix encoding of second title line, part 1.

Reported by Matilin Torre <watilin@protonmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-07/msg00024.html>.

* gettext-tools/src/msginit.c: Include xstriconv.h.
(get_title): Don't set OUTPUT_CHARSET; this does not work any more since 2005,
when an optimization was made in dcigettext.c. Instead, use xstr_iconv().

3 months agomsgfmt: Verify that .mo files are reproducible across GNU gettext versions.
Bruno Haible [Sat, 12 Jul 2025 12:38:33 +0000 (14:38 +0200)] 
msgfmt: Verify that .mo files are reproducible across GNU gettext versions.

* gettext-tools/tests/msgfmt-21: New file.
* gettext-tools/tests/testdata/mf-21.mo: New generated file.
* gettext-tools/tests/Makefile.am (TESTS): Add msgfmt-21.
(EXTRA_DIST): Add testdata/mf-21.mo.

3 months agoUpdate to the newest gnulib.
Bruno Haible [Sat, 12 Jul 2025 12:38:01 +0000 (14:38 +0200)] 
Update to the newest gnulib.

3 months agobuild: On mingw, avoid link dependency from xgettext.exe to libstdc++.
Bruno Haible [Wed, 9 Jul 2025 06:02:21 +0000 (08:02 +0200)] 
build: On mingw, avoid link dependency from xgettext.exe to libstdc++.

Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-10/msg00007.html>.

* gettext-tools/src/Makefile.am (xgettext_CXXFLAGS): New variable.

3 months agobuild: Use a more understandable directory name for ITS data files.
Bruno Haible [Wed, 9 Jul 2025 06:12:43 +0000 (08:12 +0200)] 
build: Use a more understandable directory name for ITS data files.

Reported by Santiago Vila <sanvila@debian.org>.

* gettext-tools/configure.ac (PACKAGE_SUFFIX): Use PACKAGE_VERSION, not
ARCHIVE_VERSION.

4 months agobuild: Update .gitignore files.
Bruno Haible [Tue, 8 Jul 2025 14:05:22 +0000 (16:05 +0200)] 
build: Update .gitignore files.

4 months agobuild: Remove autosprintf_all.html upon "make maintainer-clean".
Bruno Haible [Tue, 8 Jul 2025 10:06:29 +0000 (12:06 +0200)] 
build: Remove autosprintf_all.html upon "make maintainer-clean".

* gettext-runtime/libasprintf/Makefile.am (MAINTAINERCLEANFILES): New variable.

4 months agotests: Fix suggested valgrind invocation.
Bruno Haible [Mon, 7 Jul 2025 07:17:58 +0000 (09:17 +0200)] 
tests: Fix suggested valgrind invocation.

A while ago, valgrind exited with exit code != 0 when it encountered an error.
This is apparently not the case any more.

* gettext-tools/tests/Makefile.am (CHECKER): Add --error-exitcode option.

4 months agoxgettext: Perl: Add unit test for bug.
Bruno Haible [Mon, 7 Jul 2025 07:16:01 +0000 (09:16 +0200)] 
xgettext: Perl: Add unit test for bug.

* gettext-tools/tests/xgettext-perl-11: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

4 months agoxgettext: Perl: Fix a memory leak (regression 2003-06-27).
Bruno Haible [Mon, 7 Jul 2025 07:03:18 +0000 (09:03 +0200)] 
xgettext: Perl: Fix a memory leak (regression 2003-06-27).

* gettext-tools/src/x-perl.c (phase2_getc): Free the result of
from_current_source_encoding.

4 months agoxgettext: Perl: Fix bug with comment lines longer than 1024 (regr. 2024-09-26).
Bruno Haible [Mon, 7 Jul 2025 07:02:41 +0000 (09:02 +0200)] 
xgettext: Perl: Fix bug with comment lines longer than 1024 (regr. 2024-09-26).

Reported by Alyssa Ross <hi@alyssa.is> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-07/msg00009.html>.

* gettext-tools/src/x-perl.c (phase2_getc): Move the sb_free call until after
the savable_comment_add call.

4 months agodoc: More precisions about POSIX printf portability.
Bruno Haible [Fri, 4 Jul 2025 08:26:09 +0000 (10:26 +0200)] 
doc: More precisions about POSIX printf portability.

* gettext-tools/doc/lang-sh.texi (The printf approach): Add more details.
Based on info given by Jörg Schilling in 2020.

4 months agoPrepare for prerelease.
Bruno Haible [Fri, 4 Jul 2025 06:49:38 +0000 (08:49 +0200)] 
Prepare for prerelease.

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

4 months agoUpdate to the newest gnulib.
Bruno Haible [Fri, 4 Jul 2025 06:36:28 +0000 (08:36 +0200)] 
Update to the newest gnulib.

4 months agoxgettext: Warn when a message contains an URL or email address.
Bruno Haible [Fri, 4 Jul 2025 02:00:23 +0000 (04:00 +0200)] 
xgettext: Warn when a message contains an URL or email address.

Reported by Arsen Arsenović <arsen@aarsen.me>
at <https://savannah.gnu.org/bugs/?67000>.

* gettext-tools/src/xg-check.c: Include c-strstr.h.
(SIZEOF): New macro.
(string_has_url, message_has_url, string_has_email, message_has_email,
url_check_message): New functions.
(xgettext_check_message_list): Invoke url_check_message.
* gettext-tools/tests/xgettext-20: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

4 months agomsgcat, msgen, xgettext: Tweak processing order.
Bruno Haible [Thu, 3 Jul 2025 16:56:11 +0000 (18:56 +0200)] 
msgcat, msgen, xgettext: Tweak processing order.

* gettext-tools/src/msgcat.c (main): Sort the list of messages as the last
processing step before writing the PO file.
* gettext-tools/src/msgen.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.

4 months agoxgettext: Check msgid and msgid_plural for compatibility as format strings.
Bruno Haible [Thu, 3 Jul 2025 14:56:01 +0000 (16:56 +0200)] 
xgettext: Check msgid and msgid_plural for compatibility as format strings.

* gettext-tools/src/if-error.h: Include <stdarg.h>.
(if_verror): New declaration.
* gettext-tools/src/if-error.c (if_verror): New function, extracted from
if_error.
(if_error): Invoke it.
* gettext-tools/src/xg-check.h (xgettext_check_message_list): Renamed from
syntax_check_message_list.
* gettext-tools/src/xg-check.c: Include format.h, if-error.h.
(struct formatstring_error_logger_locals): New type.
(formatstring_error_logger, format_check_message): New functions.
(xgettext_check_message_list): Renamed from syntax_check_message_list. Invoke
also format_check_message.
* gettext-tools/src/xgettext.c (main): Invoke xgettext_check_message_list
instead of syntax_check_message_list.
* gettext-tools/tests/xgettext-19: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

4 months agoLisp, Scheme support: Fix format string checking.
Bruno Haible [Thu, 3 Jul 2025 14:30:39 +0000 (16:30 +0200)] 
Lisp, Scheme support: Fix format string checking.

* gettext-tools/src/format-lisp.c (format_check): Allow missing arguments if
!equality.
* gettext-tools/src/format-scheme.c (format_check): Likewise.

4 months agoLua support: Fix format string checking.
Bruno Haible [Thu, 3 Jul 2025 14:14:48 +0000 (16:14 +0200)] 
Lua support: Fix format string checking.

* gettext-tools/src/format-lua.c (format_check): Allow missing arguments if
!equality. Report all argument type mismatches at once.

4 months agotests: Strengthen tests.
Bruno Haible [Thu, 3 Jul 2025 14:04:40 +0000 (16:04 +0200)] 
tests: Strengthen tests.

* gettext-tools/tests/lang-bash: Invoke msgfmt with option '-c'.
* 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-c++-boost: Likewise.
* gettext-tools/tests/lang-clisp: Likewise.
* gettext-tools/tests/lang-csharp: Likewise.
* gettext-tools/tests/lang-d: Likewise.
* gettext-tools/tests/lang-elisp: 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-1: Likewise.
* gettext-tools/tests/lang-sh-2: Likewise.
* gettext-tools/tests/lang-sh-3: Likewise.
* gettext-tools/tests/lang-smalltalk: Likewise.
* gettext-tools/tests/lang-tcl: Likewise.
* gettext-tools/tests/lang-vala: Likewise.

4 months agoPython: Fix compilation error (regression 2025-06-24).
Bruno Haible [Thu, 3 Jul 2025 10:42:13 +0000 (12:42 +0200)] 
Python: Fix compilation error (regression 2025-06-24).

* gettext-tools/src/format-python-brace.c (parse_directive): Pass NULL, not
false.

4 months agoModula-2 support: Fix possible crash during format string checking.
Bruno Haible [Thu, 3 Jul 2025 13:47:02 +0000 (15:47 +0200)] 
Modula-2 support: Fix possible crash during format string checking.

* gettext-tools/src/format-modula2.c (format_check): Fix error message. Fix loop
bound.

4 months agoxgettext: Fix bug with syntax-checks on messages from Perl source code.
Bruno Haible [Thu, 3 Jul 2025 10:50:15 +0000 (12:50 +0200)] 
xgettext: Fix bug with syntax-checks on messages from Perl source code.

* gettext-tools/src/x-perl.c (extract_perl): Don't free logical_file_name,
because it is referenced by the 'pos' field of the returned messages, and
xg-check.c accesses and prints it.

4 months agoxgettext: Fix handling of syntax-checks with multi-domain POT files.
Bruno Haible [Thu, 3 Jul 2025 09:19:38 +0000 (11:19 +0200)] 
xgettext: Fix handling of syntax-checks with multi-domain POT files.

* gettext-tools/src/xgettext.c (main): Consider the total number of errors.

4 months agomsggrep: Add new options -W and -S.
Bruno Haible [Thu, 3 Jul 2025 06:48:44 +0000 (08:48 +0200)] 
msggrep: Add new options -W and -S.

Reported at <https://savannah.gnu.org/bugs/?40489>.

* gettext-tools/src/msggrep.c (workflow_flags, sticky_flags): New variables.
(main): Initialize them. Handle the options -W and -S.
(usage): Document the -W and -S options.
(is_message_selected_no_invert): Return true if one of the specified workflow
flags or one of the specified sticky flags is set.
* gettext-tools/tests/msggrep-12: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/msggrep.texi: Document the -W and -S options.
* NEWS: Mention the change.

4 months agomsggrep: Finish documenting the -X option (left-over from 2006-03-17).
Bruno Haible [Thu, 3 Jul 2025 05:55:01 +0000 (07:55 +0200)] 
msggrep: Finish documenting the -X option (left-over from 2006-03-17).

* gettext-tools/doc/msggrep.texi: Mention the -X option in the summary.

4 months agoUpdate NEWS after 0.25.1 release.
Bruno Haible [Wed, 2 Jul 2025 01:50:58 +0000 (03:50 +0200)] 
Update NEWS after 0.25.1 release.

* NEWS: Mention 0.25.1 release.

4 months agoMerge from 0.25.x branch: Prepare for 0.25.1 release.
Bruno Haible [Tue, 1 Jul 2025 23:12:21 +0000 (01:12 +0200)] 
Merge from 0.25.x branch: Prepare for 0.25.1 release.

* gettext-tools/misc/autopoint.in: Accept versions 0.23.2, 0.24.2, 0.25.1.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.25.1.
* NEWS: Update.