]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
8 months agoUpdate to the newest gnulib.
Bruno Haible [Sun, 8 Dec 2024 17:46:26 +0000 (18:46 +0100)] 
Update to the newest gnulib.

8 months agobuild: Include the Rules-* files at 'make' time, not at 'configure' time.
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.

8 months agopo: Support more than 3 Rules-* extensions.
Bruno Haible [Sat, 7 Dec 2024 08:43:48 +0000 (09:43 +0100)] 
po: Support more than 3 Rules-* extensions.

* gettext-runtime/po/Makefile.in.in (DISTFILES.common): Add placeholders for
extensions 4..6.
(DISTFILES): Likewise.

8 months agobuild: Include Makevars at 'make' time, not at 'configure' time.
Bruno Haible [Sat, 7 Dec 2024 08:40:00 +0000 (09:40 +0100)] 
build: Include Makevars at 'make' time, not at 'configure' time.

* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Don't splice in Makevars here.
* gettext-runtime/po/Makefile.in.in: Include Makevars explicitly.

8 months agobuild: No more need to rebuild a Makefile after POTFILES.in or LINGUAS changed.
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@.

8 months agobuild: Read LINGUAS at 'make' time, not at 'configure' time.
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.

8 months agobuild: Read POTFILES.in at 'make' time, not at 'configure' time.
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.

8 months agoexamples: hello-python: Make it work with Python 3.
Bruno Haible [Fri, 6 Dec 2024 10:48:36 +0000 (11:48 +0100)] 
examples: hello-python: Make it work with Python 3.

* gettext-tools/examples/hello-python/hello.py.in: Add parenthese around print's
arguments.

8 months agobuild: Remove left-overs from remove-potcdate.sin.
Bruno Haible [Fri, 6 Dec 2024 08:31:47 +0000 (09:31 +0100)] 
build: Remove left-overs from remove-potcdate.sin.

* gettext-runtime/po/Makefile.in.in (.SUFFIXES): Remove '.sed'.
* gettext-tools/examples/po/Makefile.am (.SUFFIXES): Remove '.sed' and '.sin'.
(.sin.sed): Remove rule.
* gettext-tools/examples/hello-*/po/Makefile.am: Likewise.

8 months agointl: Fix a gcc 14 -Wmissing-variable-declarations warning.
Bruno Haible [Wed, 4 Dec 2024 08:26:15 +0000 (09:26 +0100)] 
intl: Fix a gcc 14 -Wmissing-variable-declarations warning.

* gettext-runtime/intl/gettextP.h (_nl_state_lock): New declaration.
* gettext-runtime/intl/bindtextdom.c (_nl_state_lock): Remove declaration.
* gettext-runtime/intl/textdomain.c (_nl_state_lock): Remove declaration.

8 months agoRefactor: Fix some gcc 14 -Wshadow warnings.
Bruno Haible [Wed, 4 Dec 2024 08:09:23 +0000 (09:09 +0100)] 
Refactor: Fix some gcc 14 -Wshadow warnings.

* gettext-tools/src/x-c.c (phase5_get): Rename some local variables.
* gettext-tools/src/x-php.c (phase4_get): Likewise.

8 months agoRefactor: Use 'const' in a few more places.
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.

8 months agoUpdate packaging instructions.
Bruno Haible [Tue, 3 Dec 2024 13:46:32 +0000 (14:46 +0100)] 
Update packaging instructions.

* PACKAGING: Update file list. Update C# explanations.

8 months agoUse a warranty disclaimer in all-permissive license notices.
Bruno Haible [Mon, 2 Dec 2024 21:20:01 +0000 (22:20 +0100)] 
Use a warranty disclaimer in all-permissive license notices.

* gnulib-local/m4/*.m4: Update.
* libtextstyle/gnulib-local/m4/*.m4: Update.
* gettext-runtime/m4/*.m4: Update.
* gettext-tools/m4/*.m4: Update.
* m4/woe32-dll.m4: Update.

8 months agotests: Add lang-c++26 test.
Bruno Haible [Mon, 2 Dec 2024 11:10:43 +0000 (12:10 +0100)] 
tests: Add lang-c++26 test.

* gettext-tools/tests/lang-c++26: New file, based on
gettext-tools/tests/lang-c++20.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

8 months agotests: Fix lang-c++20 failure with g++ >= 14 or clang++ >= 19.
Bruno Haible [Mon, 2 Dec 2024 11:09:40 +0000 (12:09 +0100)] 
tests: Fix lang-c++20 failure with g++ >= 14 or clang++ >= 19.

* gettext-tools/tests/lang-c++20: Support newer C++ versions. Try option
-std=gnu++26, necessary for newer C++ versions.

8 months agoexamples: Update hello-c++20 to work with g++ >= 14 and clang++ >= 19.
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++.

8 months agoFix compilation error with libxml2 >= 2.12.0 and gcc >= 14.
Bruno Haible [Sun, 1 Dec 2024 18:35:51 +0000 (19:35 +0100)] 
Fix compilation error with libxml2 >= 2.12.0 and gcc >= 14.

Reported by Sam James <sam@gentoo.org>
at <https://savannah.gnu.org/bugs/?66506>.

* gettext-tools/src/its.c: Include <libxml/xmlversion.h>.
(structured_error): Adapt to API change.

8 months agoUpdate NEWS.
Bruno Haible [Sun, 1 Dec 2024 13:55:30 +0000 (14:55 +0100)] 
Update NEWS.

* NEWS: Move an entry.

8 months agoRelease 0.23 v0.23
Bruno Haible [Sun, 1 Dec 2024 11:34:55 +0000 (12:34 +0100)] 
Release 0.23

8 months agoexamples: Use infrastructure from gettext version 0.23.
Bruno Haible [Sun, 1 Dec 2024 11:31:10 +0000 (12:31 +0100)] 
examples: Use infrastructure from gettext version 0.23.

* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 0.23.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.
* gettext-tools/examples/hello-*/m4/Makefile.am: Update .m4 file list.

8 months agoUpdate translations from TP.
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.

8 months agoPrepare for 0.23 release.
Bruno Haible [Sun, 1 Dec 2024 09:39:52 +0000 (10:39 +0100)] 
Prepare for 0.23 release.

