]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
5 months agoUpdate ISO 3166 country codes list.
Bruno Haible [Fri, 26 Dec 2025 21:50:10 +0000 (22:50 +0100)] 
Update ISO 3166 country codes list.

* gettext-tools/doc/ISO_3166: Update to match current Wikipedia.
* gettext-tools/doc/iso-3166.texi: Likewise.
* gettext-tools/src/msginit.c (catalogname_for_locale): Likewise.

5 months agoFix compilation error with MSVC 14 (regression 2025-12-19).
Bruno Haible [Mon, 22 Dec 2025 20:00:39 +0000 (21:00 +0100)] 
Fix compilation error with MSVC 14 (regression 2025-12-19).

* gettext-tools/src/msgl-merge.c (match_domain): Move variable declaration out
of an OpenMP 'for' loop. Reduce scope of local variables.

5 months agoFix compilation errors with older C compilers (regression 2025-12-19).
Bruno Haible [Mon, 22 Dec 2025 14:05:13 +0000 (15:05 +0100)] 
Fix compilation errors with older C compilers (regression 2025-12-19).

* gnulib-local/lib/xerror.c (multiline_internal): Add a semicolon between
a label and a declaration.
* gettext-tools/src/write-po.c (wrap): Likewise.
* gettext-tools/src/format-go.c (format_parse): Likewise.

5 months agoSimplify code.
Bruno Haible [Fri, 19 Dec 2025 20:50:39 +0000 (21:50 +0100)] 
Simplify code.

* gettext-tools/src/its.c (_its_encode_special_chars,
_its_encode_special_chars_for_merge): Remove unnecessary memory store.

5 months agoUpdate file list.
Bruno Haible [Fri, 19 Dec 2025 20:47:24 +0000 (21:47 +0100)] 
Update file list.

* gettext-tools/src/FILES: Update.

5 months agoModernize coding style: Reduce scope of local variables.
Bruno Haible [Fri, 19 Dec 2025 20:46:43 +0000 (21:46 +0100)] 
Modernize coding style: Reduce scope of local variables.

