]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
10 months agoRelease 0.23 v0.23
Bruno Haible [Sun, 1 Dec 2024 11:34:55 +0000 (12:34 +0100)] 
Release 0.23

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

10 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 \&.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

11 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'.

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

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

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

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

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

11 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 %%.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

11 months agoUpdate to the newest gnulib.
Bruno Haible [Mon, 7 Oct 2024 18:34:23 +0000 (20:34 +0200)] 
Update to the newest gnulib.

11 months agomsgfmt: New option --replace-text.
Bruno Haible [Sun, 6 Oct 2024 07:43:43 +0000 (09:43 +0200)] 
msgfmt: New option --replace-text.

Reported by Asterix <asterix@lagaule.org>
at <https://savannah.gnu.org/bugs/?52159>.

* gettext-tools/src/its.h (its_merge_context_merge): Add parameter replace_text.
* gettext-tools/src/its.c (its_merge_context_merge_node): Add parameter
replace_text.
(its_merge_context_merge): Likewise.
* gettext-tools/src/write-xml.h (msgdomain_write_xml, msgdomain_write_xml_bulk):
Add parameter replace_text.
* gettext-tools/src/write-xml.c (msgdomain_write_xml_bulk): Add parameter
replace_text.
(msgdomain_write_xml): Likewise.
* gettext-tools/src/msgfmt.c (xml_replace_text): New variable.
(long_options): Add --replace-text.
(main): Handle --replace-text.
(usage): Document option --replace-text.
* gettext-tools/tests/msgfmt-xml-4: New file, based on
gettext-tools/tests/msgfmt-xml-1.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/msgfmt.texi: Document option --replace-text.
* NEWS: Mention the change.

11 months agoits: Improve comments in *.its files.
Bruno Haible [Sun, 6 Oct 2024 01:27:19 +0000 (03:27 +0200)] 
its: Improve comments in *.its files.

* gettext-tools/its/glade2.its: Improve comments.
* gettext-tools/its/gtkbuilder.its: Likewise.
* gettext-tools/its/gsettings.its: Likewise.
* gettext-tools/its/metainfo.its: Likewise.

12 months agodoc: Update copyright year.
Bruno Haible [Sat, 5 Oct 2024 17:10:52 +0000 (19:10 +0200)] 
doc: Update copyright year.

12 months agodoc: Document how to use custom *.its files.
Bruno Haible [Sat, 5 Oct 2024 15:53:52 +0000 (17:53 +0200)] 
doc: Document how to use custom *.its files.

Reported by Stefan Brüns <stefan.bruens@rwth-aachen.de>
at <https://savannah.gnu.org/bugs/?64026>.

* gettext-tools/src/search-path.c (get_search_path): Improve comments.
* gettext-tools/doc/xgettext.texi: New subsection "Options for XML input files".
Move the description of --its out of subsection "Output details".
* gettext-tools/doc/msgfmt.texi: Document GETTEXTDATADIRS.
* gettext-tools/doc/gettext.texi (Installers): Document the
PREFIX/share/gettext/its/ directory.

12 months agodoc: Mention some related packages.
Bruno Haible [Fri, 4 Oct 2024 23:50:19 +0000 (01:50 +0200)] 
doc: Mention some related packages.

* gettext-tools/doc/gettext.texi (OmegaT, Virtaal, Vim): New sections.
(Other tools): Mention the Translate Toolkit.
* gettext-tools/doc/lang-python.texi: Mention Babel.

12 months agoits: Fix the value of the xml:lang attribute inserted by msgfmt.
Bruno Haible [Thu, 3 Oct 2024 20:34:14 +0000 (22:34 +0200)] 
its: Fix the value of the xml:lang attribute inserted by msgfmt.

Reported by Matthias Klumpp <matthias@tenstral.net>
at <https://savannah.gnu.org/bugs/?64025>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add bcp47.
* gettext-tools/src/its.c: Include "bcp47.h".
(its_merge_context_merge_node): Convert the language / locale name to BCP 47
syntax before storing it in the xml:lang attribute.
* gettext-tools/tests/msgfmt-xml-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

12 months agoUpdate to the newest gnulib.
Bruno Haible [Thu, 3 Oct 2024 20:20:21 +0000 (22:20 +0200)] 
Update to the newest gnulib.

12 months agoits: Fix permissions of newly added test.
Bruno Haible [Thu, 3 Oct 2024 19:19:32 +0000 (21:19 +0200)] 
its: Fix permissions of newly added test.

12 months agoUpdate the file list.
Bruno Haible [Tue, 1 Oct 2024 20:21:30 +0000 (22:21 +0200)] 
Update the file list.

* gettext-tools/src/FILES: Update.
* gettext-tools/src/write-desktop.h: Fix comment.
* gettext-tools/src/write-xml.h: Likewise.

12 months agoits: During merge, copy also the XML node's attributes.
Bruno Haible [Tue, 1 Oct 2024 19:28:37 +0000 (21:28 +0200)] 
its: During merge, copy also the XML node's attributes.

Rationale: In XHTML, attributes like 'style' are used for rendering.

* gettext-tools/src/its.c (_its_copy_node_with_attributes): New function.
(its_merge_context_merge_node): Use it.
* gettext-tools/tests/msgfmt-xml-1: Update expected results.
* gettext-tools/tests/msgfmt-xml-2: Likewise.