* gettext-runtime/doc/matrix.texi: Update from TP.
* gettext-runtime/doc/nls.texi (STATUS): Update.
* gettext-runtime/po/Makefile.in.in: Bump Origin version and
GETTEXT_MACRO_VERSION.
* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Bump GETTEXT_MACRO_VERSION
accordingly.
* gettext-runtime/m4/gettext.m4: Update comments.
* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* libtextstyle/version.sh: Update VERSION_NUMBER, RELEASE_DATE.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* gettext-runtime/intl/Makefile.am (LTV_*): Bump to 12:1:4.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 2:2:2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:11:5.
* 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-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/msgunfmt.c (main): Likewise.
* gettext-tools/src/msguniq.c (main): Likewise.
* gettext-tools/src/recode-sr-latin.c (main): Likewise.
* gettext-tools/src/urlget.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* gettext-tools/misc/convert-archive.in (func_version): Likewise.
* gettext-tools/misc/gettextize.in (func_version): Likewise.
* gettext-tools/misc/autopoint.in: Likewise. Accept version 0.23.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.23.
* NEWS, gettext-runtime/NEWS: Update.

8 months agoUpdate after gnulib changed.
Bruno Haible [Sun, 1 Dec 2024 07:54:06 +0000 (08:54 +0100)] 
Update after gnulib changed.

8 months agoUpdate to the newest gnulib.
Bruno Haible [Sun, 1 Dec 2024 07:50:00 +0000 (08:50 +0100)] 
Update to the newest gnulib.

8 months agoxgettext: C: Revisit "hexadecimal escape sequence out of range" warnings.
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.

8 months agointl: Fix lang-c++ failure on MSVC, caused by last commit.
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.

8 months agointl: Avoid conflict between libintl.h and some C++ header files.
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>.

8 months agointl: Avoid possible error from libintl.h in C++ mode.
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.

8 months agodoc: Avoid @table, as it cannot be used to produce decent-looking output.
Bruno Haible [Wed, 27 Nov 2024 21:22:41 +0000 (22:22 +0100)] 
doc: Avoid @table, as it cannot be used to produce decent-looking output.

8 months agodoc: Mention C.UTF-8 locale.
Bruno Haible [Wed, 27 Nov 2024 11:56:07 +0000 (12:56 +0100)] 
doc: Mention C.UTF-8 locale.

Reported by nl6720 at <https://savannah.gnu.org/bugs/?62815>.

* gettext-tools/doc/gettext.texi (Locale Names): Mention the C.UTF-8 locale.

8 months agoAdd installation information for the tarball users and from a git checkout.
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.

8 months agolang-perl-*: Avoid FAIL on macOS.
Bruno Haible [Tue, 26 Nov 2024 23:57:00 +0000 (00:57 +0100)] 
lang-perl-*: Avoid FAIL on macOS.

Reported by Hanspeter Niederstrasser <nieder@users.sourceforge.net>
at <https://savannah.gnu.org/bugs/?66461>.

* gettext-tools/tests/lang-perl-1: On macOS, don't test the ISO-8859-1 locale.
* gettext-tools/tests/lang-perl-2: Likewise.

8 months agoFix compilation error when pgettext is used.
Bruno Haible [Sun, 24 Nov 2024 14:16:06 +0000 (15:16 +0100)] 
Fix compilation error when pgettext is used.

Reported by Friedrich Beckmann <friedrich.beckmann@posteo.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00189.html>.

* gnulib-local/lib/gettext.h: Include <locale.h>.

8 months agoUpgrade to libtool 2.5.4.
Bruno Haible [Fri, 22 Nov 2024 18:20:39 +0000 (19:20 +0100)] 
Upgrade to libtool 2.5.4.

* m4/libtool.m4: Update from libtool-2.5.4.
* m4/ltversion.m4: Likewise.
* build-aux/ltmain.sh: Likewise.

8 months agopo: Fix build failure with parallel make.
Bruno Haible [Tue, 19 Nov 2024 19:07:32 +0000 (20:07 +0100)] 
po: Fix build failure with parallel make.

Reported by Lubomir Rintel <lkundrak@v3.sk> in
<https://lists.gnu.org/archive/html/bug-gettext/2022-06/msg00022.html>.

* gettext-runtime/po/Makefile.in.in (.NOTPARALLEL): Add this special target.

8 months agodoc: Improve typography in man pages.
Bruno Haible [Tue, 19 Nov 2024 18:18:44 +0000 (19:18 +0100)] 
doc: Improve typography in man pages.

Patch by наб <nabijaczleweli@nabijaczleweli.xyz> in
<https://lists.gnu.org/archive/html/bug-gettext/2022-01/msg00019.html>.

* gettext-runtime/man/bind_textdomain_codeset.3.in: After "e.g." or "i.e.",
use \&.

8 months agodoc: Use GNU coding style in man pages.
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.

8 months agoxgettext: PHP: Stop recognizing ASP tags <% and %> (removed in PHP 7.0).
Bruno Haible [Tue, 19 Nov 2024 17:03:45 +0000 (18:03 +0100)] 
xgettext: PHP: Stop recognizing ASP tags <% and %> (removed in PHP 7.0).

Reported by David Robinson <dave@netterra.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2021-10/msg00000.html>.

* gettext-tools/src/x-php.c (skip_html): Don't recognize '<%' and '<%='
any more.
(phase2_getc, phase3_getc, phase4_get): In comments, don't treat '%>' like '?>'
any more.

8 months agolibgettextpo: Extend the function po_message_set_format.
Bruno Haible [Tue, 19 Nov 2024 15:26:45 +0000 (16:26 +0100)] 
libgettextpo: Extend the function po_message_set_format.

Reported by Alexander Potashev <aspotashev@gmail.com>
at <https://savannah.gnu.org/bugs/?61160>.

* gettext-tools/libgettextpo/gettext-po.c (po_message_set_format): Support a
negative value.
* gettext-tools/libgettextpo/gettext-po.in.h (po_message_set_format): Mention
effects of po_message_set_format (..., -1).
* gettext-tools/doc/gettext.texi (po_message_t API): Likewise.
* NEWS: Mention the change.

8 months agoImprove comments.
Bruno Haible [Tue, 19 Nov 2024 08:47:35 +0000 (09:47 +0100)] 
Improve comments.