* HACKING (Coding Style): New section, copied from gnulib/HACKING.
* gettext-runtime/src/envsubst.c: Reduce scope of local variables.
* gettext-runtime/src/escapes.h: Likewise.
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-runtime/src/printf-command.c: Likewise.
* gettext-runtime/src/printf_gettext.c: Likewise.
* gettext-runtime/src/printf_ngettext.c: Likewise.
* gnulib-local/lib/addext.c: Likewise.
* gnulib-local/lib/backupfile.c: Likewise.
* gnulib-local/lib/gettext.h: Likewise.
* gnulib-local/lib/markup.c: Likewise.
* gnulib-local/lib/xerror.c: Likewise.
* libtextstyle/gnulib-local/lib/file-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/html-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/html-styled-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/memory-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/noop-styled-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/term-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/term-styled-ostream.oo.c: Likewise.
* libtextstyle/lib/color.c: Likewise.
* libtextstyle/lib/misc.c: Likewise.
* gettext-tools/src/cldr-plural-exp.c: Likewise.
* gettext-tools/src/cldr-plurals.c: Likewise.
* gettext-tools/src/file-list.c: Likewise.
* gettext-tools/src/filter-quote.c: Likewise.
* gettext-tools/src/format-awk.c: Likewise.
* gettext-tools/src/format-boost.c: Likewise.
* gettext-tools/src/format-c++-brace.c: Likewise.
* gettext-tools/src/format-c.c: Likewise.
* gettext-tools/src/format-c-parse.h: Likewise.
* gettext-tools/src/format-csharp.c: Likewise.
* gettext-tools/src/format-d.c: Likewise.
* gettext-tools/src/format-elisp.c: Likewise.
* gettext-tools/src/format-gcc-internal.c: Likewise.
* gettext-tools/src/format-gfc-internal.c: Likewise.
* gettext-tools/src/format-go.c: Likewise.
* gettext-tools/src/format-java-printf.c: Likewise.
* gettext-tools/src/format-java.c: Likewise.
* gettext-tools/src/format-javascript.c: Likewise.
* gettext-tools/src/format-kde-kuit.c: Likewise.
* gettext-tools/src/format-kde.c: Likewise.
* gettext-tools/src/format-librep.c: Likewise.
* gettext-tools/src/format-lisp.c: Likewise.
* gettext-tools/src/format-lua.c: Likewise.
* gettext-tools/src/format-modula2.c: Likewise.
* gettext-tools/src/format-ocaml.c: Likewise.
* gettext-tools/src/format-pascal.c: Likewise.
* gettext-tools/src/format-perl-brace.c: Likewise.
* gettext-tools/src/format-perl.c: Likewise.
* gettext-tools/src/format-php.c: Likewise.
* gettext-tools/src/format-python-brace.c: Likewise.
* gettext-tools/src/format-python.c: Likewise.
* gettext-tools/src/format-qt-plural.c: Likewise.
* gettext-tools/src/format-qt.c: Likewise.
* gettext-tools/src/format-ruby.c: Likewise.
* gettext-tools/src/format-rust.c: Likewise.
* gettext-tools/src/format-scheme.c: Likewise.
* gettext-tools/src/format-sh-printf.c: Likewise.
* gettext-tools/src/format-sh.c: Likewise.
* gettext-tools/src/format-smalltalk.c: Likewise.
* gettext-tools/src/format-tcl.c: Likewise.
* gettext-tools/src/format.c: Likewise.
* gettext-tools/src/hostname.c: Likewise.
* gettext-tools/src/if-error.c: Likewise.
* gettext-tools/src/its.c: Likewise.
* gettext-tools/src/locating-rules.c: Likewise.
* gettext-tools/src/message.c: Likewise.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgl-ascii.c: Likewise.
* gettext-tools/src/msgl-cat.c: Likewise.
* gettext-tools/src/msgl-charset.c: Likewise.
* gettext-tools/src/msgl-check.c: Likewise.
* gettext-tools/src/msgl-english.c: Likewise.
* gettext-tools/src/msgl-equal.c: Likewise.
* gettext-tools/src/msgl-fsearch.c: Likewise.
* gettext-tools/src/msgl-header.c: Likewise.
* gettext-tools/src/msgl-iconv.c: Likewise.
* gettext-tools/src/msgl-merge.c: Likewise.
* gettext-tools/src/msgl-ofn.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/open-catalog.c: Likewise.
* gettext-tools/src/plural-count.c: Likewise.
* gettext-tools/src/po-charset.c: Likewise.
* gettext-tools/src/po-time.c: Likewise.
* gettext-tools/src/read-catalog.c: Likewise.
* gettext-tools/src/read-catalog-abstract.c: Likewise.
* gettext-tools/src/read-catalog-file.c: Likewise.
* gettext-tools/src/read-catalog-special.c: Likewise.
* gettext-tools/src/read-csharp.c: Likewise.
* gettext-tools/src/read-desktop.c: Likewise.
* gettext-tools/src/read-java.c: Likewise.
* gettext-tools/src/read-mo.c: Likewise.
* gettext-tools/src/read-po-lex.c: Likewise.
* gettext-tools/src/read-properties.c: Likewise.
* gettext-tools/src/read-resources.c: Likewise.
* gettext-tools/src/read-stringtable.c: Likewise.
* gettext-tools/src/read-tcl.c: Likewise.
* gettext-tools/src/recode-sr-latin.c: Likewise.
* gettext-tools/src/search-path.c: Likewise.
* gettext-tools/src/str-list.c: Likewise.
* gettext-tools/src/urlget.c: Likewise.
* gettext-tools/src/write-catalog.c: Likewise.
* gettext-tools/src/write-csharp.c: Likewise.
* gettext-tools/src/write-desktop.c: Likewise.
* gettext-tools/src/write-java.c: Likewise.
* gettext-tools/src/write-mo.c: Likewise.
* gettext-tools/src/write-po.c: Likewise.
* gettext-tools/src/write-properties.c: Likewise.
* gettext-tools/src/write-qt.c: Likewise.
* gettext-tools/src/write-resources.c: Likewise.
* gettext-tools/src/write-stringtable.c: Likewise.
* gettext-tools/src/write-tcl.c: Likewise.
* gettext-tools/src/write-xml.c: Likewise.
* gettext-tools/src/x-awk.c: Likewise.
* gettext-tools/src/x-c.c: Likewise.
* gettext-tools/src/x-csharp.c: Likewise.
* gettext-tools/src/x-d.c: Likewise.
* gettext-tools/src/x-desktop.c: Likewise.
* gettext-tools/src/x-elisp.c: Likewise.
* gettext-tools/src/x-go.c: Likewise.
* gettext-tools/src/x-java.c: Likewise.
* gettext-tools/src/x-javascript.c: Likewise.
* gettext-tools/src/x-librep.c: Likewise.
* gettext-tools/src/x-lisp.c: Likewise.
* gettext-tools/src/x-lua.c: Likewise.
* gettext-tools/src/x-modula2.c: Likewise.
* gettext-tools/src/x-ocaml.c: Likewise.
* gettext-tools/src/x-perl.c: Likewise.
* gettext-tools/src/x-php.c: Likewise.
* gettext-tools/src/x-po.c: Likewise.
* gettext-tools/src/x-python.c: Likewise.
* gettext-tools/src/x-rst.c: Likewise.
* gettext-tools/src/x-ruby.c: Likewise.
* gettext-tools/src/x-rust.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-sh.c: Likewise.
* gettext-tools/src/x-smalltalk.c: Likewise.
* gettext-tools/src/x-tcl.c: Likewise.
* gettext-tools/src/x-typescript-impl.h: Likewise.
* gettext-tools/src/x-vala.c: Likewise.
* gettext-tools/src/x-ycp.c: Likewise.
* gettext-tools/src/xerror-handler.c: Likewise.
* gettext-tools/src/xg-arglist-callshape.c: Likewise.
* gettext-tools/src/xg-arglist-context.c: Likewise.
* gettext-tools/src/xg-arglist-parser.c: Likewise.
* gettext-tools/src/xg-check.c: Likewise.
* gettext-tools/src/xg-encoding.c: Likewise.
* gettext-tools/src/xg-message.c: Likewise.
* gettext-tools/src/xg-mixed-string.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.

