]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
25 hours agoFix a double-free bug. master
Bruno Haible [Fri, 22 May 2026 23:33:49 +0000 (01:33 +0200)] 
Fix a double-free bug.

Reported by <yangzaocn@outlook.com> at <https://savannah.gnu.org/bugs/?68391>.

* gettext-tools/src/locating-rules.c (locating_rule_list_add_from_file): Remove
xmlFreeDoc invocation inside the loop.

4 days agolibtextstyle: Document multithreading constraints.
Bruno Haible [Tue, 19 May 2026 13:24:20 +0000 (15:24 +0200)] 
libtextstyle: Document multithreading constraints.

* libtextstyle/gnulib-local/lib/term-ostream.oo.h (term_ostream_create):
Document the multithreading constraints that come from term-style-control.h.
* libtextstyle/gnulib-local/lib/term-styled-ostream.oo.h
(term_styled_ostream_create): Likewise.
* libtextstyle/doc/libtextstyle.texi (The term_ostream class,
The term_styled_ostream class): Likewise.

5 days agobuild: Update comments regarding --avoid'ed tests.
Bruno Haible [Mon, 18 May 2026 22:14:26 +0000 (00:14 +0200)] 
build: Update comments regarding --avoid'ed tests.

* autogen.sh: Clarify why we still avoid the *utime* tests modules.

5 days agobuild: Fix thread-optim test failure on Solaris 11 OmniOS.
Bruno Haible [Mon, 18 May 2026 22:09:34 +0000 (00:09 +0200)] 
build: Fix thread-optim test failure on Solaris 11 OmniOS.

* autogen.sh: Avoid the thread-optim-tests module in gnulib-tests.

10 days agoxgettext: Fix xgettext-rust-stackovfl-[34] failure on MSVC in 64-bit mode.
Bruno Haible [Wed, 13 May 2026 11:20:44 +0000 (13:20 +0200)] 
xgettext: Fix xgettext-rust-stackovfl-[34] failure on MSVC in 64-bit mode.

* gettext-tools/src/x-rust.c (MAX_NESTING_DEPTH): Reduce to 900.
* gettext-tools/tests/xgettext-rust-stackovfl-1: Reduce nesting depth by 100.
* gettext-tools/tests/xgettext-rust-stackovfl-2: Likewise.
* gettext-tools/tests/xgettext-rust-stackovfl-3: Likewise.
* gettext-tools/tests/xgettext-rust-stackovfl-4: Likewise.

11 days agobuild: Silence some warnings from gcc 16, part 2.
Bruno Haible [Tue, 12 May 2026 19:29:30 +0000 (21:29 +0200)] 
build: Silence some warnings from gcc 16, part 2.

* m4/more-warnings.m4 (gt_MORE_WARNINGS): Don't add a -Wno-useless-cast option
for gcc versions < 14.

11 days agoUse countof, part 4.
Bruno Haible [Tue, 12 May 2026 17:59:02 +0000 (19:59 +0200)] 
Use countof, part 4.

* autogen.sh (GNULIB_MODULES_LIBINTL, GNULIB_MODULES_TOOLS_FOR_SRC): Add
stdcountof-h.
* libtextstyle/gnulib-local/modules/moo (Depends-on): Add stdcountof-h.
* gettext-tools/tests/intl-setlocale-1-prg.c: Don't include <stdcountof.h>.
(countof): New macro.

11 days agoUpdate after gnulib changed.
Bruno Haible [Tue, 12 May 2026 14:28:19 +0000 (16:28 +0200)] 
Update after gnulib changed.

* autogen.sh: When invoking gnulib-tool for libgrep, don't pass the option
--avoid=mbszero. Since 2026-05-06, gnulib module 'regex' depends on gnulib
module 'localeinfo', which depends on gnulib module 'mbszero', and this
produced a build failure on MSVC: "unresolved external symbol mbszero".

11 days agodoc: Improve documentation of language identifier with variant.
Bruno Haible [Tue, 12 May 2026 14:20:40 +0000 (16:20 +0200)] 
doc: Improve documentation of language identifier with variant.

Reported by <wuzzy@disroot.org> at <https://savannah.gnu.org/bugs/?68082>.

* gettext-tools/doc/gettext.texi (Header Entry): Document that ll@variant is
allowed as well, and give a few examples.

11 days agodoc: Small fix.
Bruno Haible [Tue, 12 May 2026 13:34:57 +0000 (15:34 +0200)] 
doc: Small fix.

Reported by <gemmaro.dev@gmail.com> at <https://savannah.gnu.org/bugs/?68125>.

* gettext-tools/doc/gettext.texi (Format Type API): Fix a typo and styling.

12 days agoUse countof, part 3.
Bruno Haible [Tue, 12 May 2026 00:16:25 +0000 (02:16 +0200)] 
Use countof, part 3.

* m4/more-warnings.m4 (gt_MORE_WARNINGS): Update comment.
* gettext-tools/src/cldr-plural-exp.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(cldr_plural_rule_list_print): Use countof instead of SIZEOF.
* gettext-tools/src/format-kde-kuit.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(is_reference): Use countof instead of SIZEOF.
* gettext-tools/src/its.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(_its_is_valid_simple_gen_xml, is_valid_xhtml_element, is_valid_html_element):
Use countof instead of SIZEOF.
* gettext-tools/src/msginit.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(catalogname_for_locale, plural_forms, fill_header): Use countof instead of
SIZEOF.
* gettext-tools/src/msgl-check.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(check_header_entry): Use countof instead of SIZEOF.
* gettext-tools/src/msgl-header.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(msgdomain_list_set_header_field): Use countof instead of SIZEOF.
* gettext-tools/src/open-catalog.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(try_open_catalog_file): Use countof instead of SIZEOF.
* gettext-tools/src/po-charset.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(po_charset_canonicalize, po_is_charset_weird, po_is_charset_weird_cjk): Use
countof instead of SIZEOF.
* gettext-tools/src/write-mo.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(write_table): Use countof instead of SIZEOF.
* gettext-tools/src/x-awk.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase3_unget): Use countof instead of SIZEOF.
* gettext-tools/src/x-c.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase2_ungetc, phase3_ungetc, phase5_unget, phase6_unget,
x_c_unlex): Use countof instead of SIZEOF.
* gettext-tools/src/x-csharp.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase2_ungetc, phase3_ungetc, phase5_ungetc, phase6_unget,
phase7_unget): Use countof instead of SIZEOF.
* gettext-tools/src/x-java.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase2_ungetc, phase3_ungetc, phase5_unget, phase6_unget): Use
countof instead of SIZEOF.
* gettext-tools/src/x-javascript.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase2_ungetc, phase5_scan_xml_markup, phase5_unget): Use
countof instead of SIZEOF.
* gettext-tools/src/x-lua.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase3_unget, phase4_unget): Use countof instead of SIZEOF.
* gettext-tools/src/x-modula2.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase2_ungetc, phase3_unget, phase4_unget): Use countof instead of SIZEOF.
* gettext-tools/src/x-php.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase2_ungetc, phase3_ungetc, phase4_unget): Use countof instead
of SIZEOF.
* gettext-tools/src/x-python.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase2_ungetc, phase5_unget): Use countof instead of SIZEOF.
* gettext-tools/src/x-scheme.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, read_object): Use countof instead of SIZEOF.
* gettext-tools/src/x-sh.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase2_ungetc): Use countof instead of SIZEOF.
* gettext-tools/src/x-smalltalk.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase2_unget, phase3_unget, phase4_unget): Use countof instead of SIZEOF.
* gettext-tools/src/x-tcl.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase2_ungetc): Use countof instead of SIZEOF.
* gettext-tools/src/x-vala.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase1_ungetc, phase3_unget, phase4_unget): Use countof instead of SIZEOF.
* gettext-tools/src/x-ycp.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(phase2_ungetc, phase5_unget, phase8_unget): Use countof instead of SIZEOF.
* gettext-tools/src/xg-check.c: Include <stdcountof.h>
(SIZEOF): Remove macro.
(string_has_url): Use countof instead of SIZEOF.
* gettext-tools/src/xgettext.c (SIZEOF): Remove macro.

12 days agoUse countof, part 2.
Bruno Haible [Tue, 12 May 2026 00:11:51 +0000 (02:11 +0200)] 
Use countof, part 2.

* gettext-runtime/intl/setlocale.c: Include <stdcountof.h>
(setlocale_unixlike, get_main_locale_with_same_language,
get_main_locale_with_same_territory, libintl_setlocale, libintl_newlocale): Use
countof.
* gettext-tools/src/cldr-plurals.c: Include <stdcountof.h>
(remove_empty_examples): Use countof.
* gettext-tools/src/country-table.c: Include <stdcountof.h>
(country_table_size): Use countof.
* gettext-tools/src/lang-table.c: Include <stdcountof.h>
(language_table_size, language_variant_table_size): Use countof.
* gettext-tools/src/msgl-merge.c: Include <stdcountof.h>
(message_merge): Use countof.
* gettext-tools/src/plural-table.c: Include <stdcountof.h>
(plural_table_size): Use countof.
* gettext-tools/src/x-d.c: Include <stdcountof.h>
* gettext-tools/src/html5-entities.h (html5_lookup): Use countof.
* gettext-tools/tests/intl-setlocale-1-prg.c: Include <stdcountof.h>
(data_cnt, lang_cnt): Use countof.

12 days agoUse countof, part 1.
Bruno Haible [Mon, 11 May 2026 23:59:38 +0000 (01:59 +0200)] 
Use countof, part 1.