* gettext-tools/src/locating-rules.h (locating_rule_list_locate): Improve
specification.
* gettext-tools/src/sentence.h (sentence_end): Likewise.

8 months agoAvoid undefined behaviour.
Bruno Haible [Tue, 19 Nov 2024 08:47:14 +0000 (09:47 +0100)] 
Avoid undefined behaviour.

* gettext-tools/src/quote.h (scan_quoted): Add comment. Avoid undefined
behaviour if length==0.

9 months agoFix "gcc -Wzero-as-null-pointer-constant" warnings.
Bruno Haible [Sat, 16 Nov 2024 06:51:24 +0000 (07:51 +0100)] 
Fix "gcc -Wzero-as-null-pointer-constant" warnings.

* libtextstyle/gnulib-local/lib/libcroco/cr-enc-handler.c (gv_default_aliases):
Use NULL, not 0, to denote a null pointer.
* libtextstyle/gnulib-local/lib/libcroco/cr-om-parser.c
(cr_om_parser_parse_paths_to_cascade): Likewise.
* gettext-tools/libgrep/kwset.c (kwsalloc, kwsincr, kwsprep, cwexec, kwsexec):
Likewise.

9 months agoRefactor.
Bruno Haible [Fri, 8 Nov 2024 15:00:04 +0000 (16:00 +0100)] 
Refactor.

* gettext-tools/src/cldr-plural-exp.c: Don't include <unistd.h>, unistr.h.
* gettext-tools/src/cldr-plural.y: Don't include <unistd.h>.

9 months agoRefactor.
Bruno Haible [Fri, 8 Nov 2024 14:54:46 +0000 (15:54 +0100)] 
Refactor.

* gettext-tools/src/cldr-plural.y: Untabify.
(struct cldr_plural_parse_args): New type, moved here from
gettext-tools/src/cldr-plural-exp.h.
(cldr_plural_parse): New function, moved here from
gettext-tools/src/cldr-plural-exp.c.
* gettext-tools/src/cldr-plural-exp.h: Reorder declarations.
(struct cldr_plural_parse_args): Remove declaration.
* gettext-tools/src/cldr-plural-exp.c: Don't include cldr-plural.h. Reorder
functions.
(cldr_plural_parse): Remove function.

9 months agoUpdate the GFDL text.
Bruno Haible [Thu, 7 Nov 2024 09:16:51 +0000 (10:16 +0100)] 
Update the GFDL text.

* libtextstyle/doc/fdl.texi: Update from gnulib/doc/fdl-1.3.texi.

9 months agoUpgrade from GFDL 1.2 to GFDL 1.3.
Bruno Haible [Thu, 7 Nov 2024 09:16:36 +0000 (10:16 +0100)] 
Upgrade from GFDL 1.2 to GFDL 1.3.

* gettext-runtime/libasprintf/fdl.texi: Update from gnulib/doc/fdl-1.3.texi.
* gettext-tools/doc/fdl.texi: Likewise.
* gettext-runtime/libasprintf/autosprintf.texi: Update reference.
* gettext-tools/doc/gettext.texi: Likewise.

9 months agoUpdate the GPL and LGPL text.
Bruno Haible [Thu, 7 Nov 2024 08:43:44 +0000 (09:43 +0100)] 
Update the GPL and LGPL text.

* gettext-runtime/intl/COPYING.LIB: Update from
<https://ftp.gnu.org/gnu/Licenses/lgpl-2.1.txt>.
* gettext-runtime/libasprintf/COPYING.LIB: Likewise.
* gettext-runtime/libasprintf/gpl.texi: Update from gnulib/doc/gpl-2.0.texi.
* gettext-runtime/libasprintf/lgpl.texi: Update from gnulib/doc/lgpl-2.1.texi.
* gettext-tools/doc/gpl.texi: Update from gnulib/doc/gpl-2.0.texi.
* gettext-tools/doc/lgpl.texi: Update from gnulib/doc/lgpl-2.1.texi.

9 months agobuild: Fix "make distcheck" after the line-breaking algorithm changed, part 2.
Bruno Haible [Wed, 6 Nov 2024 19:41:29 +0000 (20:41 +0100)] 
build: Fix "make distcheck" after the line-breaking algorithm changed, part 2.

* gettext-tools/configure.ac (MSGMERGE): Test $cross_compiling, since
$CROSS_COMPILING is not set at this point.

9 months agoUpdate legally relevant info.
Bruno Haible [Mon, 28 Oct 2024 19:13:38 +0000 (20:13 +0100)] 
Update legally relevant info.

* AUTHORS: Incorporate records from gnu.org:/gd/gnuorg/copyright.list.

9 months agodoc: Improve usability of generated PDF.
Bruno Haible [Mon, 28 Oct 2024 11:53:05 +0000 (12:53 +0100)] 
doc: Improve usability of generated PDF.

* gettext-tools/doc/gettext.texi: Use a brown colour for interactive links.

9 months agobuild: Fix "make distcheck" failure (regression 2024-10-23).
Bruno Haible [Fri, 25 Oct 2024 07:56:29 +0000 (09:56 +0200)] 
build: Fix "make distcheck" failure (regression 2024-10-23).

* check-copyright-headers (func_check_file): Update after DISCLAIM was renamed.

9 months agodoc: Add some words about dialects.
Bruno Haible [Thu, 24 Oct 2024 11:40:20 +0000 (13:40 +0200)] 
doc: Add some words about dialects.

Reported by John Cowan <cowan@ccil.org>
at <https://savannah.gnu.org/bugs/?47838>.

* gettext-tools/doc/gettext.texi (The LANGUAGE variable): Add a paragraph
about Chinese.
(Dialects): New section.

9 months agodoc: Tweaks.
Bruno Haible [Wed, 23 Oct 2024 19:27:58 +0000 (21:27 +0200)] 
doc: Tweaks.

* gettext-tools/doc/gettext.texi (Responsibilities): Tweaks, from
Benno Schulenberg.

9 months agodoc: Revise "Translators" chapter.
Bruno Haible [Wed, 23 Oct 2024 11:06:34 +0000 (13:06 +0200)] 
doc: Revise "Translators" chapter.

* gettext-tools/doc/gettext.texi (Trans Intro 0, Trans Intro 1, Discussions,
Organization, Information Flow): Remove sections.
(Organization, Responsibilities): New sections.