5 months agoxgettext: Optimize vc-mtime usage.
Bruno Haible [Fri, 12 Dec 2025 18:25:15 +0000 (19:25 +0100)] 
xgettext: Optimize vc-mtime usage.

* gettext-tools/src/xgettext.c (extract_from_xml_file): Don't augment
files_for_vc_mtime twice.

5 months agoModernize coding style: Avoid 'goto' statements where possible.
Bruno Haible [Fri, 12 Dec 2025 10:28:00 +0000 (11:28 +0100)] 
Modernize coding style: Avoid 'goto' statements where possible.

* gettext-tools/src/msgfmt.c (get_languages): Use if/else instead of 'goto'.

5 months agoModernize coding style: Avoid 'continue;' statements where possible.
Bruno Haible [Fri, 12 Dec 2025 10:24:14 +0000 (11:24 +0100)] 
Modernize coding style: Avoid 'continue;' statements where possible.

* gnulib-local/lib/backupfile.c (max_backup_version): Use if/else instead of
'continue;'.
* gnulib-local/lib/markup.c (emit_start_element): Likewise.

5 months agoModernize coding style: Avoid 'continue;' statements where possible.
Bruno Haible [Thu, 11 Dec 2025 09:38:17 +0000 (10:38 +0100)] 
Modernize coding style: Avoid 'continue;' statements where possible.

* gettext-tools/src/cldr-plurals.c (extract_rules): Use if/else instead of
'continue;'.
* gettext-tools/src/msgfmt.c (msgfmt_operand_list_add_from_directory): Likewise.
* gettext-tools/src/read-po-lex.c (po_gram_lex): Likewise.
* gettext-tools/src/sentence.c (sentence_end): Likewise.
* gettext-tools/src/x-awk.c (extract_parenthesized): Use 'break;' instead of
'continue;'.
* gettext-tools/src/x-c.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-lua.c (extract_balanced): Likewise.
* gettext-tools/src/x-modula2.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-php.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-ycp.c (extract_parenthesized): Likewise.

6 months agotests: Remove a left-over debugging trace.
Bruno Haible [Mon, 1 Dec 2025 18:56:59 +0000 (19:56 +0100)] 
tests: Remove a left-over debugging trace.

* gettext-tools/tests/xgettext-20: Remove a 'set -x' statement.

6 months agolibasprintf: Document need to use g++ option -Wall.
Bruno Haible [Tue, 11 Nov 2025 11:24:10 +0000 (12:24 +0100)] 
libasprintf: Document need to use g++ option -Wall.