12 months agoits: Do escape handling during msgfmt merge, not during xgettext. Off by default.
Bruno Haible [Tue, 1 Oct 2024 14:42:56 +0000 (16:42 +0200)] 
its: Do escape handling during msgfmt merge, not during xgettext. Off by default.

Reported by Samy Mahmoudi <samy.mahmoudi@gmail.com>
at <https://savannah.gnu.org/bugs/?58643>.

* gettext-tools/src/its.c (its_localization_note_rule_constructor): Don't do
escaping while extracting a localization note.
(its_rule_list_extract_text): New local variable do_escape_during_extract. Don't
do escaping while extracting.
(starts_with_character_reference, _its_encode_special_chars_for_merge): New
functions.
(its_merge_context_merge_node): New local variables do_escape_during_extract,
do_escape_during_merge. Don't do escaping while extracting. Conditionally do
escaping while merging.
* gettext-tools/src/its-extensions.xsd: Mention that escape="no" is now the
default.
* gettext-tools/its/glade1.its: Add a comment.
* gettext-tools/its/glade2.its: Likewise.
* gettext-tools/its/gsettings.its: Likewise.
* gettext-tools/its/gtkbuilder.its: Likewise.
* gettext-tools/its/metainfo.its: Add a <gt:escapeRule>.
* gettext-tools/tests/xgettext-appdata-1: Add comment.
* gettext-tools/tests/xgettext-appdata-2: New file, based on
gettext-tools/tests/msgfmt-xml-1.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/tests/xgettext-its-1: Update expected results.
* gettext-tools/tests/msgfmt-xml-1: Test also character references and entity
references.
* gettext-tools/tests/msgfmt-xml-2: Likewise.
* gettext-tools/doc/gettext.texi (ITS Rules): Under "Escape Special Characters",
explain that it is no longer necessary to write a rule with escape="no".
Rewrite section "Two Use-cases of Translated Strings in XML".
* NEWS: Mention the changes.

12 months agoits: Refactor.
Bruno Haible [Tue, 1 Oct 2024 10:49:01 +0000 (12:49 +0200)] 
its: Refactor.

* gettext-tools/src/its.c (its_rule_list_extract_text): Simplify code
duplication.
(its_merge_context_merge_node): Update accordingly.

12 months agoits: Refactor.
Bruno Haible [Mon, 30 Sep 2024 19:03:47 +0000 (21:03 +0200)] 
its: Refactor.

* gettext-tools/src/its.c (_its_collect_text_content, _its_get_content): Replace
the no_escape parameter with a do_escape parameter.
(its_localization_note_rule_constructor, its_rule_list_extract_text,
its_merge_context_merge_node): All callers changed.

12 months agoits: Refine the XML schema.
Bruno Haible [Mon, 30 Sep 2024 17:38:27 +0000 (19:38 +0200)] 
its: Refine the XML schema.

* gettext-tools/src/its.xsd: Add comments about the default.
* gettext-tools/src/its-extensions.xsd: Likewise.

12 months agoits: Refine the XML schema.
Bruno Haible [Mon, 30 Sep 2024 17:18:51 +0000 (19:18 +0200)] 
its: Refine the XML schema.

* gettext-tools/src/its.xsd: Add string constraints.
* gettext-tools/src/its-extensions.xsd: Likewise.

12 months agoits: Refactor.
Bruno Haible [Mon, 30 Sep 2024 16:44:43 +0000 (18:44 +0200)] 
its: Refactor.

* gettext-tools/src/its.h: Structure this file.
* gettext-tools/src/its.c: Likewise.

12 months agoits: Simplify.
Bruno Haible [Mon, 30 Sep 2024 16:16:22 +0000 (18:16 +0200)] 
its: Simplify.

* gettext-tools/src/its.h: Don't include xg-arglist-context.h.
(its_rule_list_extract): Remove flag_table parameter.
* gettext-tools/src/its.c (its_rule_list_extract_text, its_rule_list_extract):
Remove flag_table parameter.
* gettext-tools/src/xgettext.c (extract_from_xml_file): Update.

12 months agobuild: Add Windows-format metainfo also to libgettextlib and libgettextsrc.
Bruno Haible [Sun, 29 Sep 2024 18:49:51 +0000 (20:49 +0200)] 
build: Add Windows-format metainfo also to libgettextlib and libgettextsrc.

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

* gettext-tools/gnulib-lib/libgettextlib.rc: New file.
* gettext-tools/gnulib-lib/Makefile.am (EXTRA_DIST): Add it.
(WOE32_LIBADD): New macro.
(libgettextlib.res.lo): New rule.
(libgettextlib_la_LIBADD, libgettextlib_la_DEPENDENCIES): Add the .res.lo file.
* gettext-tools/src/libgettextsrc.rc: New file.
* gettext-tools/src/Makefile.am (EXTRA_DIST): Add it.
(WOE32_LIBADD): New macro.
(libgettextsrc.res.lo): New rule.
(libgettextsrc_la_LIBADD, libgettextsrc_la_DEPENDENCIES): New macros.
* gettext-runtime/intl/libintl.rc: Update copyright year.
* gettext-runtime/libasprintf/libasprintf.rc: Likewise.
* gettext-tools/libgettextpo/libgettextpo.rc: Likewise.
* libtextstyle/lib/libtextstyle.rc: Likewise.
* windows/gettext.rc: Likewise.