9 months agoRename and distribute the disclaimer file.
Bruno Haible [Wed, 23 Oct 2024 11:27:58 +0000 (13:27 +0200)] 
Rename and distribute the disclaimer file.

* gettext-tools/misc/disclaim-translations.txt: Renamed from
gettext-tools/misc/DISCLAIM.
* gettext-tools/Makefile.am (EXTRA_DIST): Update.
(pkgdata_DATA): New variable.

9 months agobuild: Simplify.
Bruno Haible [Wed, 23 Oct 2024 11:27:07 +0000 (13:27 +0200)] 
build: Simplify.

* gettext-tools/Makefile.am (gettextsrcdir): Remove variable.
(pkgdata_SCRIPTS): Renamed from gettextsrc_SCRIPTS.

9 months agoFix test failure of autopoint-3 on Cygwin.
Bruno Haible [Wed, 23 Oct 2024 07:59:49 +0000 (09:59 +0200)] 
Fix test failure of autopoint-3 on Cygwin.

It was broken since commit "tests: Use libtool in autopoint-3 test" (2014-09-05):
The Makefile specified to link the 'hello' program without libtool
(and thus Automake generated a direct link command without libtool),
but the LDADD variable used @LTLIBINTL@. On Cygwin, this led to a use of
the -R option, which the compiler does not understand:
x86_64-pc-cygwin-gcc: error: unrecognized command line option ‘-R’; did you mean ‘-R’?

* gettext-tools/tests/autopoint-3: Don't invoke LT_INIT. Use @LIBINTL@,
not @LTLIBINTL@. Don't touch ltmain.sh.

9 months agoImprove handling of Windows DLL directories when executing programs.
Bruno Haible [Wed, 23 Oct 2024 07:39:50 +0000 (09:39 +0200)] 
Improve handling of Windows DLL directories when executing programs.

Reported by Michele Locati <mlocati@gmail.com>
at <https://savannah.gnu.org/bugs/?66356>.

Revert commit e2839b591c from 2019-05-01. Instead, use gnulib's new feature.

* gettext-tools/src/Makefile.am (DEFS): Define BINDIR.
* gettext-tools/src/msginit.c: Don't include configmake.h.
(main): Don't add BINDIR to PATH globally.
(get_user_email, language_team_address, plural_forms): Pass a dll_dirs argument
to create_pipe_in.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Remove configmake.

9 months agoUpdate after gnulib changed.
Bruno Haible [Tue, 22 Oct 2024 20:24:44 +0000 (22:24 +0200)] 
Update after gnulib changed.

* gettext-tools/src/msgexec.c (process_string): Update create_pipe_out
invocation.
* gettext-tools/src/write-resources.c (execute_writing_input): Likewise.
* gettext-tools/src/msginit.c (project_id, project_id_version, get_user_email,
language_team_address, plural_forms): Update create_pipe_in invocations.
* gettext-tools/src/read-csharp.c (execute_and_read_po_output): Likewise.
* gettext-tools/src/read-java.c (execute_and_read_po_output): Likewise.
* gettext-tools/src/read-resources.c (execute_and_read_po_output): Likewise.
* gettext-tools/src/read-tcl.c (msgdomain_read_tcl): Likewise.
* gettext-tools/src/x-ruby.c (extract_ruby): Likewise.
* gettext-tools/src/urlget.c (execute_it, fetch): Update execute invocations.

9 months agoUpdate to the newest gnulib.
Bruno Haible [Tue, 22 Oct 2024 20:16:51 +0000 (22:16 +0200)] 
Update to the newest gnulib.

9 months agoUpdate the translation disclaimer.
Bruno Haible [Tue, 22 Oct 2024 10:33:35 +0000 (12:33 +0200)] 
Update the translation disclaimer.

From Craig Topham <copyright-clerk@fsf.org>.

* gettext-tools/misc/DISCLAIM: Update.

9 months agodoc: Update after Automake changed.
Bruno Haible [Sun, 20 Oct 2024 22:46:53 +0000 (00:46 +0200)] 
doc: Update after Automake changed.

* gettext-tools/doc/gettextize.texi: Update now that Automake with option 'gnu'
no longer requires ABOUT-NLS. Cf.
<https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=a2def8cdef>.

9 months agodoc: Add an example regarding xgettext.
Bruno Haible [Fri, 18 Oct 2024 17:19:38 +0000 (19:19 +0200)] 
doc: Add an example regarding xgettext.

Reported by Andrea G. Monaco <andrea.monaco@autistici.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2020-12/msg00036.html>.

* gettext-tools/doc/xgettext.texi: Add an example.

9 months agoxgettext: Python: Add test for warning that was broken in 0.21.x and 0.22.x.
Bruno Haible [Thu, 17 Oct 2024 23:16:12 +0000 (01:16 +0200)] 
xgettext: Python: Add test for warning that was broken in 0.21.x and 0.22.x.

Reported by Max Smolens <msmolens@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2020-10/msg00001.html>.

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

9 months agodoc: Clarify locale names and language names.
Bruno Haible [Thu, 17 Oct 2024 21:53:17 +0000 (23:53 +0200)] 
doc: Clarify locale names and language names.

Reported by Arfrever <arfrever.fta@gmail.com>
at <https://savannah.gnu.org/bugs/?59062>.

* gettext-runtime/doc/nls.texi (INSTALL Matters, Using This Package): Mention
ll_CC as alterntive to ll, and that ll can be a 3-letter code.
* gettext-tools/doc/gettext.texi (Locale Names, Header Entry, Installers):
Likewise.

10 months agointl: Fix a memory leak.
Bruno Haible [Tue, 15 Oct 2024 19:52:30 +0000 (21:52 +0200)] 
intl: Fix a memory leak.

* gettext-runtime/intl/finddomain.c (_nl_find_domain): If there was an alias and
_nl_explode_name or _nl_make_l10nflist fails, free the allocated memory. Avoid
'goto'.

10 months agogettext.h: Avoid "warning: ISO C++ forbids variable length array" with -pedantic.
Bruno Haible [Tue, 15 Oct 2024 14:49:13 +0000 (16:49 +0200)] 
gettext.h: Avoid "warning: ISO C++ forbids variable length array" with -pedantic.