* gettext-runtime/libasprintf/autosprintf.texi (Using autosprintf): Expand text.
(Source code changes, Build system changes): New nodes.

7 months agoautopoint: Diagnose multiple invocations of AM_GNU_GETTEXT_VERSION.
Bruno Haible [Wed, 5 Nov 2025 14:01:12 +0000 (15:01 +0100)] 
autopoint: Diagnose multiple invocations of AM_GNU_GETTEXT_VERSION.

Reported by Santiago Vila in
<https://lists.gnu.org/archive/html/bug-gettext/2025-11/msg00001.html>.

* gettext-tools/autotools/autopoint.in: Report an error if "$xreq" or "$xver"
consists of more than one line.

7 months agoUpdate translations from TP.
Bruno Haible [Fri, 24 Oct 2025 13:18:53 +0000 (15:18 +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.

7 months agobuild: Add scripts for fetching the PO files.
Bruno Haible [Fri, 24 Oct 2025 12:13:44 +0000 (14:13 +0200)] 
build: Add scripts for fetching the PO files.

* gettext-runtime/po/fetch-po: New file.
* gettext-tools/po/fetch-po: New file.
* gettext-tools/examples/po/fetch-po: New file.
* check-copyright-headers (func_check_file): Don't complain about the LINGUAS
files, that will now have more than 10 lines.

7 months agopo: Add customizable 'fetch-po' script.
Bruno Haible [Fri, 24 Oct 2025 11:03:43 +0000 (13:03 +0200)] 
po: Add customizable 'fetch-po' script.

* gettext-tools/wizard/po-templates/traditional/fetch-po: New file.
* gettext-tools/wizard/Makefile.am (po_SCRIPTS): New variable.
(EXTRA_DIST): Add the po_SCRIPTS.
* gettext-tools/wizard/gettextize.in: Copy but don't overwrite po/fetch-po.
* gettext-tools/wizard/po-templates/traditional/Makefile.in.in (fetch-po): New
target.
* gettext-tools/examples/po/Makefile.am (fetch-po): New target.
* gettext-tools/examples/hello-*/po/Makefile.am (fetch-po): New target.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile (fetch-po): New
target.
* gettext-tools/doc/gettext.texi (po/fetch-po): New subsection.
(po/LINGUAS): Explain how it related to the 'fetch-po' script.
(Release Management): Document how to fetch the PO files before a release.
* NEWS: Mention the change.

7 months agoNew program 'po-fetch'.
Bruno Haible [Tue, 21 Oct 2025 12:29:27 +0000 (14:29 +0200)] 
New program 'po-fetch'.

* gettext-tools/misc/po-fetch.in: New file.
* gettext-tools/misc/Makefile.am: New file.
* gettext-tools/configure.ac: Add AC_CONFIG_FILES invocations for the misc/
directory.
* gettext-tools/Makefile.am (SUBDIRS): Add misc.
(EXTRA_DIST): Remove misc/disclaim-translations.txt.
(pkgdata_DATA): Remove variable.
* gettext-tools/doc/po-fetch.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (po-fetch): Add global menu entry.
(po-fetch Invocation): New section.
* PACKAGING: Mention the installed 'po-fetch' program.
* NEWS: Mention 'po-fetch'.

7 months agobuild: Remove duplicate file from version control.
Bruno Haible [Sun, 19 Oct 2025 03:55:33 +0000 (05:55 +0200)] 
build: Remove duplicate file from version control.

* gettext-tools/examples/po/remove-potcdate.sed: Remove file.
* autogen.sh: Copy remove-potcdate.sed to
gettext-tools/examples/po/remove-potcdate.sed.

7 months agobuild: Distribute one more file.
Bruno Haible [Sun, 19 Oct 2025 01:00:18 +0000 (03:00 +0200)] 
build: Distribute one more file.

* gettext-runtime/install-tests/Makefile.am (EXTRA_DIST): Add itest.pot.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

8 months 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.

8 months 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.

8 months 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.

8 months 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.

8 months 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.

8 months 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.

8 months 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.

8 months 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.

8 months 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.

8 months 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.

8 months 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.

8 months 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.

8 months 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 months 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 months 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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

10 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'.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

10 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 ':'.

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

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

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

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

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

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

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

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

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

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

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

10 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().

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

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

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

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

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

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

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

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