* libtextstyle/gnulib-local/build-aux/moopp (func_emit_source_c): Emit a
'#include <stdcountof.h>' and uses of countof.

12 days agoFix bug in recent "xgettext: C++: Support --keyword option with a qualified name...
Bruno Haible [Mon, 11 May 2026 21:59:09 +0000 (23:59 +0200)] 
Fix bug in recent "xgettext: C++: Support --keyword option with a qualified name." commit.

* gettext-tools/src/x-c.c (extract_parenthesized): Handle
xgettext_token_type_scope.

12 days agoFix bug in recent "Use the counted_by attribute." commit.
Bruno Haible [Mon, 11 May 2026 21:40:10 +0000 (23:40 +0200)] 
Fix bug in recent "Use the counted_by attribute." commit.

* gettext-tools/src/format-c++-brace.c (format_parse): Change type of
'arg_array' to be a pointer to an array.

12 days agoxgettext: Rust: Support --keyword option with a qualified name for macros.
Bruno Haible [Mon, 11 May 2026 15:08:06 +0000 (17:08 +0200)] 
xgettext: Rust: Support --keyword option with a qualified name for macros.

Reported by Lucas Baudin <lbaudin@gnome.org>
at <https://savannah.gnu.org/bugs/?68297>.

* gettext-tools/src/x-rust.c (extract_from_function_call_like): Use the
accumulated qualified name also for macro invocations.
(extract_from_node): Allow generic identifiers also for macro invocations.
* gettext-tools/tests/xgettext-rust-9: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

12 days agoxgettext: Rust: Support --keyword option with a qualified name.
Bruno Haible [Mon, 11 May 2026 14:45:30 +0000 (16:45 +0200)] 
xgettext: Rust: Support --keyword option with a qualified name.

* gettext-tools/src/x-rust.c: Include string-buffer-reversed.h".
(x_rust_keyword): Call split_keywordspec_ok2 instead of split_keywordspec_ok.
(ts_symbol_double_colon, ts_field_path): New variables.
(is_generic_identifier, generic_identifier_name): New functions.
(extract_from_function_call): Simplify by using generic_identifier_name. Invoke
hash_find_entry for each tail of a qualified name.
(extract_from_function_call_like): Add parameter callee_name. Invoke
hash_find_entry for each tail of a qualified name. Before calling
extract_from_function_call_like recursively, accumulate the qualified name
formed by the tokens seen so far.
(extract_from_node): Simplify by using is_generic_identifier and
generic_identifier_name.
(extract_rust): Initialize ts_symbol_double_colon, ts_field_path.
* gettext-tools/tests/xgettext-rust-8: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

2 weeks agoxgettext: C++: Support --keyword option with a qualified name.
Bruno Haible [Fri, 8 May 2026 21:08:14 +0000 (23:08 +0200)] 
xgettext: C++: Support --keyword option with a qualified name.

* gettext-tools/src/x-c.c (add_keyword): Call split_keywordspec_ok2 instead of
split_keywordspec_ok.
(enum token_type_ty): New enum value token_type_scope.
(phase5_get): Recognize '::' as token_type_scope.
(enum xgettext_token_type_ty): New enum value xgettext_token_type_scope.
(phase9_pushback, phase9_pushback_length): New variables.
(x_c_lex): Implement pushback. Handle token_type_scope.
(x_c_unlex): New function.
(extract_parenthesized): Look for qualified names. Invoke hash_find_entry for
each tail of such a qualified name.
* gettext-tools/tests/xgettext-c-c++-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

2 weeks agoxgettext: Fix typos in comments.
Bruno Haible [Fri, 8 May 2026 21:07:35 +0000 (23:07 +0200)] 
xgettext: Fix typos in comments.

* gettext-tools/src/x-csharp.c (extract_parenthesized): Fix typo in comment.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.

2 weeks agoxgettext: C: Refactor.
Bruno Haible [Fri, 8 May 2026 10:39:35 +0000 (12:39 +0200)] 
xgettext: C: Refactor.

* gettext-tools/src/x-c.c (enum xgettext_token_type_ty): Remove
xgettext_token_type_keyword.
(struct xgettext_token_ty): Remove 'shapes' field.
(x_c_lex): Don't call hash_find_entry here.
(extract_parenthesized): Call hash_find_entry here instead.

2 weeks agoxgettext: Refactor --keyword value checking.
Bruno Haible [Fri, 8 May 2026 20:44:03 +0000 (22:44 +0200)] 
xgettext: Refactor --keyword value checking.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add memrchr.
* gettext-tools/src/xg-arglist-callshape.h (split_keywordspec_ok,
split_keywordspec_ok2, split_keywordspec_ok_lisp): New declarations.
* gettext-tools/src/xg-arglist-callshape.c (split_keywordspec_ok,
split_keywordspec_ok2, split_keywordspec_ok_lisp): New functions.
* gettext-tools/src/x-awk.c (x_awk_keyword): Call split_keywordspec_ok.
* gettext-tools/src/x-c.c (add_keyword): Likewise.
* gettext-tools/src/x-csharp.c (x_csharp_keyword): Likewise.
* gettext-tools/src/x-d.c (x_d_keyword): Likewise.
* gettext-tools/src/x-elisp.c (x_elisp_keyword): Likewise.
* gettext-tools/src/x-go.c (x_go_keyword): Likewise.
* gettext-tools/src/x-java.c (x_java_keyword): Likewise.
* gettext-tools/src/x-javascript.c (x_javascript_keyword): Likewise.
* gettext-tools/src/x-librep.c (x_librep_keyword): Likewise.
* gettext-tools/src/x-lua.c (x_lua_keyword): Likewise.
* gettext-tools/src/x-modula2.c (x_modula2_keyword): Likewise.
* gettext-tools/src/x-ocaml.c (x_ocaml_keyword): Likewise.
* gettext-tools/src/x-perl.c (x_perl_keyword): Likewise.
* gettext-tools/src/x-php.c (x_php_keyword): Likewise.
* gettext-tools/src/x-python.c (x_python_keyword): Likewise.
* gettext-tools/src/x-rust.c (x_rust_keyword): Likewise.
* gettext-tools/src/x-sh.c (x_sh_keyword): Likewise.
* gettext-tools/src/x-typescript-impl.h (NOTE_OPTION_KEYWORD): Likewise.
* gettext-tools/src/x-vala.c (add_keyword): Likewise.
* gettext-tools/src/x-tcl.c (x_tcl_keyword): Call split_keywordspec_ok2.
* gettext-tools/src/x-lisp.c (x_lisp_keyword): Call split_keywordspec_ok_lisp.
* gettext-tools/src/x-scheme.c (x_scheme_keyword): Likewise.

2 weeks agoxgettext: Java: Add one more unit test.
Bruno Haible [Fri, 8 May 2026 00:05:42 +0000 (02:05 +0200)] 
xgettext: Java: Add one more unit test.

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

2 weeks agoxgettext: C#: Add one more unit test.
Bruno Haible [Fri, 8 May 2026 00:01:55 +0000 (02:01 +0200)] 
xgettext: C#: Add one more unit test.

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

2 weeks agoUpdate C++ tests and example.
Bruno Haible [Thu, 7 May 2026 23:17:18 +0000 (01:17 +0200)] 
Update C++ tests and example.

* gettext-tools/examples/hello-c++20/hello.cc: Add comment regarding
runtime_format and dynamic_format.
(dynamic_format): Conditionally define to runtime_format.
(main): Use dynamic_format instead of runtime_format.
* gettext-tools/tests/lang-c++20: Conditionally define to runtime_format.
(main): Use dynamic_format instead of runtime_format.
* gettext-tools/tests/lang-c++26: Use dynamic_format instead of runtime_format.

2 weeks agobuild: Fix a warning from gcc 16.
Bruno Haible [Thu, 7 May 2026 22:09:23 +0000 (00:09 +0200)] 
build: Fix a warning from gcc 16.

* gettext-tools/src/x-c.c (phase5_get): Comment out a redundant FALLTHROUGH;
statement.

2 weeks agobuild: Silence some warnings from gcc 16.
Bruno Haible [Thu, 7 May 2026 22:07:30 +0000 (00:07 +0200)] 
build: Silence some warnings from gcc 16.

* m4/more-warnings.m4 (gt_MORE_WARNINGS): Don't add the -Wuseless-cast and
-Wkeyword-macro options.

2 weeks agoUse streq.
Bruno Haible [Thu, 7 May 2026 21:26:47 +0000 (23:26 +0200)] 
Use streq.

* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC, GNULIB_MODULES_TOOLS_FOR_SRC,
GNULIB_MODULES_LIBGETTEXTPO): Add streq.
* gettext-runtime/src/envsubst.c (string_list_member): Use streq instead of
strcmp.
* gettext-tools/src/cldr-plural.y (yylex): Likewise.
* gettext-tools/src/file-list.c (read_names_from_file): Likewise.
* gettext-tools/src/format-java.c (message_format_parse): Likewise.
* gettext-tools/src/format-ocaml.c (parse_upto, format_check): Likewise.
* gettext-tools/src/format-perl-brace.c (format_parse): Likewise.
* gettext-tools/src/format-python.c (format_parse, format_check): Likewise.
* gettext-tools/src/format-python-brace.c (format_parse): Likewise.
* gettext-tools/src/format-ruby.c (format_parse, format_check): Likewise.
* gettext-tools/src/format-rust.c (format_parse): Likewise.
* gettext-tools/src/format-sh.c (format_parse): Likewise.
* gettext-tools/src/its.c: Include <string.h>.
(its_value_list_get_value, its_value_list_set_value, its_value_list_merge,
its_preserve_space_rule_constructor, its_extension_escape_rule_eval,
its_rule_list_is_translatable, its_rule_list_extract_text,
_its_copy_node_with_attributes, its_merge_context_merge_node): Use streq instead
of strcmp.
* gettext-tools/src/message.c (message_comment_filepos, message_list_search,
fuzzy_search_goal_function, msgdomain_list_sublist): Likewise.
* gettext-tools/src/msgexec.c (main, process_string): Likewise.
* gettext-tools/src/msgfilter.c (main): Likewise.
* gettext-tools/src/msgfmt.c (main, new_domain): Likewise.
* gettext-tools/src/msginit.c (main, catalogname_for_locale,
englishname_of_language, project_id, project_id_version,
language_team_englishname, plural_forms, get_title): Likewise.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Likewise.
* gettext-tools/src/msgl-charset.c (check_pot_charset,
compare_po_locale_charsets): Likewise.
* gettext-tools/src/msgl-equal.c (pos_equal, string_list_equal, message_equal,
msgdomain_equal): Likewise.
* gettext-tools/src/msgl-header.c (msgdomain_list_set_header_field): Likewise.
* gettext-tools/src/msgl-iconv.c (iconv_message_list_internal,
iconv_msgdomain_list, is_message_list_iconvable): Likewise.
* gettext-tools/src/msgl-merge.c (message_merge): Likewise.
* gettext-tools/src/msgpre.c (main): Likewise.
* gettext-tools/src/open-catalog.c (try_open_catalog_file): Likewise.
* gettext-tools/src/po-charset.c (po_charset_ascii_compatible,
po_is_charset_weird, po_is_charset_weird_cjk, po_charset_character_iterator):
Likewise.
* gettext-tools/src/read-csharp.c: Include <string.h>.
(msgdomain_read_csharp): Use streq instead of strcmp.
* gettext-tools/src/read-mo.c (read_mo_file): Likewise.
* gettext-tools/src/read-po-lex.c (po_lex_charset_set, keyword_p): Likewise.
* gettext-tools/src/read-stringtable.c (comment_line_end, stringtable_parse):
Likewise.
* gettext-tools/src/spit.c (englishname_of_language, englishname_of_country,
language_in_english, main): Likewise.
* gettext-tools/src/str-list.c (string_list_append_unique, string_list_member,
string_list_remove): Likewise.
* gettext-tools/src/write-catalog.c (msgdomain_list_print): Likewise.
* gettext-tools/src/write-csharp.c (msgdomain_write_csharp): Likewise.
* gettext-tools/src/write-desktop.c: Include <string.h>.
(msgdomain_write_desktop_bulk): Use streq instead of strcmp.
* gettext-tools/src/write-mo.c (msgdomain_write_mo): Likewise.
* gettext-tools/src/write-po.c (message_print_comment_filepos,
handle_filepos_comment_option, msgdomain_list_print_po): Likewise.
* gettext-tools/src/write-qt.c (msgdomain_write_qt): Likewise.
* gettext-tools/src/write-xml.c: Include <string.h>.
(msgdomain_write_xml_bulk): Use streq instead of strcmp.
* gettext-tools/src/x-awk.c (phase3_get, extract_parenthesized): Likewise.
* gettext-tools/src/x-c.c (phase6_get): Likewise.
* gettext-tools/src/x-go.c (scan_import_spec, get_type_from_type_name,
get_type_from_type_node, variable_env_lookup, type_equals,
get_mvtypes_of_expression, extract_from_function_call): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (get_tag_step1_fn, phase5_get): Likewise.
* gettext-tools/src/x-lua.c: Include <string.h>.
(phase3_get): Use streq instead of strcmp.
* gettext-tools/src/x-perl.c (get_here_document, x_perl_prelex, x_perl_lex):
Likewise.
* gettext-tools/src/x-rst.c: Include <string.h>.
(extract_rsj): Use streq instead of strcmp.
* gettext-tools/src/x-sh.c (read_command): Likewise.
* gettext-tools/src/x-smalltalk.c: Include <string.h>.
(phase4_get, extract_smalltalk): Use streq instead of strcmp.
* gettext-tools/src/x-vala.c (phase3_get, extract_balanced): Likewise.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Likewise.
* gettext-tools/src/xg-message.c: Include <string.h>.
(remember_a_message): Use streq instead of strcmp.
* gettext-tools/src/xgettext.c (main, xgettext_record_flag, xgettext_open,
language_to_extractor, extension_to_language): Likewise.

2 weeks agoUse memeq.
Bruno Haible [Thu, 7 May 2026 18:38:34 +0000 (20:38 +0200)] 
Use memeq.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC, GNULIB_MODULES_LIBGETTEXTPO): Add
memeq.
* gettext-tools/src/locating-rules.c: Include <string.h>.
(locating_rule_match, locating_rule_list_add_from_directory): Use memeq instead
of memcmp.
* gettext-tools/src/msgfmt.c (add_mo_suffix): Likewise.
* gettext-tools/src/msggrep.c (is_message_selected_no_invert): Likewise.
* gettext-tools/src/msginit.c (find_pot): Likewise.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Likewise.
* gettext-tools/src/msgl-equal.c (msgstr_equal, msgstr_equal_ignoring_potcdate):
Likewise.
* gettext-tools/src/msgl-iconv.c (iconv_message_list_internal): Likewise.
* gettext-tools/src/msgl-merge.c (message_merge): Likewise.
* gettext-tools/src/read-catalog.c (default_add_message): Likewise.
* gettext-tools/src/read-catalog-special.c (parse_comment_special): Likewise.
* gettext-tools/src/read-po-lex.c (po_lex_charset_set, mb_equal): Likewise.
* gettext-tools/src/read-stringtable.c (comment_line_end): Likewise.
* gettext-tools/src/spit.c (my_header_callback): Likewise.
* gettext-tools/src/str-list.c (string_list_append_unique_desc,
string_list_member_desc): Likewise.
* gettext-tools/src/write-mo.c (write_table): Likewise.
* gettext-tools/src/write-po.c (wrap): Likewise.
* gettext-tools/src/x-go.c (x_go_keyword): Likewise.
* gettext-tools/src/x-sh.c (read_command): Likewise.
* gettext-tools/src/xg-check.c (string_has_ascii_ellipsis): Likewise.
* gettext-tools/src/xg-mixed-string.c (mixed_string_buffer_equals,
mixed_string_buffer_startswith): Likewise.
* gettext-tools/src/xgettext.c (main, xgettext_record_flag): Likewise.

2 weeks agoUse the counted_by attribute.
Bruno Haible [Tue, 5 May 2026 22:51:28 +0000 (00:51 +0200)] 
Use the counted_by attribute.

* gettext-runtime/src/envsubst.c (struct string_list_ty): Mark the item field as
counted_by nitems.
(string_list_append): Increase slp->nitems before writing into slp->item.

* gettext-runtime/src/printf-command.c (struct format_piece): Mark the
text_start field as counted_by text_length.
(struct format_string): Mark the pieces field as counted_by npieces.

* gettext-tools/src/cldr-plural-exp.h: Include attribute.h.
(struct cldr_plural_range_list_ty): Mark the items field as counted_by nitems.
(struct cldr_plural_rule_list_ty): Mark the items field as counted_by nitems.
* gettext-tools/src/cldr-plural-exp.c (cldr_plural_range_list_free): Decrease
ranges->nitems after accessing the last element of ranges->items.
(cldr_plural_rule_free, cldr_plural_rule_list_print): Decrease rules->nitems
after accessing the last element of rules->items.
* gettext-tools/src/cldr-plural.y (add_range): Increase ranges->nitems before
writing into ranges->items.
(rule): Increase result->nitems before writing into result->items.

* gettext-tools/src/format-awk.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.

* gettext-tools/src/format-boost.c (struct spec): Mark the numbered field as
counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.

* gettext-tools/src/format-c++-brace.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.

* gettext-tools/src/format-c.c: Include attribute.h.
* gettext-tools/src/format-c-parse.h (struct spec): Mark the unnumbered field as
counted_by unnumbered_arg_count.
(format_parse_entrails): Increase spec.unnumbered_arg_count before writing into
spec.unnumbered.

* gettext-tools/src/format-d.c (struct segment): Mark the element field as
counted_by count.
(normalize_outermost_list, unfold_loop): Increase list->repeated.count
immediately after calling ensure_repeated_alloc.
(rotate_loop, initial_splitelement, initial_unshare,
append_repeated_to_initial): Increase list->initial.count immediately after
calling ensure_initial_alloc.
(make_intersected_list): Increase result->initial.count immediately after
calling grow_initial_alloc. Increase result->repeated.count immediately after
calling grow_repeated_alloc.

* gettext-tools/src/format-elisp.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.

* gettext-tools/src/format-gcc-internal.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.

* gettext-tools/src/format-gfc-internal.c: Include attribute.h.
(struct spec): Mark the unnumbered field as counted_by unnumbered_arg_count.

* gettext-tools/src/format-go.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.

* gettext-tools/src/format-java.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(message_format_parse): Increase spec->numbered_arg_count before writing into
spec->numbered.

* gettext-tools/src/format-java-printf.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.

* gettext-tools/src/format-javascript.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.

* gettext-tools/src/format-kde.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.

* gettext-tools/src/format-kde-kuit.c: Include attribute.h.
(struct kde_spec): Mark the numbered field as counted_by numbered_arg_count.

* gettext-tools/src/format-librep.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.