Both "g++ -pedantic" and "clang++ -pedantic" warn about use of VLAs.
Since we cannot distinguish "g++" from "g++ -pedantic" through a preprocessor
macro, it's best to not use a VLA in C++.

Reported by Jens Seidel <jensseidel@users.sf.net>
via <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547798>
at <https://savannah.gnu.org/bugs/index.php?55149>.

* gnulib-local/lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Define
to 0 in C++ mode.

10 months agomsgen: Convert charset=CHARSET to charset=ASCII.
Bruno Haible [Tue, 15 Oct 2024 14:04:45 +0000 (16:04 +0200)] 
msgen: Convert charset=CHARSET to charset=ASCII.

Reported at <https://savannah.gnu.org/bugs/index.php?20923>.

* gettext-tools/src/msgen.c: Include msgl-ascii.h, c-strstr.h, xalloc.h.
(fill_header): New function, based on fill_header in msginit.c.
(main): Invoke it.
* gettext-tools/tests/msgen-1: Provide as input a POT file with charset=CHARSET,
and verify that the output has charset=ASCII.

10 months agoRefactor.
Bruno Haible [Tue, 15 Oct 2024 13:42:46 +0000 (15:42 +0200)] 
Refactor.

* gettext-tools/src/msgl-header.h (header_set_charset): New declaration.
* gettext-tools/src/msgl-header.c (header_set_charset): New function.
* gettext-tools/src/msgl-iconv.c: Include msgl-header.h.
(iconv_message_list_internal): Use header_set_charset.
* gettext-tools/src/x-po.c: Include msgl-header.h.
(extract): Use header_set_charset.
* gettext-tools/src/FILES: Update.

10 months agoits: Add ability to check *.its and *.loc files with XML Schema 1.1.
Bruno Haible [Tue, 15 Oct 2024 00:37:28 +0000 (02:37 +0200)] 
its: Add ability to check *.its and *.loc files with XML Schema 1.1.

* gettext-tools/src/its.xsd10: Renamed from gettext-tools/src/its.xsd.
(RulesType): Enumerate all possible rules in the ITS namespace, instead of using
a wildcard.
(OtherRuleType): New element.
* gettext-tools/src/its.xsd11: Copied from gettext-tools/src/its.xsd.
(LocNoteRuleType): Enable assertion.
* gettext-tools/src/locating-rules.xsd10: Renamed from
gettext-tools/src/locating-rules.xsd.
* gettext-tools/src/locating-rules.xsd11: Copied from
gettext-tools/src/locating-rules.xsd.
(LocatingRuleType): Enable assertion.
* gettext-tools/src/Makefile.am (schema_DATA): Add its.xsd10, its.xsd11,
locating-rules.xsd10, locating-rules.xsd11. Remove its.xsd, locating-rules.xsd.
* gettext-tools/build-aux/xml-validate-10.in: New file.
* gettext-tools/build-aux/xml-validate-11.in: New file.
* gettext-tools/configure.ac: Substitute HAVE_JAVAEXEC.
(AC_CONFIG_FILES): Create build-aux/xml-validate-10, build-aux/xml-validate-11.
* gettext-tools/Makefile.am (DISTCLEANFILES): Add build-aux/xml-validate-10,
build-aux/xml-validate-11.
* gettext-tools/its/Makefile.am: Revert last commit.
(check-local): Check each file both using the XML Schema 1.0 and the XML Schema
1.1.
* gettext-tools/doc/gettext.texi (ITS Rules): Mention the two versions of
its.xsd.
(Location Rules): Mention the two versions of locating-rules.xsd.
* HACKING: Mention Xerces2-J.

10 months agoits: Work around xmllint bug.
Bruno Haible [Mon, 14 Oct 2024 15:24:52 +0000 (17:24 +0200)] 
its: Work around xmllint bug.

* gettext-tools/its/Makefile.am (check-local): Skip the ITS_FILES checks if
xmllint cannot grok the its.xsd schema.

10 months agopo: Add a copyright and license notice to the Rules-quot auxiliary files.
Bruno Haible [Sun, 13 Oct 2024 23:41:49 +0000 (01:41 +0200)] 
po: Add a copyright and license notice to the Rules-quot auxiliary files.

Reported by Joël Krähemann <jkraehemann@gmail.com>
at <https://savannah.gnu.org/bugs/?57973>.

* gettext-runtime/po/quot.sed: Add a copyright and all-permissive license
notice.
* gettext-runtime/po/boldquot.sed: Likewise.
* gettext-runtime/po/en@quot.header: Likewise.
* gettext-runtime/po/en@boldquot.header: Likewise.
* gettext-runtime/po/insert-header.sed: Use an all-permissive license notice.
* gettext-runtime/po/Rules-quot: Likewise.
(.insert-header.po-update-en): After running the *.insert-header script,
eliminate lines that start with %%.

10 months agopo: Assume a 'sed' that supports '#' for introducing comments.
Bruno Haible [Sun, 13 Oct 2024 20:37:39 +0000 (22:37 +0200)] 
po: Assume a 'sed' that supports '#' for introducing comments.

This is standardized in POSIX since POSIX:2001 (= SUSv3).
It is supported on all platforms that I could test:
GNU, macOS 10.5, FreeBSD 5, NetBSD 7, OpenBSD 6, AIX 7, Solaris 10 and 11,
busybox (2019).

* gettext-runtime/po/remove-potcdate.sed: Renamed from
gettext-runtime/po/remove-potcdate.sin.
* gettext-runtime/po/Makefile.in.in (DISTFILES.common): Update.
(.SUFFIXES): Remove .sin.
(.sin.sed): Remove rule.
($(DOMAIN).pot-update): Use remove-potcdate.sed in $(srcdir).
(mostlyclean): Don't remove remove-potcdate.sed.
* autogen.sh: Update.
* Makefile.am (distcheck-hook): Update.
* gettext-tools/examples/po/remove-potcdate.sed: Renamed from
gettext-tools/examples/po/remove-potcdate.sin.
* gettext-tools/examples/po/Makefile.am ($(DOMAIN).pot-update): Use
remove-potcdate.sed in $(srcdir).
(MOSTLYCLEANFILES): Don't add remove-potcdate.sed.
(EXTRA_DIST): Update.
* gettext-tools/examples/hello-*/po/Makefile.am ($(DOMAIN).pot-update): Use
remove-potcdate.sed in $(srcdir).
(MOSTLYCLEANFILES): Don't add remove-potcdate.sed.
(EXTRA_DIST): Update.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile
($(DOMAIN).pot-update): Remove dependency on remove-potcdate.sed.
(internal-clean): Remove rule.
* gettext-tools/examples/hello-*/autogen.sh: Update.
* gettext-tools/examples/hello-*/autoclean.sh: Update.

