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.
Bruno Haible [Sun, 1 Dec 2024 07:40:52 +0000 (08:40 +0100)]
xgettext: C: Revisit "hexadecimal escape sequence out of range" warnings.
Reported by Vaclav Slavik <vaclav@slavik.io>
at <https://savannah.gnu.org/bugs/?65053>.
* gettext-tools/src/x-c.c (get_string_element): Add context argument. Don't warn
for character literals. For wide strings, use a different warning and complain
about "out of range" only for values >= 0x110000.
(phase5_get): Distinguish normal string literals and wide string literals.
Bruno Haible [Sat, 30 Nov 2024 08:41:21 +0000 (09:41 +0100)]
intl: Fix lang-c++ failure on MSVC, caused by last commit.
* gettext-runtime/intl/libgnuintl.in.h (_INTL_HAS_FORCE_INLINE,
_INTL_FORCE_INLINE): New macros.
(_INTL_REDIRECT_INLINE): Don't define in C++ mode when _INTL_HAS_FORCE_INLINE
is not set.
Bruno Haible [Thu, 28 Nov 2024 19:22:47 +0000 (20:22 +0100)]
intl: Avoid conflict between libintl.h and some C++ header files.
Reported Pierre Ossman <ossman@cendio.se>
at <https://savannah.gnu.org/bugs/?64006>.
* gettext-runtime/intl/libgnuintl.in.h (*printf, newlocale, duplocale,
freelocale, setlocale): Use _INTL_REDIRECT_INLINE or _INTL_ASM as alternatives
to _INTL_REDIRECT_MACROS, avoiding conflicts with inline functions in mingw
and MSVC <stdio.h>.
Bruno Haible [Thu, 28 Nov 2024 12:56:16 +0000 (13:56 +0100)]
intl: Avoid possible error from libintl.h in C++ mode.
* gettext-runtime/intl/libgnuintl.in.h (gettext, dgettext, dcgettext, ngettext,
dngettext, dcngettext, textdomain, bindtextdomain, wbindtextdomain,
bind_textdomain_codeset): In the _INTL_REDIRECT_INLINE redirects, in C++ mode,
avoid a compilation error if the function is globally declared in some .h file.
Bruno Haible [Wed, 27 Nov 2024 10:40:31 +0000 (11:40 +0100)]
Add installation information for the tarball users and from a git checkout.
We want to have an INSTALL file that contains installation instructions for
the tarball users. These instructions are necessarily package specific,
because they need to list the prerequisites or reference the DEPENDENCIES
file.
Additionally, many people who are not aware that tarballs are the primary
means for source code distribution of GNU packages check out the git repository
and then expect to see instructions for installing from that git checkout
in the INSTALL file. See e.g. <https://savannah.gnu.org/bugs/?62196>.
Unfortunately, both Automake (with strictness option = 'gnu') and 'bootstrap'
both contain code to copy the generic (not package specific) installation
instructions to the file 'INSTALL'. This is not what we want, so we disable
it. (Other packages handle this issue by putting part of the installation
instructions into the README file. This is suboptimal, because this is not
what the README file is for.)
* autogen.sh: Import INSTALL.generic from gnulib.
* INSTALL: Entirely rewritten, based on poke/INSTALL.
* Makefile.am (EXTRA_DIST): Add INSTALL.generic.
* libtextstyle/autogen.sh: Import INSTALL.generic from gnulib.
* libtextstyle/INSTALL: Entirely rewritten, based on poke/INSTALL.
* libtextstyle/Makefile.am (EXTRA_DIST): Add INSTALL.generic.
Bruno Haible [Tue, 19 Nov 2024 18:11:18 +0000 (19:11 +0100)]
doc: Use GNU coding style in man pages.
Reported by наб <nabijaczleweli@nabijaczleweli.xyz> in
<https://lists.gnu.org/archive/html/bug-gettext/2022-01/msg00019.html>.
* gettext-runtime/man/gettext.3.in: In C code snippets, put a space before '('
and after ','.
* gettext-runtime/man/bind_textdomain_codeset.3.in: Likewise.