* gettext-tools/src/format-lisp.c (struct segment): Mark the element field as
counted_by count.
(normalize_outermost_list, unfold_loop): Increase list->repeated.count
immediately after calling ensure_repeated_alloc.
(rotate_loop, initial_splitelement, initial_unshare, shift_list,
append_repeated_to_initial): Increase list->initial.count immediately after
calling ensure_initial_alloc.
(make_intersected_list): Increase result->initial.count immediately after
calling grow_initial_alloc. Increase result->repeated.count immediately after
calling grow_repeated_alloc.
(make_union_list): Increase result->initial.count immediately after calling
grow_initial_alloc or before writing into result->initial.element. Increase
result->repeated.count immediately after calling grow_repeated_alloc.
(make_repeated_list): Increase list->initial.count immediately after calling
grow_initial_alloc. Increase list->repeated.count before writing into
list->repeated.element.

* gettext-tools/src/format-lua.c: Include attribute.h.
(struct spec): Mark the format_args field as counted_by format_args_count.
(format_parse): Increase spec.format_args_count before writing into
spec.format_args.

* gettext-tools/src/format-modula2.c: Include attribute.h.
(struct spec): Mark the args field as counted_by arg_count.
(format_parse): Increase spec.arg_count before writing into spec.args.

* gettext-tools/src/format-ocaml.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(parse_upto): Increase spec->numbered_arg_count before writing into
spec->numbered. Temporarily use an 'unnumbered' variable instead of
spec->numbered.

* gettext-tools/src/format-pascal.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.

* gettext-tools/src/format-perl.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.

* gettext-tools/src/format-perl-brace.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.

* gettext-tools/src/format-php.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.

* gettext-tools/src/format-python-brace.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count.
(parse_directive): Increase spec->named_arg_count before writing into
spec->named.

* gettext-tools/src/format-python.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count. Mark the
unnamed field as counted_by unnamed_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.
Increase spec.unnamed_arg_count before writing into spec.unnamed.

* gettext-tools/src/format-qt.c: Include attribute.h.
(struct spec): Add a comment.

* gettext-tools/src/format-ruby.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count. Mark the
numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.
Increase spec.numbered_arg_count before writing into spec.numbered. Temporarily
use an 'unnumbered' variable instead of spec.numbered.

* gettext-tools/src/format-rust.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count. Mark the
numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.
Increase spec.numbered_arg_count before writing into spec.numbered.

* gettext-tools/src/format-scheme.c (struct segment): Mark the element field as
counted_by count.
(normalize_outermost_list, unfold_loop): Increase list->repeated.count
immediately after calling ensure_repeated_alloc.
(rotate_loop, initial_splitelement, initial_unshare, shift_list,
append_repeated_to_initial): Increase list->initial.count immediately after
calling ensure_initial_alloc.
(make_intersected_list): Increase result->initial.count immediately after
calling grow_initial_alloc. Increase result->repeated.count immediately after
calling grow_repeated_alloc.
(make_union_list): Increase result->initial.count immediately after calling
grow_initial_alloc or before writing into result->initial.element. Increase
result->repeated.count immediately after calling grow_repeated_alloc.
(make_repeated_list): Increase list->initial.count immediately after calling
grow_initial_alloc. Increase list->repeated.count before writing into
list->repeated.element.

* gettext-tools/src/format-sh.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.

* gettext-tools/src/format-sh-printf.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.

* gettext-tools/src/format-smalltalk.c: Include attribute.h.
(struct spec): Add a comment.

* gettext-tools/src/format-tcl.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.

* gettext-tools/src/its.c: Include attribute.h.
(struct its_value_list_ty): Mark the items field as counted_by nitems.
(its_value_list_append): Increase values->nitems before writing into
values->items.
(struct its_pool_ty): Mark the items field as counted_by nitems.
(its_pool_alloc_value_list): Increase pool->nitems before writing into
pool->items.
(struct its_node_list_ty): Mark the items field as counted_by nitems.
(its_node_list_append): Increase nodes->nitems before writing into nodes->items.
(struct its_rule_list_ty): Mark the items field as counted_by nitems.
(its_rule_list_add_from_doc): Increase rules->nitems before writing into
rules->items.

* gettext-tools/src/locating-rules.c: Include attribute.h.
(struct document_locating_rule_list_ty): Mark the items field as counted_by
nitems.
(struct locating_rule_list_ty): Mark the items field as counted_by nitems.
(document_locating_rule_list_add, locating_rule_list_add_from_file): Increase
rules->nitems before writing into rules->items.

* gettext-tools/src/message.h: Include attribute.h.
(struct message_ty): Mark the filepos field as counted_by filepos_count. Mark
the alternative field as counted_by alternative_count.
(struct message_list_ty): Mark the item field as counted_by nitems.
(struct message_list_list_ty): Mark the item field as counted_by nitems.
(struct msgdomain_list_ty): Mark the item field as counted_by nitems.
* gettext-tools/src/message.c (message_comment_filepos): Increase
mp->filepos_count before writing into mp->filepos.
(message_list_append, message_list_prepend, message_list_insert_at): Increase
mlp->nitems before writing into mlp->item.
(message_list_list_append): Increase mllp->nitems before writing into
mllp->item.
(msgdomain_list_append): Increase mdlp->nitems before writing into mdlp->item.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Increase
tmp->alternative_count before writing into tmp->alternative.

* gettext-tools/src/msgfmt.h: Include attribute.h.
(struct msgfmt_operand_list_ty): Mark the items field as counted_by nitems.
* gettext-tools/src/msgfmt.c (msgfmt_operand_list_append): Increase
operands->nitems before writing into operands->items.

* gettext-tools/src/msggrep.c: Include attribute.h.
(struct grep_task): Mark the patterns field as counted_by patterns_size.
(main): Increase gt->patterns_size before writing into gt->patterns.

* gettext-tools/src/msgl-fsearch.c (struct mult_index_list): Mark the item field
as counted_by nitems.

* gettext-tools/src/read-po-internal.h (struct mbfile): Add comments.

* gettext-tools/src/search-path.c: Include attribute.h.
(struct path_array_ty): Mark the ptr field as counted_by len.
(fill): Increase array->len before writing into array->ptr.
(get_search_path): Increase array.len before writing into array.ptr.

* gettext-tools/src/str-list.h: Include attribute.h.
(struct string_list_ty): Mark the item field as counted_by nitems.
* gettext-tools/src/str-list.c (string_list_append, string_list_append_move,
string_list_append_unique, string_list_append_unique_desc): Increase slp->nitems
before writing into slp->item.
(string_list_remove): Decrease slp->nitems after accessing the last element of
slp->items.

* gettext-tools/src/x-perl.c (struct token_stack_ty): Mark the items field as
counted_by nitems.
(token_stack_push): Increase stack->nitems before writing into stack->items.
(token_stack_pop): Decrease stack->nitems after accessing the last element of
stack->items.

* gettext-tools/src/xg-arglist-callshape.h: Include attribute.h.
(struct callshapes): Mark the keyword field as counted_by keyword_len. Mark the
shapes field as counted_by nshapes.

* gettext-tools/src/xg-arglist-context.h: Include attribute.h.
(struct remembered_message_list_ty): Mark the item field as counted_by nitems.
(struct flag_region_ty): Mark the subregion field as counted_by nsubregions.
* gettext-tools/src/xg-arglist-context.c (remembered_message_list_append):
Increase list->nitems before writing into list->item.
(the_null_context_region): Update.
(new_sub_region): Increase outer_region->nsubregions before writing into
outer_region->subregion.

* gettext-tools/src/xg-arglist-parser.h: Include attribute.h.
(struct arglist_parser): Mark the keyword field as counted_by keyword_len. Mark
the alternative field as counted_by nalternatives.

* gettext-tools/src/xg-check.c (struct bullet_stack_ty): Add a comment.

* gettext-tools/src/xg-mixed-string.h: Include attribute.h.
(struct mixed_string_segment): Mark the contents field as counted_by length.
(struct mixed_string): Mark the segments field as counted_by nsegments.
(struct mixed_string_buffer): Mark the segments field as counted_by nsegments.
* gettext-tools/src/xg-mixed-string.c (mixed_string_alloc_simple,
mixed_string_alloc_utf8, mixed_string_clone, mixed_string_concat,
mixed_string_concat_free1, mixed_string_buffer_add_segment,
mixed_string_buffer_result, mixed_string_buffer_cloned_result): Increase
ms->nsegments before writing into ms->segments.

* gettext-tools/libgrep/m-regex.c: Include attribute.h.
(struct compiled_regex): Mark the patterns field as counted_by pcount.
(compile): Increase cregex->pcount before writing into cregex->patterns.

2 weeks agoUpdate after gnulib changed.
Bruno Haible [Tue, 5 May 2026 19:34:30 +0000 (21:34 +0200)] 
Update after gnulib changed.

2 weeks agoUpdate to the newest gnulib.
Bruno Haible [Tue, 5 May 2026 19:25:34 +0000 (21:25 +0200)] 
Update to the newest gnulib.

2 weeks agoxgettext: Convert a struct to a flexible-member struct.
Bruno Haible [Tue, 5 May 2026 19:23:01 +0000 (21:23 +0200)] 
xgettext: Convert a struct to a flexible-member struct.

* gettext-tools/src/xg-arglist-callshape.h: Include flexmember.h.
(struct callshapes): Convert the 'shapes' field to a flexible array member.
* gettext-tools/src/xg-arglist-callshape.c (insert_keyword_callshape): Compute
the needed memory using FLEXSIZEOF.
* gettext-tools/src/x-perl.c (extract_variable): Use a union to allocate a
'struct callshapes' on the stack.