10 months agopo: Assume a 'sed' that supports '#' for introducing comments.
Bruno Haible [Sun, 13 Oct 2024 20:36:41 +0000 (22:36 +0200)] 
po: Assume a 'sed' that supports '#' for introducing comments.

This is standardized in POSIX since POSIX:2001 (= SUSv3).
It is supported on all platforms that I could test:
GNU, macOS 10.5, FreeBSD 5, NetBSD 7, OpenBSD 6, AIX 7, Solaris 10 and 11,
busybox (2019).

* gettext-runtime/po/insert-header.sed: Renamed from
gettext-runtime/po/insert-header.sin.
* gettext-runtime/po/Rules-quot (DISTFILES.common.extra1): Update.
(en@quot.insert-header, en@boldquot.insert-header): Use insert-header.sed
instead of insert-header.sin.
* autogen.sh: Update.
* Makefile.am (distcheck-hook): Update.
* gettext-tools/examples/hello-*/autogen.sh: Update.
* gettext-tools/doc/gettext.texi (po/LINGUAS): Update.

10 months agoits: Extend schema so that docbook4.its and docbook5.its pass.
Bruno Haible [Sun, 13 Oct 2024 22:28:38 +0000 (00:28 +0200)] 
its: Extend schema so that docbook4.its and docbook5.its pass.

* gettext-tools/src/its.xsd: Add an <any> element that catches other rules.

10 months agotests: Add more unit tests regarding Desktop files.
Bruno Haible [Sun, 13 Oct 2024 18:58:37 +0000 (20:58 +0200)] 
tests: Add more unit tests regarding Desktop files.

Reported by Felix Riemann at <https://savannah.gnu.org/bugs/?51177>
and by Daniel <daniel.rf710@gmail.com>
at <https://savannah.gnu.org/bugs/?63455>.

* gettext-tools/tests/xgettext-desktop-3: New file.
* gettext-tools/tests/msgfmt-desktop-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

10 months agoxgettext: Desktop: Correct the line numbers in the output and in error messages.
Bruno Haible [Sun, 13 Oct 2024 18:18:15 +0000 (20:18 +0200)] 
xgettext: Desktop: Correct the line numbers in the output and in error messages.

* gettext-tools/src/read-desktop.c (struct token_ty): Add a 'lineno' field.
(desktop_lex): Correct the line numbers in error messages. For a token of type
token_type_pair, store the line number.
(desktop_parse): Pass the line number from the token to
desktop_reader_handle_pair.
* gettext-tools/tests/xgettext-desktop-1: Update expected output.
* gettext-tools/tests/xgettext-desktop-2: Likewise.
* NEWS: Mention the change.

10 months agotests: Make it easier to single-step the msgfmt-* tests.
Bruno Haible [Sun, 13 Oct 2024 18:49:01 +0000 (20:49 +0200)] 
tests: Make it easier to single-step the msgfmt-* tests.

* gettext-tools/tests/msgfmt-desktop-1: Assign a default to MSGFMT.
* gettext-tools/tests/msgfmt-desktop-2: Likewise.
* gettext-tools/tests/msgfmt-desktop-3: Likewise.
* gettext-tools/tests/msgfmt-xml-1: Likewise.
* gettext-tools/tests/msgfmt-xml-2: Likewise.
* gettext-tools/tests/msgfmt-xml-3: Likewise.
* gettext-tools/tests/msgfmt-xml-4: Likewise.
* gettext-tools/tests/msgfmt-xml-5: Likewise.

10 months agomsgmerge, msginit: Reject POT files with non-ASCII character, except in UTF-8, part 2.
Bruno Haible [Sun, 13 Oct 2024 16:57:51 +0000 (18:57 +0200)] 
msgmerge, msginit: Reject POT files with non-ASCII character, except in UTF-8, part 2.

* gettext-tools/src/msgl-charset.c (check_pot_charset): Tweak the new code.

10 months agomsgmerge, msginit: Reject POT files with non-ASCII characters, except in UTF-8.
Bruno Haible [Sun, 13 Oct 2024 16:47:47 +0000 (18:47 +0200)] 
msgmerge, msginit: Reject POT files with non-ASCII characters, except in UTF-8.

Reported by Martin Quinson <mquinson@debian.org>
at <https://savannah.gnu.org/bugs/?65104>.

* gettext-tools/src/msgl-charset.h (check_pot_charset): New declaration.
* gettext-tools/src/msgl-charset.c: Include msgl-ascii.h.
(check_pot_charset): New function.
* gettext-tools/src/msginit.c: Include msgl-charset.h.
(main): Invoke check_pot_charset.
* gettext-tools/src/msgmerge.c: Include msgl-charset.h.
(merge): Invoke check_pot_charset.
* gettext-tools/src/FILES: Update.
* gettext-tools/tests/testdata/nonascii.pot: New file.
* gettext-tools/tests/msginit-5: New file.
* gettext-tools/tests/msgmerge-charset-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
(EXTRA_DIST): Add testdata/nonascii.pot.

10 months agotests: Reorganize msgmerge tests.
Bruno Haible [Sun, 13 Oct 2024 16:28:39 +0000 (18:28 +0200)] 
tests: Reorganize msgmerge tests.

* gettext-tools/tests/msgmerge-9: Renamed from gettext-tools/tests/msgmerge-18.
* gettext-tools/tests/msgmerge-10: Renamed from gettext-tools/tests/msgmerge-19.
* gettext-tools/tests/msgmerge-11: Renamed from gettext-tools/tests/msgmerge-20.
* gettext-tools/tests/msgmerge-12: Renamed from gettext-tools/tests/msgmerge-25.
* gettext-tools/tests/msgmerge-13: Renamed from gettext-tools/tests/msgmerge-26.
* gettext-tools/tests/msgmerge-14: Renamed from gettext-tools/tests/msgmerge-27.
* gettext-tools/tests/msgmerge-15: Renamed from gettext-tools/tests/msgmerge-29.
* gettext-tools/tests/Makefile.am (TESTS): Update.

