Bruno Haible [Thu, 13 Feb 2025 05:08:04 +0000 (06:08 +0100)]
intl: Update info about Galician and Tamil.
* gettext-runtime/intl/setlocale.c (locales_with_principal_territory): Galician
is mostly spoken in Spain, not Portugal. Tamil is mostly spoken in India, not
Sri Lanka.
Bruno Haible [Wed, 12 Feb 2025 09:39:35 +0000 (10:39 +0100)]
msginit: Update info about Galician and Tamil.
* gettext-tools/src/msginit.c (catalogname_for_locale): Galician is mostly
spoken in Spain, not Portugal. Tamil is mostly spoken in India, not Sri Lanka.
Bruno Haible [Tue, 11 Feb 2025 10:37:40 +0000 (11:37 +0100)]
xgettext: Rust: Support named format string arguments.
Reported by Kévin Commaille <zecakeh@tedomum.fr>
in <https://savannah.gnu.org/bugs/?56774>.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add unictype/property-xid-start,
unictype/property-xid-continue.
(GNULIB_MODULES_LIBGETTEXTPO): Likewise.
* gettext-tools/src/format-rust.c (struct named_arg): New type.
(struct spec): Add fields named_arg_count, named.
(named_arg_compare): New function.
(format_parse): Recognize named arguments.
(format_check): Search for differences also between the named arguments.
(format_print): Print also the named arguments.
* gettext-tools/tests/format-rust-1: Add test cases for named arguments.
* gettext-tools/tests/format-rust-2: Likewise.
* gettext-tools/doc/gettext.texi (rust-format): Describe rust-format in detail.
Bruno Haible [Tue, 11 Feb 2025 08:49:08 +0000 (09:49 +0100)]
Refactor.
* gettext-tools/src/format-ruby.c (format_parse): Use two different variables
named_allocated, numbered_allocated, instead of a single variable (assuming that
INVALID_MIXES_NAMED_UNNAMED is called when it should).
Bruno Haible [Sat, 8 Feb 2025 07:49:16 +0000 (08:49 +0100)]
xgettext: Handle out-of-memory situation.
* gettext-tools/src/x-perl.c: Include xstring-desc.h.
(extract_quotelike): Call xsd_c instead of sd_c.
* gettext-tools/src/x-rust.c: Include xstring-desc.h.
(string_literal_value): Call xsd_c instead of sd_c. Call sb_xappend_desc
instead of sb_append_desc.
Bruno Haible [Tue, 4 Feb 2025 00:03:53 +0000 (01:03 +0100)]
libtextstyle: Improve namespacing.
* gettext-tools/libgettextpo/Makefile.am (COMPILATION_UNITS): Fix reference to
LIBOBJS variable.
(config.h): Remove leading part of the elements of
$(lts_libtextstyle_LTLIBOBJS).
Bruno Haible [Sun, 2 Feb 2025 10:39:54 +0000 (11:39 +0100)]
Sort programming languages like in the documentation.
* gettext-tools/src/xgettext.c (usage): For the -L, -a, -k, --flag options, sort
the list of programming languages like in the documentation. Add Guile, Rust,
GSettings, that were forgotten earlier.
* gettext-tools/doc/xgettext.texi: Likewise.
* gettext-tools/examples/README: Sort the examples like the programming
languages in the documentation.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Likewise.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Likewise.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS, hello-*.pot,
SMALLPOFILES_FOR_lang, $(srcdir)/../hello-*/po/$(LL).po): Likewise.
Bruno Haible [Wed, 29 Jan 2025 11:30:02 +0000 (12:30 +0100)]
intl: Fix undefined behaviour.
Found using clang's undefined-behaviour sanitizer:
CC="clang -fsanitize=undefined -fno-sanitize-recover=undefined".
It reported errors
dcigettext.c:1219:25: runtime error: applying non-zero offset 8 to null pointer
because the code was computing
outbuf = freemem + sizeof (size_t);
where freemem == NULL.
* gettext-runtime/intl/dcigettext.c (_nl_find_msg): Initialize outbuf only after
having verified that freemem_size >= sizeof (size_t).
Bruno Haible [Tue, 28 Jan 2025 10:45:28 +0000 (11:45 +0100)]
Rust: Add lang-rust unit test.
* gettext-tools/tests/init.cfg (this_test_is_longrunning_): New function.
* gettext-tools/tests/lang-rust: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* HACKING: Reorder. Document prerequisites for Rust unit test.
Kévin Commaille [Tue, 28 Jan 2025 10:08:52 +0000 (11:08 +0100)]
Prepare for Rust support.
* gettext-tools/tests/xgettext-rust-1: New file, based on
gettext-tools/tests/xgettext-csharp-1.
* gettext-tools/tests/xgettext-rust-2: New file, based on
gettext-tools/tests/xgettext-csharp-2.
* gettext-tools/tests/xgettext-rust-3: New file, based on
gettext-tools/tests/xgettext-csharp-3.
* gettext-tools/tests/xgettext-rust-4: New file, based on
gettext-tools/tests/xgettext-csharp-4.
* gettext-tools/tests/xgettext-rust-5: New file, based on
gettext-tools/tests/xgettext-csharp-7.
Reported by <fiurgeist@gmail.com> at <https://savannah.gnu.org/bugs/?66643>.
* gettext-tools/src/x-javascript.c (phase5_get): Treat a '<' character in
level type level_embedded_js_in_xml like in the other level types.
* gettext-tools/tests/xgettext-javascript-6: Add another test case.
* NEWS: Mention the fix.
Bruno Haible [Tue, 31 Dec 2024 01:43:41 +0000 (02:43 +0100)]
When reading PO files, treat CRLF line terminators like LF.
Reported by Hendy Irawan <hendy@hendyirawan.com> at
<https://savannah.gnu.org/bugs/?52395>.
* gettext-tools/src/read-po-internal.h (MBFILE_MAX_PUSHBACK): Renamed from
NPUSHBACK. Increase by 1.
(struct mbfile): Rename field 'have_pushback' to 'pushback_count'.
* gettext-tools/src/read-po-lex.c (mbfile_init): Update.
(mbfile_getc): Read pushed-back character before testing for sticky EOF.
(mbfile_ungetc): Update.
(mbfile_getc_normalized): New function.
(lex_getc): Invoke mbfile_getc_normalized instead of mbfile_getc.
* gettext-tools/tests/testdata/crlf.pot: New file.
* gettext-tools/tests/msgcat-23: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Mon, 23 Dec 2024 16:54:38 +0000 (17:54 +0100)]
intl: Support the UTF-8 environment on native Windows.
Reported by Lasse Collin <lasse.collin@tukaani.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-12/msg00111.html>.
* gettext-runtime/intl/setlocale.c: Include <windows.h>.
(setlocale_unixlike): In the UTF-8 environment, append a suffix ".65001"
to the locale names passed to the native setlocale().
Bruno Haible [Mon, 23 Dec 2024 21:42:27 +0000 (22:42 +0100)]
libtextstyle: Fix a test failure on MSYS2.
* libtextstyle/gnulib-local/tests/test-term-ostream-xterm-msys2.out: New file.
* libtextstyle/gnulib-local/tests/test-term-ostream-xterm.sh: Use it as an
expected test result.
* libtextstyle/gnulib-local/modules/term-ostream-tests (Files): Add it.
* libtextstyle/Makefile.am (EXTRA_DIST): Likewise.
Bruno Haible [Mon, 23 Dec 2024 20:37:36 +0000 (21:37 +0100)]
examples: Don't fail build if rxgettext is not installed.
* gettext-tools/examples/po/xsmallpot.sh: Ignore a 'make' failure in the
hello-ruby example.
* gettext-tools/examples/po/hello-ruby.pot: New generated file.
Bruno Haible [Fri, 20 Dec 2024 14:56:48 +0000 (15:56 +0100)]
po: Remove a comment that is not valid any more since 2002-01-07.
The comment "Target 'all' must not depend on target '$(DOMAIN).pot-update'"
does not hold any more:
all <- all-yes <- $(srcdir)/stamp-po <- $(srcdir)/$(DOMAIN).pot
and the latter rule executes
$(MAKE) $(DOMAIN).pot-update
Bruno Haible [Wed, 18 Dec 2024 18:04:47 +0000 (19:04 +0100)]
New example 'hello-c++-gnome3'.
* gettext-tools/examples/hello-c++-gnome3: New directory, based on
gettext-tools/examples/hello-c-gnome3.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Update.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS,
SMALLPOFILES_FOR_lang): Update.
* gettext-tools/examples/README: Update.
* gettext-tools/examples/check-examples: Handle this directory as well.
* NEWS: Mention the new example.
* HACKING: Mention the gtkmm dependency.
Bruno Haible [Wed, 18 Dec 2024 10:14:29 +0000 (11:14 +0100)]
hello-c-gnome3: Add a simpler "hello world" program.
* gettext-tools/examples/hello-c-gnome3/README: New file.
* gettext-tools/examples/hello-c-gnome3/hello2.c: New file, based on
gettext-tools/examples/hello-c-gnome3/hello.c.
* gettext-tools/examples/hello-c-gnome3/hello2.desktop.in.in: New file, based on
gettext-tools/examples/hello-c-gnome3/hello.desktop.in.in.
* gettext-tools/examples/hello-c-gnome3/hello2.gresource.xml: New file, based on
gettext-tools/examples/hello-c-gnome3/hello.gresource.xml.
* gettext-tools/examples/hello-c-gnome3/hello2.ui: Renamed from
gettext-tools/examples/hello-c-gnome3/hello.ui.
* gettext-tools/examples/hello-c-gnome3/hello2.gschema.xml: New file, based on
gettext-tools/examples/hello-c-gnome3/hello.gschema.xml.
* gettext-tools/examples/hello-c-gnome3/hello.c: Greatly simplified.
* gettext-tools/examples/hello-c-gnome3/hello.ui: Use an <object> element
instead of a <template> element.
* gettext-tools/examples/hello-c-gnome3/hello.gschema.xml: Remove file.
* gettext-tools/examples/hello-c-gnome3/Makefile.am (bin_PROGRAMS): Add hello2.
(hello-resources.c): Renamed from resources.c.
(hello2_SOURCES): New variable.
(hello2-resources.c): New target.
(desktop_DATA): Add hello2.desktop.
(hello2.desktop.in, hello2.desktop): New targets.
(BUILT_SOURCES, CLEANFILES, MAINTAINERCLEANFILES): Update.
(EXTRA_DIST): Remove hello.gschema.xml. Add hello2.desktop.in.in,
hello2.desktop.in, hello2.gresource.xml, hello2.ui, hello2.gschema.xml.
* gettext-tools/examples/hello-c-gnome3/po/POTFILES.in: Update.
* gettext-tools/examples/hello-c-gnome3/autoclean.sh: Update.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES): Update.
* gettext-tools/examples/po/Makefile.am (POTFILES): Update.
Bruno Haible [Mon, 16 Dec 2024 10:27:14 +0000 (11:27 +0100)]
New example 'hello-ruby'.
* gettext-tools/examples/hello-ruby: New directory, based on
gettext-tools/examples/hello-php.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Update.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS,
SMALLPOFILES_FOR_lang): Update.
* gettext-tools/examples/README: Update.
* gettext-tools/examples/check-examples: Handle this directory as well.
* NEWS: Mention the new example.
Bruno Haible [Thu, 12 Dec 2024 10:34:26 +0000 (11:34 +0100)]
libtextstyle: Fix a gcc 13 -Wunused-result warning.
* libtextstyle/gnulib-local/lib/glib/gstrfuncs.c (g_strdup_vprintf): Don't
assume that vasprintf leaves the pointed-to variable unchanged when it fails.
Bruno Haible [Wed, 11 Dec 2024 20:31:35 +0000 (21:31 +0100)]
doc: Update list of dependencies.
* DEPENDENCIES: Add libattr.
* HACKING: Stop mentioning XEmacs. Add note regarding GNU Smalltalk.
Mention dotnet as alternative to Mono. Mention wxgtk version 3.2.