2 weeks agointl: Fix an ISO C undefined behaviour.
Bruno Haible [Tue, 5 May 2026 18:23:13 +0000 (20:23 +0200)] 
intl: Fix an ISO C undefined behaviour.

ISO C 23 Â§ 6.5.3.3.(7) and Â§ 6.7.7.4.(14) and Â§ 6.2.7 forbid invoking
a function pointer after having cast it to an incompatible function type.

* gettext-runtime/intl/localealias.c (alias_compare): Change type of parameters
to 'const void *'.
(_nl_expand_alias, read_alias_file): Don't cast the alias_compare function
pointer.

2 weeks agoFix an invariant verification.
Bruno Haible [Tue, 5 May 2026 16:26:06 +0000 (18:26 +0200)] 
Fix an invariant verification.

* gettext-tools/src/search-path.c (get_search_path): Fix the verification of
array.len.

2 weeks agoHACKING: Explain how to use the undefined-behaviour sanitizer.
Bruno Haible [Tue, 5 May 2026 15:15:39 +0000 (17:15 +0200)] 
HACKING: Explain how to use the undefined-behaviour sanitizer.

* HACKING (Customizing the Undefined Behaviour Sanitizer): New section.

3 weeks agomsgpre: Avoid a crash in an out-of-memory situation.
Bruno Haible [Fri, 1 May 2026 07:41:52 +0000 (09:41 +0200)] 
msgpre: Avoid a crash in an out-of-memory situation.

* gettext-tools/src/msgpre.c (main): Use xmalloc instead of malloc.

3 weeks agobuild: Drop a gnulib patch that is no longer needed.
Bruno Haible [Tue, 28 Apr 2026 09:58:06 +0000 (11:58 +0200)] 
build: Drop a gnulib patch that is no longer needed.

* gnulib-local/lib/regex_internal.h.diff: Remove file.
* gnulib-local/Makefile.am (EXTRA_DIST): Remove it.

6 weeks agobuild: Stop shipping tarballs in lzip-compressed format.
Bruno Haible [Thu, 9 Apr 2026 10:18:57 +0000 (12:18 +0200)] 
build: Stop shipping tarballs in lzip-compressed format.

The lzip-compressed tarball is only 5% smaller than the xz-compressed tarball
since we added a customized am__tar variable on 2025-01-08. Not worth it.

* Admin/release-steps: Remove instruction for lzip.

6 weeks agobuild: Stop shipping tarballs in lzip-compressed format.
Bruno Haible [Thu, 9 Apr 2026 09:33:08 +0000 (11:33 +0200)] 
build: Stop shipping tarballs in lzip-compressed format.

The lzip-compressed tarball is only 5% smaller than the xz-compressed tarball
since we added a customized am__tar variable on 2025-01-08. Not worth it.

* Admin/release-steps: Remove instruction for lzip.

6 weeks agoHACKING: Revisit prerequisite tools.
Bruno Haible [Thu, 9 Apr 2026 08:06:02 +0000 (10:06 +0200)] 
HACKING: Revisit prerequisite tools.

Reported by Patrice Dumas <pertusus@free.fr> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-04/msg00002.html>.

* HACKING: Move Free Pascal from the maintainers section to the Requirements
section, since it is needed for a plain "make".

6 weeks agoHACKING: Revisit prerequisite tools.
Bruno Haible [Thu, 9 Apr 2026 08:03:51 +0000 (10:03 +0200)] 
HACKING: Revisit prerequisite tools.

* HACKING: Remove lzip, no longer needed since 2018-09-16. Move xz to
maintainers section.

6 weeks agoexamples: Improve documentation of hello-pascal.
Bruno Haible [Thu, 9 Apr 2026 03:26:14 +0000 (05:26 +0200)] 
examples: Improve documentation of hello-pascal.

* gettext-tools/examples/hello-pascal/INSTALL: Update, see HACKING.

6 weeks agointl: Fix an ISO C undefined behaviour.
Bruno Haible [Wed, 8 Apr 2026 22:59:08 +0000 (00:59 +0200)] 
intl: Fix an ISO C undefined behaviour.

ISO C 23 Â§ 6.5.7.(10) has requirements for pointer subtraction.

Reported by <pizlonator> in https://github.com/pizlonator/fil-c/.

* gettext-runtime/intl/localealias.c (read_alias_file): Avoid invalid pointer
subtraction.

7 weeks agogettext.h: Pull a patch from gnulib.
Bruno Haible [Wed, 1 Apr 2026 22:27:53 +0000 (00:27 +0200)] 
gettext.h: Pull a patch from gnulib.

* gnulib-local/lib/gettext.h (LC_MESSAGES): Define fallback like in
gnulib/lib/locale.in.h.

2 months agoNEWS: Add info about backported fixes.
Bruno Haible [Mon, 9 Mar 2026 18:25:36 +0000 (19:25 +0100)] 
NEWS: Add info about backported fixes.

Suggested by Zack Weinberg in
<https://lists.gnu.org/archive/html/autoconf/2026-03/msg00035.html>.

* NEWS: Add info about fixes backported to 0.23.x and 0.24.x branches.

2 months agoDocument requirement for GNU make >= 4.0.
Bruno Haible [Sat, 7 Mar 2026 08:18:50 +0000 (09:18 +0100)] 
Document requirement for GNU make >= 4.0.

This is necessary because of the po/Makefile.in.in.

* DEPENDENCIES (make): Update requirements.

3 months agoUpdate after gnulib changed.
Bruno Haible [Sat, 21 Feb 2026 07:21:57 +0000 (08:21 +0100)] 
Update after gnulib changed.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES): Add streq-opt.
Remove streq.

3 months agoUpdate to the newest gnulib.
Bruno Haible [Sat, 21 Feb 2026 07:21:05 +0000 (08:21 +0100)] 
Update to the newest gnulib.

3 months agobuild: Fix "gmake installcheck" failures on AIX.
Bruno Haible [Sat, 14 Feb 2026 21:05:07 +0000 (22:05 +0100)] 
build: Fix "gmake installcheck" failures on AIX.

* gettext-runtime/configure.ac (INSTALLED_LIBINTL): On AIX, add '-pthread'.
* gettext-tools/configure.ac (INSTALLED_LIBINTL): Likewise.
* libtextstyle/configure.ac (INSTALLED_LIBTEXTSTYLE): Add $LIBXML, $LIBTERMINFO,
$LIBICONV. On AIX, add '-pthread'.

3 months agobuild: Avoid build failures when building from the git repository.
Bruno Haible [Thu, 5 Feb 2026 23:40:01 +0000 (00:40 +0100)] 
build: Avoid build failures when building from the git repository.

Reported by Satadru Pramanik <satadru@gmail.com>
at <https://savannah.gnu.org/bugs/?67999>.

* gettext-tools/man/Makefile.am ($(man_MAN1MISC)): Use a temporary file, so that
we don't run 'patch' on a nonexistent file or on an already patched result.

3 months agobuild: When help2man fails, let it show the reason.
Bruno Haible [Tue, 3 Feb 2026 20:55:48 +0000 (21:55 +0100)] 
build: When help2man fails, let it show the reason.

This is needed for investigating failures in a CI environment.

* gettext-runtime/man/help2man (get_option_value): Pipe the program's stderr to
stderr, not to /dev/null.
* gettext-tools/man/help2man (get_option_value): Likewise.

3 months agospit: Make --version and --help output consistent.
Bruno Haible [Tue, 3 Feb 2026 20:24:35 +0000 (21:24 +0100)] 
spit: Make --version and --help output consistent.

* gettext-tools/src/spit.py.in (main): Remove extra newline at the beginning
and the end of the --version and --help output.

3 months agoUpdate after gnulib changed on 2025-12-02.
Bruno Haible [Thu, 29 Jan 2026 17:49:53 +0000 (18:49 +0100)] 
Update after gnulib changed on 2025-12-02.

3 months agoRelease 1.0 v1.0
Bruno Haible [Thu, 29 Jan 2026 00:13:11 +0000 (01:13 +0100)] 
Release 1.0

3 months agoexamples: Use infrastructure from gettext version 1.0.
Bruno Haible [Wed, 28 Jan 2026 23:47:27 +0000 (00:47 +0100)] 
examples: Use infrastructure from gettext version 1.0.

* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 1.0.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.
* gettext-tools/examples/hello-*/autogen.sh: Copy remove-potcdate.sed from the
new location in the source tree. Copy also the no-op fetch-po.
* gettext-tools/examples/hello-*/autoclean.sh: Remove also fetch-po.

3 months agoPrepare for 1.0 release.
Bruno Haible [Wed, 28 Jan 2026 16:16:54 +0000 (17:16 +0100)] 
Prepare for 1.0 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-tools/wizard/po-templates/traditional/Makefile.in.in: Update Origin.
* gettext-runtime/intl/Makefile.am (LTV_*): Bump to 12:6:4.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 2:7:2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 6:0:6.
* gettext-tools/autotools/autopoint.in: Accept version 1.0.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 1.0.
* gettext-tools/autotools/archive.dir.tar: Regenerated.

3 months agoUpdate translations from TP.
Bruno Haible [Wed, 28 Jan 2026 17:23:55 +0000 (18:23 +0100)] 
Update translations from TP.

3 months agomsginit: Don't backup when mergeing a PO file and --no-translator is given.
Bruno Haible [Wed, 28 Jan 2026 23:06:13 +0000 (00:06 +0100)] 
msginit: Don't backup when mergeing a PO file and --no-translator is given.

* gettext-tools/src/msginit.c (main): Don't create a backup file if
--no-translator is specified.