10 months agotests: Reorganize msgmerge tests.
Bruno Haible [Sun, 13 Oct 2024 16:20:51 +0000 (18:20 +0200)] 
tests: Reorganize msgmerge tests.

* gettext-tools/tests/msgmerge-6: Renamed from gettext-tools/tests/msgmerge-9.
* gettext-tools/tests/msgmerge-7: Renamed from gettext-tools/tests/msgmerge-15.
* gettext-tools/tests/msgmerge-8: Renamed from gettext-tools/tests/msgmerge-17.
* gettext-tools/tests/Makefile.am (TESTS): Update.

10 months agotests: Reorganize msgmerge tests.
Bruno Haible [Sun, 13 Oct 2024 16:10:52 +0000 (18:10 +0200)] 
tests: Reorganize msgmerge tests.

* gettext-tools/tests/msgmerge-domain-1: Renamed from gettext-tools/tests/msgmerge-7.
* gettext-tools/tests/msgmerge-domain-2: Renamed from gettext-tools/tests/msgmerge-8.
* gettext-tools/tests/msgmerge-charset-1: Renamed from gettext-tools/tests/msgmerge-6.
* gettext-tools/tests/msgmerge-charset-2: Renamed from gettext-tools/tests/msgmerge-14.
* gettext-tools/tests/msgmerge-charset-3: Renamed from gettext-tools/tests/msgmerge-16.
* gettext-tools/tests/msgmerge-format-1: Renamed from gettext-tools/tests/msgmerge-13.
* gettext-tools/tests/msgmerge-format-2: Renamed from gettext-tools/tests/msgmerge-21.
* gettext-tools/tests/msgmerge-format-3: Renamed from gettext-tools/tests/msgmerge-28.
* gettext-tools/tests/msgmerge-plural-1: Renamed from gettext-tools/tests/msgmerge-10.
* gettext-tools/tests/msgmerge-plural-2: Renamed from gettext-tools/tests/msgmerge-11.
* gettext-tools/tests/msgmerge-plural-3: Renamed from gettext-tools/tests/msgmerge-12.
* gettext-tools/tests/msgmerge-plural-4: Renamed from gettext-tools/tests/msgmerge-22.
* gettext-tools/tests/msgmerge-plural-5: Renamed from gettext-tools/tests/msgmerge-23.
* gettext-tools/tests/msgmerge-plural-6: Renamed from gettext-tools/tests/msgmerge-24.
* gettext-tools/tests/Makefile.am (TESTS): Update.

10 months agoits: Support DocBook XML, part 2.
Bruno Haible [Sun, 13 Oct 2024 10:49:40 +0000 (12:49 +0200)] 
its: Support DocBook XML, part 2.

Reported by Guillem Jover <guillem@hadrons.org>
at <https://savannah.gnu.org/bugs/?52415>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add xstring-desc.
* gettext-tools/src/its.c: Include xstring-desc.h, c-ctype.h, unistr.h.
(SIZEOF): New macro.
(its_extension_escape_rule_constructor, its_extension_escape_rule_eval): Handle
the 'unescape-if' attribute.
(starts_with_character_reference): Add an ucs_p parameter.
(_its_encode_special_chars_for_merge): Update.
(set_doc_encoding_utf8, _its_is_valid_simple_gen_xml, _its_is_valid_simple_xml,
is_valid_xhtml_element, _its_is_valid_simple_xhtml, is_valid_html_element,
is_no_end_html_element, _its_is_valid_simple_html, _its_set_simple_xml_content,
_its_set_simple_html_content): New functions.
(its_merge_context_merge_node): Implement the 'unescape-if' attribute.
* gettext-tools/src/its-extensions.xsd (EscapeRuleType): Add 'unescape-if'
attribute.
* gettext-tools/its/docbook4.its: Add an <escapeRule>.
* gettext-tools/its/docbook5.its: Likewise.
* gettext-tools/tests/xgettext-docbook-1: New file.
* gettext-tools/tests/msgfmt-xml-5: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* gettext-tools/doc/gettext.texi (ITS Rules): Document the 'unescape-if'
attribute of the escapeRule.
* NEWS: Mention the change.

10 months agoits: Support DocBook XML, part 1.
Bruno Haible [Sun, 13 Oct 2024 10:34:35 +0000 (12:34 +0200)] 
its: Support DocBook XML, part 1.

Reported by Guillem Jover <guillem@hadrons.org>
at <https://savannah.gnu.org/bugs/?52415>.

* gettext-tools/its/docbook4.its: New file, copied from
https://github.com/itstool/itstool file its/docbook.its.
* gettext-tools/its/docbook5.its: New file, copied from
https://github.com/itstool/itstool file its/docbook5.its.
* gettext-tools/its/docbook.loc: New file.
* gettext-tools/its/Makefile.am (ITS_FILES): Add docbook4.its, docbook5.its.
(LOC_FILES): Add docbook.loc.

10 months agoUpdate to the newest gnulib.
Bruno Haible [Sun, 13 Oct 2024 10:33:04 +0000 (12:33 +0200)] 
Update to the newest gnulib.

10 months agoits: Improve error handling.
Bruno Haible [Sun, 13 Oct 2024 01:00:35 +0000 (03:00 +0200)] 
its: Improve error handling.

* gettext-tools/src/its.c: Include libxml/xmlerror.h.
(structured_error): New function.
(its_rule_list_add_from_file, its_rule_list_add_from_string,
its_rule_list_extract, its_merge_context_alloc): Exit upon fatal error.
Set the structured_error for the rest of the function.
(its_merge_context_merge, its_merge_context_write): Set the structured_error.

10 months agoits: Simplify escape handling change from 2024-10-01.
Bruno Haible [Sat, 12 Oct 2024 14:43:51 +0000 (16:43 +0200)] 
its: Simplify escape handling change from 2024-10-01.

* gettext-tools/src/its.c: Add comments about evaluation rules.
(its_extension_escape_rule_eval): Handle local attribute "escape" here...
(its_rule_list_extract_text, its_merge_context_merge_node): ... not here.

