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.
Bruno Haible [Sat, 7 Dec 2024 09:50:58 +0000 (10:50 +0100)]
build: Include the Rules-* files at 'make' time, not at 'configure' time.
* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Don't splice in the Rules-* files
here.
* gettext-runtime/po/Makefile.in.in: Collect and include the Rules-* files
explicitly.
Bruno Haible [Fri, 6 Dec 2024 22:25:01 +0000 (23:25 +0100)]
build: No more need to rebuild a Makefile after POTFILES.in or LINGUAS changed.
* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Don't set or substitute
POMAKEFILEDEPS.
(AM_POSTPROCESS_PO_MAKEFILE): Remove dependency from Makefile on LINGUAS.
* gettext-runtime/po/Makefile.in.in (Makefile): Remove dependency on
@POMAKEFILEDEPS@.
Bruno Haible [Fri, 6 Dec 2024 20:35:08 +0000 (21:35 +0100)]
build: Read LINGUAS at 'make' time, not at 'configure' time.
* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Move the obsolete ALL_LINGUAS check.
Define DESIRED_LINGUAS. Don't compute ALL_LINGUAS, POFILES, UPDATEPOFILES,
DUMMYPOFILES, GMOFILES, INST_LINGUAS, CATALOGS any more.
(AM_POSTPROCESS_PO_MAKEFILE): Don't compute and substitute ALL_LINGUAS, POFILES,
UPDATEPOFILES, DUMMYPOFILES, GMOFILES, PROPERTIESFILES, CLASSFILES, QMFILES,
MSGFILES, RESOURCESDLLFILES, INST_LINGUAS, CATALOGS, JAVACATALOGS, QTCATALOGS,
TCLCATALOGS, CSHARPCATALOGS any more. Don't add rules for Tcl and C# catalogs
any more.
* gettext-runtime/po/Makefile.in.in (ALL_LINGUAS, POFILES, GMOFILES,
UPDATEPOFILES, DUMMYPOFILES): Define with a computed value.
(DESIRED_LINGUAS): New macro.
(INST_LINGUAS, CATALOGS): Define with a computed value.
* gettext-tools/examples/po/Makefile.am (ALL_LINGUAS, POFILES, UPDATEPOFILES,
DUMMYPOFILES): Define with a computed value.
* gettext-tools/examples/hello-*/po/Makefile.am (ALL_LINGUAS, POFILES, GMOFILES,
UPDATEPOFILES, DUMMYPOFILES): Define with a computed value.
(DESIRED_LINGUAS): New macro.
(INST_LINGUAS, CATALOGS): Define with a computed value.
* gettext-tools/examples/hello-csharp*/po/Makefile.am (ALL_LINGUAS, POFILES,
UPDATEPOFILES, DUMMYPOFILES, RESOURCESDLLFILES): Define with a computed value.
Include .csharp-rules.
(DESIRED_LINGUAS): New macro.
(INST_LINGUAS, CATALOGS): Define with a computed value.
(DISTCLEANFILES): New variable.
* gettext-tools/examples/hello-tcl*/po/Makefile.am (ALL_LINGUAS, POFILES,
UPDATEPOFILES, DUMMYPOFILES, MSGFILES): Define with a computed value.
Include .tcl-rules.
(DESIRED_LINGUAS): New macro.
(INST_LINGUAS, CATALOGS): Define with a computed value.
(DISTCLEANFILES): New variable.
Bruno Haible [Fri, 6 Dec 2024 10:37:04 +0000 (11:37 +0100)]
build: Read POTFILES.in at 'make' time, not at 'configure' time.
* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Bump GETTEXT_MACRO_VERSION to 0.24.
Don't create POTFILES any more.
(AM_POSTPROCESS_PO_MAKEFILE): Don't substitute POTFILES_DEPS any more.
* gettext-runtime/po/Makefile.in.in (GETTEXT_MACRO_VERSION): Bump to 0.24.
Mention 'make' requirements.
(POTFILES, POTFILES_DEPS): Define with a computed value.
($(DOMAIN).pot-update): Depend on POTFILES_DEPS, not POTFILES.
(distclean): Don't remove POTFILES any more.
* gettext-tools/examples/README: Mention 'make' requirements.
* gettext-tools/examples/po/Makefile.am (POTFILES_DEPS): Define with a computed
value.
* gettext-tools/examples/hello-*/po/Makefile.am (POTFILES_DEPS): Likewise.
Bruno Haible [Tue, 3 Dec 2024 17:19:15 +0000 (18:19 +0100)]
Refactor: Use 'const' in a few more places.
* gnulib-local/lib/mem-hash-map.h (hash_find_entry): Mark htab as a 'const' pointer.
* gnulib-local/lib/mem-hash-map.c (lookup, hash_find_entry): Likewise.
* gettext-tools/src/message.h (message_list_search): Mark mlp as a 'const' pointer.
* gettext-tools/src/message.c (message_list_search): Likewise.
* gettext-tools/src/msgl-ascii.h (is_ascii_string_list): Mark slp as a 'const' pointer.
(is_ascii_message): Mark mp as a 'const' pointer.
(is_ascii_message_list): Mark mlp as a 'const' pointer.
(is_ascii_msgdomain_list): Mark mdlp as a 'const' pointer.
* gettext-tools/src/msgl-ascii.c (is_ascii_string_list): Mark slp as a 'const' pointer.
(is_ascii_message): Mark mp as a 'const' pointer.
(is_ascii_message_list): Mark mlp as a 'const' pointer.
(is_ascii_msgdomain_list): Mark mdlp as a 'const' pointer.
* gettext-tools/src/msgl-ofn.h (message_has_filenames_with_spaces): Mark mp as a 'const' pointer.
(message_list_has_filenames_with_spaces): Mark mlp as a 'const' pointer.
(msgdomain_list_has_filenames_with_spaces): Mark mdlp as a 'const' pointer.
* gettext-tools/src/msgl-ofn.c (message_has_filenames_with_spaces): Mark mp as a 'const' pointer.
(message_list_has_filenames_with_spaces): Mark mlp as a 'const' pointer.
(msgdomain_list_has_filenames_with_spaces): Mark mdlp as a 'const' pointer.
* gettext-tools/src/msgl-check.h (check_message_list): Mark mlp as a 'const' pointer.
* gettext-tools/src/msgl-check.c (check_plural, check_message_list): Likewise.
Bruno Haible [Mon, 2 Dec 2024 11:07:49 +0000 (12:07 +0100)]
examples: Update hello-c++20 to work with g++ >= 14 and clang++ >= 19.
* gettext-tools/examples/hello-c++20/configure.ac: Support newer C++ versions.
Try option -std=gnu++26, necessary for newer C++ versions.
* gettext-tools/examples/hello-c++20/hello.cc (main): Use different code in
newer C++.
Bruno Haible [Sun, 1 Dec 2024 09:46:36 +0000 (10:46 +0100)]
Update translations from TP.
* gettext-runtime/po/*.po: Update from TP.
* gettext-tools/po/*.po: Update from TP.
* gettext-tools/po/LINGUAS: Add ka.
* gettext-tools/examples/po/*.po: Update from TP.