3 months agomsginit: Fix handling of --properties-output when producing a merged PO file.
Bruno Haible [Wed, 28 Jan 2026 22:51:50 +0000 (23:51 +0100)] 
msginit: Fix handling of --properties-output when producing a merged PO file.

* gettext-tools/src/msgl-merge.h (merge): Add definitions_file_syntax parameter.
Rename input_syntax parameter to references_file_syntax.
* gettext-tools/src/msgl-merge.c (merge): Likewise.
* gettext-tools/src/msginit.c (main): New variable output_file_input_syntax.
Fix merge() call.
* gettext-tools/src/msgmerge.c (main): Update merge() call.

3 months agopo: Distribute the fetch-po file.
Bruno Haible [Wed, 28 Jan 2026 20:51:24 +0000 (21:51 +0100)] 
po: Distribute the fetch-po file.

This is somewhat tricky, because it is also a phony Makefile target.

* gettext-tools/wizard/po-templates/traditional/Makefile.in.in (dist2):
Distribute 'fetch-po'.
* gettext-tools/examples/po/Makefile.am (distdir1): Distribute 'fetch-po'.
* gettext-tools/examples/hello-*/po/Makefile.am (distdir1): Likewise.

3 months agoUpdate to the newest gnulib.
Bruno Haible [Wed, 28 Jan 2026 12:56:56 +0000 (13:56 +0100)] 
Update to the newest gnulib.

3 months agoxgettext: PHP: Fix parsing of strings and heredocs with embedded expressions.
Bruno Haible [Wed, 28 Jan 2026 12:50:21 +0000 (13:50 +0100)] 
xgettext: PHP: Fix parsing of strings and heredocs with embedded expressions.

Reported by Gert Jan Schoneveld <gertjan@facilityapps.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-08/msg00007.html>
and by Benoit Waldmann <benoit.waldmann@siagilus.fr>
at <https://savannah.gnu.org/bugs/index.php?item_id=67948>.

* gettext-tools/src/x-php.c (enum token_type_ty): New enum values
token_type_lbrace, token_type_rbrace.
(struct php_extractor): New field brace_nesting_depth.
(php_extractor_init_rest): Initialize it.
(extract_balanced): Forward-declare.
(process_dquote_or_heredoc): Change handling of embedded expressions.
(phase4_get): Recognize token_type_lbrace, token_type_rbrace.
(extract_balanced): Recurse also for token_type_lbrace.
(extract_php_input): Remove function.
(extract_php): Inline it here.
* gettext-tools/tests/xgettext-php-1: Add more tests of embedded expressions.

3 months agoUpdate "Written by ..." lines in --version output.
Bruno Haible [Wed, 28 Jan 2026 02:12:04 +0000 (03:12 +0100)] 
Update "Written by ..." lines in --version output.

* gettext-tools/src/msgfmt.c (main): Add me and Daiki Ueno as co-authors.
* gettext-runtime/src/ngettext.c (main): Add me as co-author.
* gettext-tools/src/msgmerge.c (main): Likewise.
* gettext-tools/src/msgunfmt.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* gettext-tools/wizard/gettextize.in (func_version): Likewise. Terminate the
'Written by' line with a '.'.
* gettext-tools/autotools/autopoint.in (func_version): Terminate the
'Written by' line with a '.'.
* gettext-tools/autotools/convert-archive.in (func_version): Likewise.
* gettext-tools/misc/po-fetch.in (func_version): Likewise.
* gettext-runtime/src/gettext.sh.in (func_version): Likewise.
* libtextstyle/gnulib-local/build-aux/moopp (func_version): Likewise.

3 months agopo-mode: Prepare for inclusion in GNU ELPA.
Bruno Haible [Tue, 27 Jan 2026 05:03:04 +0000 (06:03 +0100)] 
po-mode: Prepare for inclusion in GNU ELPA.

Suggested by Stefan Monnier <monnier@iro.umontreal.ca> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00086.html>.

* gettext-tools/emacs/po-mode.el: Add meta-information field 'Version:',
required by ELPA. Move meta-information after the copyright and license notice.
(po-mode-version-string): Move definition.
* gettext-tools/emacs/po-compat.el: Move meta-information after the copyright
and license notice. Convert the file to UTF-8 encoding.

3 months agoUpdate "Written by ..." lines and authorship notices in source files.
Bruno Haible [Tue, 27 Jan 2026 04:43:26 +0000 (05:43 +0100)] 
Update "Written by ..." lines and authorship notices in source files.

3 months agoUpdate email address in copyright notices.
Bruno Haible [Mon, 26 Jan 2026 21:08:15 +0000 (22:08 +0100)] 
Update email address in copyright notices.

3 months agoUse the common comment style.
Bruno Haible [Wed, 21 Jan 2026 17:44:07 +0000 (18:44 +0100)] 
Use the common comment style.

3 months agoFix a small memory leak in libgettextpo.
Bruno Haible [Sun, 25 Jan 2026 18:17:48 +0000 (19:17 +0100)] 
Fix a small memory leak in libgettextpo.

Reported by <gemmaro.dev@gmail.com> at
<https://savannah.gnu.org/bugs/index.php?item_id=67892>
and by Albert Astals Cid <aacid@kde.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00071.html>.

* gettext-tools/src/read-po-lex.h: Include str-list.h.
(lex_start): Add arena parameter.
* gettext-tools/src/read-po-lex.c (lex_start): Add arena parameter. Add the
heap-allocated file_name to the arena.
* gettext-tools/src/read-catalog-abstract.h: Include str-list.h.
(struct catalog_input_format): Add arena parameter to parse() method.
(catalog_reader_parse): Add arena parameter.
* gettext-tools/src/read-properties.c (properties_parse): Add arena parameter.
* gettext-tools/src/read-stringtable.c (stringtable_parse): Add arena parameter.
* gettext-tools/src/read-po.c (po_parse): Add arena parameter. Update lex_start
call.
* gettext-tools/src/read-catalog-abstract.c (catalog_reader_parse): Add arena
parameter. Update parse() method call.
* gettext-tools/src/read-catalog.h: Include str-list.h.
(read_catalog_stream): Add arena parameter.
* gettext-tools/src/read-catalog.c (read_catalog_stream): Add arena parameter.
Update catalog_reader_parse call.
* gettext-tools/src/read-catalog-file.c: Include str-list.h.
(read_catalog_file): Update read_catalog_stream call.
* gettext-tools/src/read-csharp.c: Include str-list.h.
(execute_and_read_po_output): Update read_catalog_stream call.
* gettext-tools/src/read-java.c: Include str-list.h.
(execute_and_read_po_output): Update read_catalog_stream call.
* gettext-tools/src/read-resources.c: Include str-list.h.
(execute_and_read_po_output): Update read_catalog_stream call.
* gettext-tools/src/read-tcl.c: Include str-list.h.
(msgdomain_read_tcl): Update read_catalog_stream call.
* gettext-tools/libgettextpo/gettext-po.c: Include str-list.h.
(struct po_file): Add field 'arena'.
(po_file_create): Initialize it.
(po_file_read): Likewise. Update read_catalog_stream call.
(po_file_free): Destroy the arena.
* gettext-tools/src/msgfmt.c (read_catalog_file_msgfmt): Update
catalog_reader_parse call.
* gettext-tools/src/x-po.c: Include str-list.h.
(extract): Update catalog_reader_parse call.
* gettext-tools/src/xgettext.c (read_exclusion_file): Update
catalog_reader_parse call.

3 months agodoc: Explain translation projects.
Bruno Haible [Sun, 25 Jan 2026 10:13:43 +0000 (11:13 +0100)] 
doc: Explain translation projects.

* gettext-tools/doc/gettext.texi (Interfacing with the Translators): New
section.

3 months agoFix warnings with gcc 15 and glibc 2.43.
Bruno Haible [Sun, 25 Jan 2026 03:51:32 +0000 (04:51 +0100)] 
Fix warnings with gcc 15 and glibc 2.43.

* libtextstyle/gnulib-local/lib/glib/gstrfuncs.in.h (g_strstr_len): Change
return type to 'const gchar *'.
* libtextstyle/gnulib-local/lib/glib/gstrfuncs.c (g_strstr_len): Likewise.
* libtextstyle/gnulib-local/lib/libcroco/cr-rgb.c (cr_rgb_set_from_name): Change
type of 'result'.
* gettext-tools/src/cldr-plurals.c (extract_rules): Cast the sb_xcontents_c
result to 'char *'.

4 months agoFix some -Wzero-as-null-pointer-constant warnings.
Bruno Haible [Sat, 17 Jan 2026 03:39:12 +0000 (04:39 +0100)] 
Fix some -Wzero-as-null-pointer-constant warnings.

* gnulib-local/lib/backupfile.c (max_backup_version, backup_args, get_version):
Write NULL instead of 0.
* gettext-tools/src/x-go.c (add_to_hash_table): Likewise.

4 months agobuild: Fix "make installcheck" on MSVC.
Bruno Haible [Thu, 15 Jan 2026 11:32:43 +0000 (12:32 +0100)] 
build: Fix "make installcheck" on MSVC.

Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00042.html>.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): New variable
INTL_WINDOWS_LIBS. Add it to LIBINTL and LTLIBINTL.
* gettext-runtime/configure.ac (INSTALLED_LIBINTL): Add $INTL_WINDOWS_LIBS.
* gettext-tools/configure.ac (INSTALLED_LIBINTL): Likewise.
* libtextstyle/configure.ac (INSTALLED_LIBTEXTSTYLE): New variable.
* libtextstyle/install-tests/Makefile.am (installcheck-local): Link with
$INSTALLED_LIBTEXTSTYLE instead of -ltextstyle.