10 months agoits: Fix NULL dereference (regression 2024-10-01).
Bruno Haible [Fri, 11 Oct 2024 20:30:09 +0000 (22:30 +0200)] 
its: Fix NULL dereference (regression 2024-10-01).

* gettext-tools/src/its.c (_its_copy_node_with_attributes): Handle attributes
without namespace correctly.

10 months agobuild: Add support for --enable-relocatable in mingw builds on Cygwin hosts, part 2.
Bruno Haible [Fri, 11 Oct 2024 17:53:35 +0000 (19:53 +0200)] 
build: Add support for --enable-relocatable in mingw builds on Cygwin hosts, part 2.

Reported by Michele Locati <michele@locati.it> in
<https://savannah.gnu.org/bugs/?66319>.

* gettext-tools/configure.ac: Invoke gl_CONFIGMAKE_PREP and fix up the values of
pkgdatadir, pkgincludedir, pkglibdir, pkglibexecdir.
Invoke gl_BUILD_TO_HOST_LIBDIR, gl_BUILD_TO_HOST_LIBEXECDIR,
gl_BUILD_TO_HOST_PKGDATADIR, gl_BUILD_TO_HOST_PKGLIBDIR.
* gettext-tools/src/Makefile.am (pkgdatadir, pkglibdir, pkglibexecdir): Remove
variables.
(jardir): Simplify.
(jardir_c_make, projectsdir_c_make): New variables.
(*_CPPFLAGS): Fix value of BISON_LOCALEDIR, GETTEXTJAR, LIBDIR, LIBEXECDIR,
GETTEXTDATADIR, PROJECTSDIR.

10 months agoUpdate to the newest gnulib.
Bruno Haible [Fri, 11 Oct 2024 15:44:37 +0000 (17:44 +0200)] 
Update to the newest gnulib.

10 months agoits: Allow a specific XML namespace for .metainfo.xml / .appdata.xml files.
Bruno Haible [Fri, 11 Oct 2024 10:55:42 +0000 (12:55 +0200)] 
its: Allow a specific XML namespace for .metainfo.xml / .appdata.xml files.

Reported by Claude Paroz <claude@2xlibre.net>
at <https://savannah.gnu.org/bugs/?54472>.

* gettext-tools/its/metainfo.its: Duplicate the rules for XML instances that
use the metainfo namespace.
* gettext-tools/tests/xgettext-appdata-3: New file, based on
gettext-tools/tests/xgettext-appdata-2.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

10 months agobuild: Remove left-over files from the C# compiler of 'dotnet'.
Bruno Haible [Thu, 10 Oct 2024 19:42:53 +0000 (21:42 +0200)] 
build: Remove left-over files from the C# compiler of 'dotnet'.

* gettext-tools/src/Makefile.am (CLEANFILES): Add msgfmt.net.pdb,
msgunfmt.net.pdb.

10 months agobuild: Avoid "warning: stray \ before -" from GNU grep ≥ 3.8.
Bruno Haible [Wed, 9 Oct 2024 21:40:29 +0000 (23:40 +0200)] 
build: Avoid "warning: stray \ before -" from GNU grep ≥ 3.8.

* build-aux/jar-cf: Remove an unnecessary backslash.

10 months agobuild: Revert the revert, and use Sergey Poznyakoff's fix instead.
Bruno Haible [Wed, 9 Oct 2024 21:11:41 +0000 (23:11 +0200)] 
build: Revert the revert, and use Sergey Poznyakoff's fix instead.

Sergey's fix is at
<https://debbugs.gnu.org/cgi/bugreport.cgi?msg=17;bug=73620> =
<https://lists.gnu.org/archive/html/bug-libtool/2024-10/msg00008.html>.

10 months agobuild: Revert build failure on CentOS and Alma Linux (regression 2024-09-26).
Bruno Haible [Wed, 9 Oct 2024 13:57:00 +0000 (15:57 +0200)] 
build: Revert build failure on CentOS and Alma Linux (regression 2024-09-26).

build-aux/ltmain.sh: Revert libtool commit
0e1b33332429cd578367bd0ad420c065d5caf0ac.

10 months agoC#: Add support for dotnet.
Bruno Haible [Wed, 9 Oct 2024 02:06:47 +0000 (04:06 +0200)] 
C#: Add support for dotnet.

Reported by Michele Locati <mlocati@gmail.com>
at <https://savannah.gnu.org/bugs/index.php?66292>.

* DEPENDENCIES: Mention dotnet as an alternative to Mono.
* NEWS: Mention the change.
* PACKAGING: Mention the new file $prefix/lib/gettext/GNU.Gettext.dll.
* gettext-runtime/intl-csharp/Makefile.am (pkglibdir): New variable.
(CLEANFILES): Add GNU.Gettext.pdb.
(install-dll-no, install-dll-yes): Install also into $(pkglibdir).
(installdirs-dll, uninstall-dll): Update accordingly.
* gettext-runtime/intl-csharp/intl.cs (GettextResourceSet): Add field Table.
Override GetEnumerator, GetObject to handle it. Change the Keys method to handle
it as well.
* gettext-tools/tests/lang-csharp: In the program, on Windows, produce UTF-8
output with Unix end-of-lines and set the culture manually.

10 months agoUpdate to the newest gnulib.
Bruno Haible [Wed, 9 Oct 2024 02:00:35 +0000 (04:00 +0200)] 
Update to the newest gnulib.

10 months agoImprove C# support on Cygwin.
Bruno Haible [Mon, 7 Oct 2024 18:39:07 +0000 (20:39 +0200)] 
Improve C# support on Cygwin.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add cygpath.
* gettext-tools/src/read-csharp.c: Include cygpath.h.
(msgdomain_read_csharp): Convert the directory passed to msgunfmt.net.exe from
Cygwin to Windows syntax.
* gettext-tools/src/read-resources.c: Include cygpath.h.
(read_resources_file): Convert the file name passed to msgunfmt.net.exe from
Cygwin to Windows syntax.
* gettext-tools/src/write-resources.c: Include cygpath.h.
(msgdomain_write_csharp_resources): Convert the file name passed to
msgfmt.net.exe from Cygwin to Windows syntax.