4 months agoPrepare for 1.0-pre2 prerelease.
Bruno Haible [Tue, 13 Jan 2026 06:16:30 +0000 (07:16 +0100)] 
Prepare for 1.0-pre2 prerelease.

* gettext-runtime/src/envsubst.c (main): Update copyright year in --version
output.
* gettext-runtime/src/gettext.c (main): Likewise.
* gettext-runtime/src/gettext.sh.in (func_version): Likewise.
* gettext-runtime/src/ngettext.c (main): Likewise.
* gettext-runtime/src/printf_gettext.c (main): Likewise.
* gettext-runtime/src/printf_ngettext.c (main): Likewise.
* gettext-tools/src/cldr-plurals.c (main): Likewise.
* gettext-tools/src/hostname.c (main): Likewise.
* gettext-tools/src/msgattrib.c (main): Likewise.
* gettext-tools/src/msgcat.c (main): Likewise.
* gettext-tools/src/msgcmp.c (main): Likewise.
* gettext-tools/src/msgcomm.c (main): Likewise.
* gettext-tools/src/msgconv.c (main): Likewise.
* gettext-tools/src/msgen.c (main): Likewise.
* gettext-tools/src/msgexec.c (main): Likewise.
* gettext-tools/src/msgfilter.c (main): Likewise.
* gettext-tools/src/msgfmt.c (main): Likewise.
* gettext-tools/src/msggrep.c (main): Likewise.
* gettext-tools/src/msginit.c (main): Likewise.
* gettext-tools/src/msgmerge.c (main): Likewise.
* gettext-tools/src/msgpre.c (main): Likewise.
* gettext-tools/src/msgunfmt.c (main): Likewise.
* gettext-tools/src/msguniq.c (main): Likewise.
* gettext-tools/src/recode-sr-latin.c (main): Likewise.
* gettext-tools/src/spit.c (main): Likewise.
* gettext-tools/src/spit.py.in (main): Likewise.
* gettext-tools/src/urlget.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* gettext-tools/autotools/convert-archive.in (func_version): Likewise.
* gettext-tools/autotools/autopoint.in (func_version): Likewise.
* gettext-tools/wizard/gettextize.in (func_version): Likewise.

4 months agocldr-plurals: Fix parsing of plurals.xml from CLDR 38 or newer.
Michele Locati [Tue, 13 Jan 2026 10:23:14 +0000 (11:23 +0100)] 
cldr-plurals: Fix parsing of plurals.xml from CLDR 38 or newer.

Reported by Michele Locati at <https://savannah.gnu.org/bugs/?66378>.

* gettext-tools/src/cldr-plural-exp.c (eval_relation): Accept operands 'c', 'e'.
* gettext-tools/src/cldr-plural.y (yylex): Likewise.
* gettext-tools/src/cldr-plurals.c (extract_rules): Test for type='cardinal'.
(get_XcY_end, force_spaces, remove_XcY, remove_empty_examples): New functions.
(main): Invoke force_spaces, remove_XcY, remove_empty_examples.
* gettext-tools/tests/cldr-plurals-1: Add more tests.
* AUTHORS: Add Michele Locati.

4 months agoDocument a libcurl requirement.
Bruno Haible [Mon, 12 Jan 2026 11:43:29 +0000 (12:43 +0100)] 
Document a libcurl requirement.

Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00029.html>.

* DEPENDENCIES: Mention special requirements of libcurl on Windows.

4 months agoImprove support for clang on native Windows.
Bruno Haible [Sun, 11 Jan 2026 00:22:52 +0000 (01:22 +0100)] 
Improve support for clang on native Windows.

* gettext-tools/src/write-mo.c (roundup): Treat clang like GCC.

4 months agoImprove support for clang on native Windows.
Bruno Haible [Sun, 11 Jan 2026 00:22:29 +0000 (01:22 +0100)] 
Improve support for clang on native Windows.

* gettext-runtime/intl/libgnuintl.in.h (_INTL_REDIRECT_ASM): Treat clang like
GCC.

4 months agoImprove support for clang on native Windows.
Bruno Haible [Sun, 11 Jan 2026 00:21:58 +0000 (01:21 +0100)] 
Improve support for clang on native Windows.

Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00021.html>.

* libtextstyle/gnulib-local/lib/ostream.oo.h (ostream_printf, ostream_vprintf):
Treat clang like GCC.
* gettext-runtime/libasprintf/vasprintf.h (__attribute__, __format__,
__printf__): Likewise.
* gettext-runtime/libasprintf/autosprintf.in.h (_AUTOSPRINTF_ATTRIBUTE_FORMAT):
Likewise.
* gettext-tools/src/format.h (formatstring_error_logger_t): Likewise.
* gettext-tools/src/if-error.h (if_error, if_verror): Likewise.
* gettext-tools/src/msgl-check.c (formatstring_error_logger): Likewise.
* gettext-tools/src/msgl-merge.c (silent_error_logger): Likewise.
* gettext-tools/src/po-error.h (__attribute__, __format__, __printf__, po_error,
po_error_at_line): Likewise.
* gettext-tools/src/read-po-lex.h (__attribute__, __format__, __printf__):
Likewise.
* gettext-tools/src/xg-check.c (formatstring_error_logger): Likewise.
* gettext-tools/libgettextpo/gettext-po.in.h (struct po_error_handler):
Likewise.

4 months agolibtextstyle: Assume a working <stdbool.h>.
Bruno Haible [Sat, 10 Jan 2026 21:17:40 +0000 (22:17 +0100)] 
libtextstyle: Assume a working <stdbool.h>.

* libtextstyle/lib/textstyle.h: Include <stdbool.h> instead of
<textstyle/stdbool.h>.
* libtextstyle/lib/Makefile.am (nobase_nodist_include_HEADERS): Don't add
textstyle/stdbool.h.
(textstyle/stdbool.h): Remove rule.
(BUILT_SOURCES, MOSTLYCLEANFILES, CLEANFILES): Update accordingly.
(EXTRA_DIST): Remove stdbool.mini.h.
* libtextstyle/lib/stdbool.mini.h: Remove file.
* gettext-tools/src/Makefile.am (textstyle/stdbool.h): Remove target.
(BUILT_SOURCES, MOSTLYCLEANFILES): Remove textstyle/stdbool.h.

4 months agoxgettext: Allow inhibiting the warnings about URLs and email addresses.
Bruno Haible [Sat, 10 Jan 2026 19:16:46 +0000 (20:16 +0100)] 
xgettext: Allow inhibiting the warnings about URLs and email addresses.

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

* gettext-tools/src/message.h (enum syntax_check_type): Add sc_url, sc_email.
(NSYNTAXCHECKS): Increase by 2.
* gettext-tools/src/message.c (syntax_check_name): Update.
* gettext-tools/src/xgettext.h (default_syntax_check): Add comment.
* gettext-tools/src/xgettext.c (default_syntax_check): Add initializer.
(main): Recognize --no-check option.
(usage): Document --no-check option.
* gettext-tools/src/xg-message.c (decide_syntax_check): Assume that
default_syntax_check[i] != undecided.
* gettext-tools/src/xg-check.c (syntax_check_function): Remove the second
argument.
(string_has_ascii_ellipsis): New function, extracted from
syntax_check_ellipsis_unicode.
(message_has_ascii_ellipsis): New function.
(syntax_check_ellipsis_unicode): Remove the second argument. Simplify. Emit only
a single error for both msgid and msgid_plural.
(string_has_space_ellipsis): New function, extracted from
syntax_check_space_ellipsis.
(message_has_space_ellipsis): New function.
(syntax_check_space_ellipsis): Remove the second argument. Simplify. Emit only
a single error for both msgid and msgid_plural.
(syntax_check_quote_unicode): Remove the second argument.
(syntax_check_bullet_unicode_string): New function, extracted from
syntax_check_bullet_unicode.
(syntax_check_bullet_unicode): Remove the second argument. Simplify.
(string_has_url): Don't recognize 'mailto:' URLs.
(syntax_check_url, syntax_check_email): New functions, extracted from
url_check_message.
(url_check_message): Remove function.
(sc_funcs): Add syntax_check_url, syntax_check_email.
(syntax_check_message): Simplify.
(xgettext_check_message_list): Don't invoke url_check_message.
* gettext-tools/tests/xgettext-14: Update after xg-check.c changesd.
* gettext-tools/tests/xgettext-20: Add more testcases.
* gettext-tools/doc/xgettext.texi: Document the --no-check option.
* gettext-tools/doc/gettext.texi: Bump copyright year.
* NEWS: Mention the change.

4 months agoDocument libjson-c version needed with MSVC.
Bruno Haible [Sat, 10 Jan 2026 09:19:02 +0000 (10:19 +0100)] 
Document libjson-c version needed with MSVC.

* DEPENDENCIES (libjson-c): Add note regarding MSVC.

4 months agolibtextstyle: Fix compilation error on platforms without working iconv.
Bruno Haible [Thu, 8 Jan 2026 09:32:43 +0000 (10:32 +0100)] 
libtextstyle: Fix compilation error on platforms without working iconv.

* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c (iconv_ostream::flush): Add
second parameter.

4 months agobuild: Fix build failure in VPATH builds outside of the source tree.
Bruno Haible [Wed, 7 Jan 2026 21:00:50 +0000 (22:00 +0100)] 
build: Fix build failure in VPATH builds outside of the source tree.

* build-aux/jar-cf: Unset CDPATH. Run 'git log' from $top_srcdir, not from the
current directory.

4 months agopo-mode: Tweak.
Bruno Haible [Fri, 2 Jan 2026 04:09:01 +0000 (05:09 +0100)] 
po-mode: Tweak.

* gettext-tools/emacs/po-mode.el: Require Emacs >= 23, like before.
(po-mode-version-string): Bump to 2.32.

4 months agopo-mode: Add po-subedit-mode-hook.
gemmaro [Thu, 1 Jan 2026 13:47:52 +0000 (22:47 +0900)] 
po-mode: Add po-subedit-mode-hook.

Reported by <KAction@gnu.org> at
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890295>.

* gettext-tools/emacs/po-mode.el (po-subedit-mode-hook): Add the
customize variable.

4 months agopo-mode: Use define-derived-mode for po-subedit-mode.
gemmaro [Thu, 1 Jan 2026 13:29:08 +0000 (22:29 +0900)] 
po-mode: Use define-derived-mode for po-subedit-mode.

* gettext-tools/emacs/po-mode.el (po-subedit-mode): Define as derived
mode from text mode using define-derived-mode.
(po-subedit-mode-syntax-table, po-mode-abbrev-table): Remove these
variables, as define-derived-mode creates them automatically.
(po-edit-string): Use po-subedit-mode instead of text-mode.  Remove
local abbrev table, keymap, syntax table, and hook invocation, since
define-derived-mode handles these automatically.  Move easy-menu
definition to the define-derived-mode body.
(Package-Requires): Add minimum Emacs version requirement. The
define-derived-mode was probably introduced in Emacs 19.23, and commit
7797a29e9 dropped support for Emacs versions before 23.

4 months agomsgfmt: Don't overflow the stack with large values for --alignment.
Collin Funk [Wed, 31 Dec 2025 18:11:47 +0000 (19:11 +0100)] 
msgfmt: Don't overflow the stack with large values for --alignment.

Reported by <maxtodeath@gmail.com> at <https://savannah.gnu.org/bugs/?67743>.

* gettext-tools/src/write-mo.c (write_table): Use xmalloca instead of
alloca to allocate the buffer to fill with NUL bytes.

4 months agodoc: Mention the issue of LLM licenses.
Bruno Haible [Wed, 31 Dec 2025 17:10:11 +0000 (18:10 +0100)] 
doc: Mention the issue of LLM licenses.

* gettext-tools/doc/gettext.texi (Installing an LLM): Discuss LLM license and
size.

4 months agopo-fetch: Clarify the directory.
Bruno Haible [Wed, 31 Dec 2025 01:03:38 +0000 (02:03 +0100)] 
po-fetch: Clarify the directory.

Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00030.html>.

* gettext-tools/misc/po-fetch.in (func_usage): Mention the output files
location.
* gettext-tools/doc/po-fetch.texi: Likewise.

4 months agoDocument the relation between fetch-po and version control.
Bruno Haible [Wed, 31 Dec 2025 00:58:57 +0000 (01:58 +0100)] 
Document the relation between fetch-po and version control.

Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00030.html>.

* gettext-tools/doc/gettext.texi (po/fetch-po): Add a reference.
(Translations under Version Control): Remove subsection.
(PO Template File under Version Control?): New subsection.
(Translations under Version Control?): New subsection.

4 months agobuild: Avoid link error on native Windows with --enable-shared.
Bruno Haible [Tue, 30 Dec 2025 23:37:14 +0000 (00:37 +0100)] 
build: Avoid link error on native Windows with --enable-shared.

Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00038.html>.

* gettext-tools/src/country-table.h (country_table, country_table_size): Remove
LIBGETTEXTSRC_DLL_VARIABLE annotation.

4 months agopo-fetch: Add man page.
Bruno Haible [Tue, 30 Dec 2025 23:11:05 +0000 (00:11 +0100)] 
po-fetch: Add man page.

Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00030.html>.

* gettext-tools/man/po-fetch.x: New file.
* gettext-tools/man/po-fetch.1.diff: New file.
* gettext-tools/man/Makefile.am (man_aux): Add po-fetch.x.
(man_MAN1MISC): New variable.
(man_MAN1): Include it.
(man_HTML): Add po-fetch.1.html.
($(man_MAN1MISC)): New rule.
(po-fetch.1, po-fetch.1.html): State dependencies.
* PACKAGING: Update.

4 months agobuild: Fix generation of man pages on native Windows.
Bruno Haible [Tue, 30 Dec 2025 23:10:38 +0000 (00:10 +0100)] 
build: Fix generation of man pages on native Windows.

* gettext-tools/man/Makefile.am ($(man_MAN1WIZARD), $(man_MAN1AUTOTOOLS)): Write
$${progname}, not $${progname}$(EXEEXT).

4 months agobuild: Reject libjson-c versions older than 0.13.
Bruno Haible [Tue, 30 Dec 2025 21:09:03 +0000 (22:09 +0100)] 
build: Reject libjson-c versions older than 0.13.

Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00036.html>.

* DEPENDENCIES: Require libjson-c >= 0.13.
* gettext-tools/configure.ac (LIBJSON_C): Reject libjson-c versions older than
0.13.

4 months agoFix "make dist" error when BUILT_SPIT_IN_C is false.
Bruno Haible [Tue, 30 Dec 2025 00:26:21 +0000 (01:26 +0100)] 
Fix "make dist" error when BUILT_SPIT_IN_C is false.

* gettext-tools/src/Makefile.am (noinst_SCRIPTS): Add 'spit'.
(spit): New rule.
(BUILT_SOURCES, MOSTLYCLEANFILES): Add it.

4 months agoStart preparing for 1.0 release.
Bruno Haible [Mon, 29 Dec 2025 18:53:54 +0000 (19:53 +0100)] 
Start preparing for 1.0 release.

* gettext-runtime/m4/gettext.m4: Bump version.

4 months agoNew program 'msgpre'.
Bruno Haible [Mon, 29 Dec 2025 18:51:19 +0000 (19:51 +0100)] 
New program 'msgpre'.

* gettext-tools/src/msgpre.c: New file, based on gettext-tools/src/msgfilter.c.
* gettext-tools/src/FILES: Describe msgpre.c.
* gettext-tools/src/Makefile.am (bin_PROGRAMS): Add msgpre.
(msgpre_SOURCES, msgpre_LDADD, msgpre_DEPENDENCIES, msgpre_CPPFLAGS,
msgpre_LDFLAGS): New variables.
* gettext-tools/po/POTFILES.in: Add msgpre.c.
* gettext-tools/man/msgpre.x: New file.
* gettext-tools/man/Makefile.am (man_aux): Add msgpre.x.
(man_MAN1SRC): Add msgpre.1.
(man_HTML): Add msgpre.1.html.
(msgpre.1, msgpre.1.html): Add dependencies.
* gettext-tools/doc/gettext.texi (msgpre Invocation): New section.
* gettext-tools/doc/msgpre.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/Makefile.am (programs-for-distdir): Create msgpre.
(distdir1, gen-man1): Update for the msgpre.1 manual page.
* NEWS: Mention the new program.

4 months agoWhitespace tweaks.
Bruno Haible [Sun, 28 Dec 2025 11:32:56 +0000 (12:32 +0100)] 
Whitespace tweaks.

* gettext-tools/src/msgfilter.c: Fix indentation.
* gettext-tools/src/*.c: GNU coding style.
* gettext-tools/tests/*.c: Likewise.

4 months agoNew program 'spit'.
Bruno Haible [Sat, 27 Dec 2025 22:53:53 +0000 (23:53 +0100)] 
New program 'spit'.

* gettext-tools/machine-translation/README: New file.
* gettext-tools/machine-translation/prototype/README: New file.
* gettext-tools/machine-translation/prototype/OllamaSpit.java: New file.
* gettext-tools/machine-translation/prototype/ollama-spit.c: New file.
* gettext-tools/machine-translation/prototype/ollama-spit.go: New file.
* gettext-tools/machine-translation/prototype/ollama-spit.py: New file.
* gettext-tools/machine-translation/prototype/ollama-spit.sh: New file.
* gettext-tools/configure.ac (INCJSON_C, LIBJSON_C, INCCURL, LIBCURL): New
variables.
(BUILD_SPIT_IN_C): New conditional.
(AC_CONFIG_FILES): Add src/spit.py.
* gettext-tools/src/country-table.h: New file.
* gettext-tools/src/country-table.c: New file.
* gettext-tools/src/spit.c: New file.
* gettext-tools/src/spit.py.in: New file.
* gettext-tools/src/FILES: Mention the new files.
* gettext-tools/src/Makefile.am (bin_PROGRAMS): Conditionally add 'spit'.
(noinst_SCRIPTS): New variable.
(noinst_HEADERS): Add country-table.h.
(spit_SOURCES, spit_CFLAGS, spit_LDADD, spit_DEPENDENCIES, spit_CPPFLAGS,
spit_LDFLAGS): New variables.
(install-exec-local): Conditionally install spit.py.
(installdirs-local, uninstall-local): Update accordingly.
(DISTCLEANFILES): Add spit.py.
* gettext-tools/po/POTFILES.in: Add spit.c.
* gettext-tools/man/spit.x: New file.
* gettext-tools/man/Makefile.am (man_aux): Add spit.x.
(man_MAN1SRC): Add spit.1.
(man_HTML): Add spit.1.html.
(spit.1, spit.1.html): Add dependencies.
* gettext-tools/doc/gettext.texi (Pretranslating): New chapter.
* gettext-tools/doc/spit.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* DEPENDENCIES: Update URLs for libxml2. Add libjson-c, libcurl, Python, the
Python module 'requests'.
* PACKAGING: Mention the 'spit' program and its manual page.
* NEWS: Mention the change.

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