Compare commits

...

274 Commits

Author SHA1 Message Date
Bruno Haible
053b5ef04d xgettext: PHP: Fix parsing of strings and heredocs with embedded expressions.
Reported by Gert Jan Schoneveld <gertjan@facilityapps.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-08/msg00007.html>
and by Benoit Waldmann <benoit.waldmann@siagilus.fr>
at <https://savannah.gnu.org/bugs/index.php?item_id=67948>.

* gettext-tools/src/x-php.c (enum token_type_ty): New enum values
token_type_lbrace, token_type_rbrace.
(struct php_extractor): New field brace_nesting_depth.
(php_extractor_init_rest): Initialize it.
(extract_balanced): Forward-declare.
(process_dquote_or_heredoc): Change handling of embedded expressions.
(phase4_get): Recognize token_type_lbrace, token_type_rbrace.
(extract_balanced): Recurse also for token_type_lbrace.
(extract_php_input): Remove function.
(extract_php): Inline it here.
* gettext-tools/tests/xgettext-php-1: Add more tests of embedded expressions.
2026-01-28 13:50:21 +01:00
Bruno Haible
b093401bea Update "Written by ..." lines in --version output.
* gettext-tools/src/msgfmt.c (main): Add me and Daiki Ueno as co-authors.
* gettext-runtime/src/ngettext.c (main): Add me as co-author.
* gettext-tools/src/msgmerge.c (main): Likewise.
* gettext-tools/src/msgunfmt.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* gettext-tools/wizard/gettextize.in (func_version): Likewise. Terminate the
'Written by' line with a '.'.
* gettext-tools/autotools/autopoint.in (func_version): Terminate the
'Written by' line with a '.'.
* gettext-tools/autotools/convert-archive.in (func_version): Likewise.
* gettext-tools/misc/po-fetch.in (func_version): Likewise.
* gettext-runtime/src/gettext.sh.in (func_version): Likewise.
* libtextstyle/gnulib-local/build-aux/moopp (func_version): Likewise.
2026-01-28 03:12:04 +01:00
Bruno Haible
203c2d6a72 po-mode: Prepare for inclusion in GNU ELPA.
Suggested by Stefan Monnier <monnier@iro.umontreal.ca> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00086.html>.

* gettext-tools/emacs/po-mode.el: Add meta-information field 'Version:',
required by ELPA. Move meta-information after the copyright and license notice.
(po-mode-version-string): Move definition.
* gettext-tools/emacs/po-compat.el: Move meta-information after the copyright
and license notice. Convert the file to UTF-8 encoding.
2026-01-27 06:09:52 +01:00
Bruno Haible
c2615783e5 Update "Written by ..." lines and authorship notices in source files. 2026-01-27 05:43:26 +01:00
Bruno Haible
0ddd346f30 Update email address in copyright notices. 2026-01-26 22:08:15 +01:00
Bruno Haible
3c05657796 Use the common comment style. 2026-01-26 21:43:14 +01:00
Bruno Haible
910a2e6e06 Fix a small memory leak in libgettextpo.
Reported by <gemmaro.dev@gmail.com> at
<https://savannah.gnu.org/bugs/index.php?item_id=67892>
and by Albert Astals Cid <aacid@kde.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00071.html>.

* gettext-tools/src/read-po-lex.h: Include str-list.h.
(lex_start): Add arena parameter.
* gettext-tools/src/read-po-lex.c (lex_start): Add arena parameter. Add the
heap-allocated file_name to the arena.
* gettext-tools/src/read-catalog-abstract.h: Include str-list.h.
(struct catalog_input_format): Add arena parameter to parse() method.
(catalog_reader_parse): Add arena parameter.
* gettext-tools/src/read-properties.c (properties_parse): Add arena parameter.
* gettext-tools/src/read-stringtable.c (stringtable_parse): Add arena parameter.
* gettext-tools/src/read-po.c (po_parse): Add arena parameter. Update lex_start
call.
* gettext-tools/src/read-catalog-abstract.c (catalog_reader_parse): Add arena
parameter. Update parse() method call.
* gettext-tools/src/read-catalog.h: Include str-list.h.
(read_catalog_stream): Add arena parameter.
* gettext-tools/src/read-catalog.c (read_catalog_stream): Add arena parameter.
Update catalog_reader_parse call.
* gettext-tools/src/read-catalog-file.c: Include str-list.h.
(read_catalog_file): Update read_catalog_stream call.
* gettext-tools/src/read-csharp.c: Include str-list.h.
(execute_and_read_po_output): Update read_catalog_stream call.
* gettext-tools/src/read-java.c: Include str-list.h.
(execute_and_read_po_output): Update read_catalog_stream call.
* gettext-tools/src/read-resources.c: Include str-list.h.
(execute_and_read_po_output): Update read_catalog_stream call.
* gettext-tools/src/read-tcl.c: Include str-list.h.
(msgdomain_read_tcl): Update read_catalog_stream call.
* gettext-tools/libgettextpo/gettext-po.c: Include str-list.h.
(struct po_file): Add field 'arena'.
(po_file_create): Initialize it.
(po_file_read): Likewise. Update read_catalog_stream call.
(po_file_free): Destroy the arena.
* gettext-tools/src/msgfmt.c (read_catalog_file_msgfmt): Update
catalog_reader_parse call.
* gettext-tools/src/x-po.c: Include str-list.h.
(extract): Update catalog_reader_parse call.
* gettext-tools/src/xgettext.c (read_exclusion_file): Update
catalog_reader_parse call.
2026-01-25 19:17:48 +01:00
Bruno Haible
9dda53fc74 doc: Explain translation projects.
* gettext-tools/doc/gettext.texi (Interfacing with the Translators): New
section.
2026-01-25 11:13:43 +01:00
Bruno Haible
c636580a49 Fix warnings with gcc 15 and glibc 2.43.
* libtextstyle/gnulib-local/lib/glib/gstrfuncs.in.h (g_strstr_len): Change
return type to 'const gchar *'.
* libtextstyle/gnulib-local/lib/glib/gstrfuncs.c (g_strstr_len): Likewise.
* libtextstyle/gnulib-local/lib/libcroco/cr-rgb.c (cr_rgb_set_from_name): Change
type of 'result'.
* gettext-tools/src/cldr-plurals.c (extract_rules): Cast the sb_xcontents_c
result to 'char *'.
2026-01-25 04:51:32 +01:00
Bruno Haible
d5c190b1fd Fix some -Wzero-as-null-pointer-constant warnings.
* gnulib-local/lib/backupfile.c (max_backup_version, backup_args, get_version):
Write NULL instead of 0.
* gettext-tools/src/x-go.c (add_to_hash_table): Likewise.
2026-01-17 04:39:12 +01:00
Bruno Haible
d806d18eb3 build: Fix "make installcheck" on MSVC.
Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00042.html>.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): New variable
INTL_WINDOWS_LIBS. Add it to LIBINTL and LTLIBINTL.
* gettext-runtime/configure.ac (INSTALLED_LIBINTL): Add $INTL_WINDOWS_LIBS.
* gettext-tools/configure.ac (INSTALLED_LIBINTL): Likewise.
* libtextstyle/configure.ac (INSTALLED_LIBTEXTSTYLE): New variable.
* libtextstyle/install-tests/Makefile.am (installcheck-local): Link with
$INSTALLED_LIBTEXTSTYLE instead of -ltextstyle.
2026-01-15 14:13:32 +01:00
Bruno Haible
c8ee79bec0 Prepare for 1.0-pre2 prerelease.
* 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-runtime/src/printf_gettext.c (main): Likewise.
* gettext-runtime/src/printf_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/msgpre.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/spit.c (main): Likewise.
* gettext-tools/src/spit.py.in (main): Likewise.
* gettext-tools/src/urlget.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* gettext-tools/autotools/convert-archive.in (func_version): Likewise.
* gettext-tools/autotools/autopoint.in (func_version): Likewise.
* gettext-tools/wizard/gettextize.in (func_version): Likewise.
2026-01-13 11:57:04 +01:00
Michele Locati
77441e0283 cldr-plurals: Fix parsing of plurals.xml from CLDR 38 or newer.
Reported by Michele Locati at <https://savannah.gnu.org/bugs/?66378>.

* gettext-tools/src/cldr-plural-exp.c (eval_relation): Accept operands 'c', 'e'.
* gettext-tools/src/cldr-plural.y (yylex): Likewise.
* gettext-tools/src/cldr-plurals.c (extract_rules): Test for type='cardinal'.
(get_XcY_end, force_spaces, remove_XcY, remove_empty_examples): New functions.
(main): Invoke force_spaces, remove_XcY, remove_empty_examples.
* gettext-tools/tests/cldr-plurals-1: Add more tests.
* AUTHORS: Add Michele Locati.
2026-01-13 11:27:07 +01:00
Bruno Haible
c558619bb3 Document a libcurl requirement.
Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00029.html>.

* DEPENDENCIES: Mention special requirements of libcurl on Windows.
2026-01-12 12:43:29 +01:00
Bruno Haible
b761da94e2 Improve support for clang on native Windows.
* gettext-tools/src/write-mo.c (roundup): Treat clang like GCC.
2026-01-11 01:22:52 +01:00
Bruno Haible
bdbfa2c091 Improve support for clang on native Windows.
* gettext-runtime/intl/libgnuintl.in.h (_INTL_REDIRECT_ASM): Treat clang like
GCC.
2026-01-11 01:22:29 +01:00
Bruno Haible
68e2e2c2d1 Improve support for clang on native Windows.
Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00021.html>.

* libtextstyle/gnulib-local/lib/ostream.oo.h (ostream_printf, ostream_vprintf):
Treat clang like GCC.
* gettext-runtime/libasprintf/vasprintf.h (__attribute__, __format__,
__printf__): Likewise.
* gettext-runtime/libasprintf/autosprintf.in.h (_AUTOSPRINTF_ATTRIBUTE_FORMAT):
Likewise.
* gettext-tools/src/format.h (formatstring_error_logger_t): Likewise.
* gettext-tools/src/if-error.h (if_error, if_verror): Likewise.
* gettext-tools/src/msgl-check.c (formatstring_error_logger): Likewise.
* gettext-tools/src/msgl-merge.c (silent_error_logger): Likewise.
* gettext-tools/src/po-error.h (__attribute__, __format__, __printf__, po_error,
po_error_at_line): Likewise.
* gettext-tools/src/read-po-lex.h (__attribute__, __format__, __printf__):
Likewise.
* gettext-tools/src/xg-check.c (formatstring_error_logger): Likewise.
* gettext-tools/libgettextpo/gettext-po.in.h (struct po_error_handler):
Likewise.
2026-01-11 01:21:58 +01:00
Bruno Haible
144474ff64 libtextstyle: Assume a working <stdbool.h>.
* libtextstyle/lib/textstyle.h: Include <stdbool.h> instead of
<textstyle/stdbool.h>.
* libtextstyle/lib/Makefile.am (nobase_nodist_include_HEADERS): Don't add
textstyle/stdbool.h.
(textstyle/stdbool.h): Remove rule.
(BUILT_SOURCES, MOSTLYCLEANFILES, CLEANFILES): Update accordingly.
(EXTRA_DIST): Remove stdbool.mini.h.
* libtextstyle/lib/stdbool.mini.h: Remove file.
* gettext-tools/src/Makefile.am (textstyle/stdbool.h): Remove target.
(BUILT_SOURCES, MOSTLYCLEANFILES): Remove textstyle/stdbool.h.
2026-01-10 22:53:50 +01:00
Bruno Haible
f1459a89e2 xgettext: Allow inhibiting the warnings about URLs and email addresses.
Reported at <https://savannah.gnu.org/bugs/?67672>.

* gettext-tools/src/message.h (enum syntax_check_type): Add sc_url, sc_email.
(NSYNTAXCHECKS): Increase by 2.
* gettext-tools/src/message.c (syntax_check_name): Update.
* gettext-tools/src/xgettext.h (default_syntax_check): Add comment.
* gettext-tools/src/xgettext.c (default_syntax_check): Add initializer.
(main): Recognize --no-check option.
(usage): Document --no-check option.
* gettext-tools/src/xg-message.c (decide_syntax_check): Assume that
default_syntax_check[i] != undecided.
* gettext-tools/src/xg-check.c (syntax_check_function): Remove the second
argument.
(string_has_ascii_ellipsis): New function, extracted from
syntax_check_ellipsis_unicode.
(message_has_ascii_ellipsis): New function.
(syntax_check_ellipsis_unicode): Remove the second argument. Simplify. Emit only
a single error for both msgid and msgid_plural.
(string_has_space_ellipsis): New function, extracted from
syntax_check_space_ellipsis.
(message_has_space_ellipsis): New function.
(syntax_check_space_ellipsis): Remove the second argument. Simplify. Emit only
a single error for both msgid and msgid_plural.
(syntax_check_quote_unicode): Remove the second argument.
(syntax_check_bullet_unicode_string): New function, extracted from
syntax_check_bullet_unicode.
(syntax_check_bullet_unicode): Remove the second argument. Simplify.
(string_has_url): Don't recognize 'mailto:' URLs.
(syntax_check_url, syntax_check_email): New functions, extracted from
url_check_message.
(url_check_message): Remove function.
(sc_funcs): Add syntax_check_url, syntax_check_email.
(syntax_check_message): Simplify.
(xgettext_check_message_list): Don't invoke url_check_message.
* gettext-tools/tests/xgettext-14: Update after xg-check.c changesd.
* gettext-tools/tests/xgettext-20: Add more testcases.
* gettext-tools/doc/xgettext.texi: Document the --no-check option.
* gettext-tools/doc/gettext.texi: Bump copyright year.
* NEWS: Mention the change.
2026-01-10 20:16:46 +01:00
Bruno Haible
213b865692 Document libjson-c version needed with MSVC.
* DEPENDENCIES (libjson-c): Add note regarding MSVC.
2026-01-10 10:19:02 +01:00
Bruno Haible
c1afa2e18a libtextstyle: Fix compilation error on platforms without working iconv.
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c (iconv_ostream::flush): Add
second parameter.
2026-01-08 10:32:43 +01:00
Bruno Haible
9740ab9ef6 build: Fix build failure in VPATH builds outside of the source tree.
* build-aux/jar-cf: Unset CDPATH. Run 'git log' from $top_srcdir, not from the
current directory.
2026-01-07 22:00:50 +01:00
Bruno Haible
7d6d59eb6a po-mode: Tweak.
* gettext-tools/emacs/po-mode.el: Require Emacs >= 23, like before.
(po-mode-version-string): Bump to 2.32.
2026-01-02 05:09:01 +01:00
gemmaro
934fcbf7a1 po-mode: Add po-subedit-mode-hook.
Reported by <KAction@gnu.org> at
<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890295>.

* gettext-tools/emacs/po-mode.el (po-subedit-mode-hook): Add the
customize variable.
2026-01-02 02:47:35 +01:00
gemmaro
dce47fc998 po-mode: Use define-derived-mode for po-subedit-mode.
* gettext-tools/emacs/po-mode.el (po-subedit-mode): Define as derived
mode from text mode using define-derived-mode.
(po-subedit-mode-syntax-table, po-mode-abbrev-table): Remove these
variables, as define-derived-mode creates them automatically.
(po-edit-string): Use po-subedit-mode instead of text-mode.  Remove
local abbrev table, keymap, syntax table, and hook invocation, since
define-derived-mode handles these automatically.  Move easy-menu
definition to the define-derived-mode body.
(Package-Requires): Add minimum Emacs version requirement. The
define-derived-mode was probably introduced in Emacs 19.23, and commit
7797a29e9 dropped support for Emacs versions before 23.
2026-01-02 02:47:13 +01:00
Collin Funk
969c026038 msgfmt: Don't overflow the stack with large values for --alignment.
Reported by <maxtodeath@gmail.com> at <https://savannah.gnu.org/bugs/?67743>.

* gettext-tools/src/write-mo.c (write_table): Use xmalloca instead of
alloca to allocate the buffer to fill with NUL bytes.
2025-12-31 19:24:40 +01:00
Bruno Haible
c979c72860 doc: Mention the issue of LLM licenses.
* gettext-tools/doc/gettext.texi (Installing an LLM): Discuss LLM license and
size.
2025-12-31 18:10:11 +01:00
Bruno Haible
7c7ff10dcf po-fetch: Clarify the directory.
Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00030.html>.

* gettext-tools/misc/po-fetch.in (func_usage): Mention the output files
location.
* gettext-tools/doc/po-fetch.texi: Likewise.
2025-12-31 02:03:38 +01:00
Bruno Haible
2a14d41159 Document the relation between fetch-po and version control.
Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00030.html>.

* gettext-tools/doc/gettext.texi (po/fetch-po): Add a reference.
(Translations under Version Control): Remove subsection.
(PO Template File under Version Control?): New subsection.
(Translations under Version Control?): New subsection.
2025-12-31 01:58:57 +01:00
Bruno Haible
207e12cc80 build: Avoid link error on native Windows with --enable-shared.
Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00038.html>.

* gettext-tools/src/country-table.h (country_table, country_table_size): Remove
LIBGETTEXTSRC_DLL_VARIABLE annotation.
2025-12-31 00:37:14 +01:00
Bruno Haible
d806c61240 po-fetch: Add man page.
Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00030.html>.

* gettext-tools/man/po-fetch.x: New file.
* gettext-tools/man/po-fetch.1.diff: New file.
* gettext-tools/man/Makefile.am (man_aux): Add po-fetch.x.
(man_MAN1MISC): New variable.
(man_MAN1): Include it.
(man_HTML): Add po-fetch.1.html.
($(man_MAN1MISC)): New rule.
(po-fetch.1, po-fetch.1.html): State dependencies.
* PACKAGING: Update.
2025-12-31 00:11:05 +01:00
Bruno Haible
9c21b898dc build: Fix generation of man pages on native Windows.
* gettext-tools/man/Makefile.am ($(man_MAN1WIZARD), $(man_MAN1AUTOTOOLS)): Write
$${progname}, not $${progname}$(EXEEXT).
2025-12-31 00:10:38 +01:00
Bruno Haible
03d7277dec build: Reject libjson-c versions older than 0.13.
Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00036.html>.

* DEPENDENCIES: Require libjson-c >= 0.13.
* gettext-tools/configure.ac (LIBJSON_C): Reject libjson-c versions older than
0.13.
2025-12-30 22:09:03 +01:00
Bruno Haible
c326dfe6cb Fix "make dist" error when BUILT_SPIT_IN_C is false.
* gettext-tools/src/Makefile.am (noinst_SCRIPTS): Add 'spit'.
(spit): New rule.
(BUILT_SOURCES, MOSTLYCLEANFILES): Add it.
2025-12-30 01:26:21 +01:00
Bruno Haible
3370845a4e Start preparing for 1.0 release.
* gettext-runtime/m4/gettext.m4: Bump version.
2025-12-29 19:53:54 +01:00
Bruno Haible
e549b33dfa New program 'msgpre'.
* gettext-tools/src/msgpre.c: New file, based on gettext-tools/src/msgfilter.c.
* gettext-tools/src/FILES: Describe msgpre.c.
* gettext-tools/src/Makefile.am (bin_PROGRAMS): Add msgpre.
(msgpre_SOURCES, msgpre_LDADD, msgpre_DEPENDENCIES, msgpre_CPPFLAGS,
msgpre_LDFLAGS): New variables.
* gettext-tools/po/POTFILES.in: Add msgpre.c.
* gettext-tools/man/msgpre.x: New file.
* gettext-tools/man/Makefile.am (man_aux): Add msgpre.x.
(man_MAN1SRC): Add msgpre.1.
(man_HTML): Add msgpre.1.html.
(msgpre.1, msgpre.1.html): Add dependencies.
* gettext-tools/doc/gettext.texi (msgpre Invocation): New section.
* gettext-tools/doc/msgpre.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/Makefile.am (programs-for-distdir): Create msgpre.
(distdir1, gen-man1): Update for the msgpre.1 manual page.
* NEWS: Mention the new program.
2025-12-29 19:51:19 +01:00
Bruno Haible
9670fdddf2 Whitespace tweaks.
* gettext-tools/src/msgfilter.c: Fix indentation.
* gettext-tools/src/*.c: GNU coding style.
* gettext-tools/tests/*.c: Likewise.
2025-12-28 12:32:56 +01:00
Bruno Haible
f12d6634be New program 'spit'.
* gettext-tools/machine-translation/README: New file.
* gettext-tools/machine-translation/prototype/README: New file.
* gettext-tools/machine-translation/prototype/OllamaSpit.java: New file.
* gettext-tools/machine-translation/prototype/ollama-spit.c: New file.
* gettext-tools/machine-translation/prototype/ollama-spit.go: New file.
* gettext-tools/machine-translation/prototype/ollama-spit.py: New file.
* gettext-tools/machine-translation/prototype/ollama-spit.sh: New file.
* gettext-tools/configure.ac (INCJSON_C, LIBJSON_C, INCCURL, LIBCURL): New
variables.
(BUILD_SPIT_IN_C): New conditional.
(AC_CONFIG_FILES): Add src/spit.py.
* gettext-tools/src/country-table.h: New file.
* gettext-tools/src/country-table.c: New file.
* gettext-tools/src/spit.c: New file.
* gettext-tools/src/spit.py.in: New file.
* gettext-tools/src/FILES: Mention the new files.
* gettext-tools/src/Makefile.am (bin_PROGRAMS): Conditionally add 'spit'.
(noinst_SCRIPTS): New variable.
(noinst_HEADERS): Add country-table.h.
(spit_SOURCES, spit_CFLAGS, spit_LDADD, spit_DEPENDENCIES, spit_CPPFLAGS,
spit_LDFLAGS): New variables.
(install-exec-local): Conditionally install spit.py.
(installdirs-local, uninstall-local): Update accordingly.
(DISTCLEANFILES): Add spit.py.
* gettext-tools/po/POTFILES.in: Add spit.c.
* gettext-tools/man/spit.x: New file.
* gettext-tools/man/Makefile.am (man_aux): Add spit.x.
(man_MAN1SRC): Add spit.1.
(man_HTML): Add spit.1.html.
(spit.1, spit.1.html): Add dependencies.
* gettext-tools/doc/gettext.texi (Pretranslating): New chapter.
* gettext-tools/doc/spit.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* DEPENDENCIES: Update URLs for libxml2. Add libjson-c, libcurl, Python, the
Python module 'requests'.
* PACKAGING: Mention the 'spit' program and its manual page.
* NEWS: Mention the change.
2025-12-28 12:30:37 +01:00
Bruno Haible
7b2f1337c6 Update ISO 3166 country codes list.
* gettext-tools/doc/ISO_3166: Update to match current Wikipedia.
* gettext-tools/doc/iso-3166.texi: Likewise.
* gettext-tools/src/msginit.c (catalogname_for_locale): Likewise.
2025-12-26 22:50:10 +01:00
Bruno Haible
d6f50b989a Fix compilation error with MSVC 14 (regression 2025-12-19).
* gettext-tools/src/msgl-merge.c (match_domain): Move variable declaration out
of an OpenMP 'for' loop. Reduce scope of local variables.
2025-12-22 21:00:39 +01:00
Bruno Haible
6c3c33fbed Fix compilation errors with older C compilers (regression 2025-12-19).
* gnulib-local/lib/xerror.c (multiline_internal): Add a semicolon between
a label and a declaration.
* gettext-tools/src/write-po.c (wrap): Likewise.
* gettext-tools/src/format-go.c (format_parse): Likewise.
2025-12-22 15:05:33 +01:00
Bruno Haible
0b7f5fc259 Simplify code.
* gettext-tools/src/its.c (_its_encode_special_chars,
_its_encode_special_chars_for_merge): Remove unnecessary memory store.
2025-12-19 21:50:39 +01:00
Bruno Haible
72906c560a Update file list.
* gettext-tools/src/FILES: Update.
2025-12-19 21:47:24 +01:00
Bruno Haible
14d79c924c Modernize coding style: Reduce scope of local variables.
* HACKING (Coding Style): New section, copied from gnulib/HACKING.
* gettext-runtime/src/envsubst.c: Reduce scope of local variables.
* gettext-runtime/src/escapes.h: Likewise.
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-runtime/src/printf-command.c: Likewise.
* gettext-runtime/src/printf_gettext.c: Likewise.
* gettext-runtime/src/printf_ngettext.c: Likewise.
* gnulib-local/lib/addext.c: Likewise.
* gnulib-local/lib/backupfile.c: Likewise.
* gnulib-local/lib/gettext.h: Likewise.
* gnulib-local/lib/markup.c: Likewise.
* gnulib-local/lib/xerror.c: Likewise.
* libtextstyle/gnulib-local/lib/file-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/html-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/html-styled-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/memory-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/noop-styled-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/term-ostream.oo.c: Likewise.
* libtextstyle/gnulib-local/lib/term-styled-ostream.oo.c: Likewise.
* libtextstyle/lib/color.c: Likewise.
* libtextstyle/lib/misc.c: Likewise.
* gettext-tools/src/cldr-plural-exp.c: Likewise.
* gettext-tools/src/cldr-plurals.c: Likewise.
* gettext-tools/src/file-list.c: Likewise.
* gettext-tools/src/filter-quote.c: Likewise.
* gettext-tools/src/format-awk.c: Likewise.
* gettext-tools/src/format-boost.c: Likewise.
* gettext-tools/src/format-c++-brace.c: Likewise.
* gettext-tools/src/format-c.c: Likewise.
* gettext-tools/src/format-c-parse.h: Likewise.
* gettext-tools/src/format-csharp.c: Likewise.
* gettext-tools/src/format-d.c: Likewise.
* gettext-tools/src/format-elisp.c: Likewise.
* gettext-tools/src/format-gcc-internal.c: Likewise.
* gettext-tools/src/format-gfc-internal.c: Likewise.
* gettext-tools/src/format-go.c: Likewise.
* gettext-tools/src/format-java-printf.c: Likewise.
* gettext-tools/src/format-java.c: Likewise.
* gettext-tools/src/format-javascript.c: Likewise.
* gettext-tools/src/format-kde-kuit.c: Likewise.
* gettext-tools/src/format-kde.c: Likewise.
* gettext-tools/src/format-librep.c: Likewise.
* gettext-tools/src/format-lisp.c: Likewise.
* gettext-tools/src/format-lua.c: Likewise.
* gettext-tools/src/format-modula2.c: Likewise.
* gettext-tools/src/format-ocaml.c: Likewise.
* gettext-tools/src/format-pascal.c: Likewise.
* gettext-tools/src/format-perl-brace.c: Likewise.
* gettext-tools/src/format-perl.c: Likewise.
* gettext-tools/src/format-php.c: Likewise.
* gettext-tools/src/format-python-brace.c: Likewise.
* gettext-tools/src/format-python.c: Likewise.
* gettext-tools/src/format-qt-plural.c: Likewise.
* gettext-tools/src/format-qt.c: Likewise.
* gettext-tools/src/format-ruby.c: Likewise.
* gettext-tools/src/format-rust.c: Likewise.
* gettext-tools/src/format-scheme.c: Likewise.
* gettext-tools/src/format-sh-printf.c: Likewise.
* gettext-tools/src/format-sh.c: Likewise.
* gettext-tools/src/format-smalltalk.c: Likewise.
* gettext-tools/src/format-tcl.c: Likewise.
* gettext-tools/src/format.c: Likewise.
* gettext-tools/src/hostname.c: Likewise.
* gettext-tools/src/if-error.c: Likewise.
* gettext-tools/src/its.c: Likewise.
* gettext-tools/src/locating-rules.c: Likewise.
* gettext-tools/src/message.c: Likewise.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgl-ascii.c: Likewise.
* gettext-tools/src/msgl-cat.c: Likewise.
* gettext-tools/src/msgl-charset.c: Likewise.
* gettext-tools/src/msgl-check.c: Likewise.
* gettext-tools/src/msgl-english.c: Likewise.
* gettext-tools/src/msgl-equal.c: Likewise.
* gettext-tools/src/msgl-fsearch.c: Likewise.
* gettext-tools/src/msgl-header.c: Likewise.
* gettext-tools/src/msgl-iconv.c: Likewise.
* gettext-tools/src/msgl-merge.c: Likewise.
* gettext-tools/src/msgl-ofn.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/open-catalog.c: Likewise.
* gettext-tools/src/plural-count.c: Likewise.
* gettext-tools/src/po-charset.c: Likewise.
* gettext-tools/src/po-time.c: Likewise.
* gettext-tools/src/read-catalog.c: Likewise.
* gettext-tools/src/read-catalog-abstract.c: Likewise.
* gettext-tools/src/read-catalog-file.c: Likewise.
* gettext-tools/src/read-catalog-special.c: Likewise.
* gettext-tools/src/read-csharp.c: Likewise.
* gettext-tools/src/read-desktop.c: Likewise.
* gettext-tools/src/read-java.c: Likewise.
* gettext-tools/src/read-mo.c: Likewise.
* gettext-tools/src/read-po-lex.c: Likewise.
* gettext-tools/src/read-properties.c: Likewise.
* gettext-tools/src/read-resources.c: Likewise.
* gettext-tools/src/read-stringtable.c: Likewise.
* gettext-tools/src/read-tcl.c: Likewise.
* gettext-tools/src/recode-sr-latin.c: Likewise.
* gettext-tools/src/search-path.c: Likewise.
* gettext-tools/src/str-list.c: Likewise.
* gettext-tools/src/urlget.c: Likewise.
* gettext-tools/src/write-catalog.c: Likewise.
* gettext-tools/src/write-csharp.c: Likewise.
* gettext-tools/src/write-desktop.c: Likewise.
* gettext-tools/src/write-java.c: Likewise.
* gettext-tools/src/write-mo.c: Likewise.
* gettext-tools/src/write-po.c: Likewise.
* gettext-tools/src/write-properties.c: Likewise.
* gettext-tools/src/write-qt.c: Likewise.
* gettext-tools/src/write-resources.c: Likewise.
* gettext-tools/src/write-stringtable.c: Likewise.
* gettext-tools/src/write-tcl.c: Likewise.
* gettext-tools/src/write-xml.c: Likewise.
* gettext-tools/src/x-awk.c: Likewise.
* gettext-tools/src/x-c.c: Likewise.
* gettext-tools/src/x-csharp.c: Likewise.
* gettext-tools/src/x-d.c: Likewise.
* gettext-tools/src/x-desktop.c: Likewise.
* gettext-tools/src/x-elisp.c: Likewise.
* gettext-tools/src/x-go.c: Likewise.
* gettext-tools/src/x-java.c: Likewise.
* gettext-tools/src/x-javascript.c: Likewise.
* gettext-tools/src/x-librep.c: Likewise.
* gettext-tools/src/x-lisp.c: Likewise.
* gettext-tools/src/x-lua.c: Likewise.
* gettext-tools/src/x-modula2.c: Likewise.
* gettext-tools/src/x-ocaml.c: Likewise.
* gettext-tools/src/x-perl.c: Likewise.
* gettext-tools/src/x-php.c: Likewise.
* gettext-tools/src/x-po.c: Likewise.
* gettext-tools/src/x-python.c: Likewise.
* gettext-tools/src/x-rst.c: Likewise.
* gettext-tools/src/x-ruby.c: Likewise.
* gettext-tools/src/x-rust.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-sh.c: Likewise.
* gettext-tools/src/x-smalltalk.c: Likewise.
* gettext-tools/src/x-tcl.c: Likewise.
* gettext-tools/src/x-typescript-impl.h: Likewise.
* gettext-tools/src/x-vala.c: Likewise.
* gettext-tools/src/x-ycp.c: Likewise.
* gettext-tools/src/xerror-handler.c: Likewise.
* gettext-tools/src/xg-arglist-callshape.c: Likewise.
* gettext-tools/src/xg-arglist-context.c: Likewise.
* gettext-tools/src/xg-arglist-parser.c: Likewise.
* gettext-tools/src/xg-check.c: Likewise.
* gettext-tools/src/xg-encoding.c: Likewise.
* gettext-tools/src/xg-message.c: Likewise.
* gettext-tools/src/xg-mixed-string.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.
2025-12-19 21:46:48 +01:00
Bruno Haible
8448582011 xgettext: Optimize vc-mtime usage.
* gettext-tools/src/xgettext.c (extract_from_xml_file): Don't augment
files_for_vc_mtime twice.
2025-12-12 19:25:45 +01:00
Bruno Haible
c7ce599588 Modernize coding style: Avoid 'goto' statements where possible.
* gettext-tools/src/msgfmt.c (get_languages): Use if/else instead of 'goto'.
2025-12-12 11:28:00 +01:00
Bruno Haible
a5c1a7f6c1 Modernize coding style: Avoid 'continue;' statements where possible.
* gnulib-local/lib/backupfile.c (max_backup_version): Use if/else instead of
'continue;'.
* gnulib-local/lib/markup.c (emit_start_element): Likewise.
2025-12-12 11:24:14 +01:00
Bruno Haible
abb256e01e Modernize coding style: Avoid 'continue;' statements where possible.
* gettext-tools/src/cldr-plurals.c (extract_rules): Use if/else instead of
'continue;'.
* gettext-tools/src/msgfmt.c (msgfmt_operand_list_add_from_directory): Likewise.
* gettext-tools/src/read-po-lex.c (po_gram_lex): Likewise.
* gettext-tools/src/sentence.c (sentence_end): Likewise.
* gettext-tools/src/x-awk.c (extract_parenthesized): Use 'break;' instead of
'continue;'.
* gettext-tools/src/x-c.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-lua.c (extract_balanced): Likewise.
* gettext-tools/src/x-modula2.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-php.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-ycp.c (extract_parenthesized): Likewise.
2025-12-11 10:38:17 +01:00
Bruno Haible
387a2e083a tests: Remove a left-over debugging trace.
* gettext-tools/tests/xgettext-20: Remove a 'set -x' statement.
2025-12-01 19:56:59 +01:00
Bruno Haible
637b208fbe libasprintf: Document need to use g++ option -Wall.
* gettext-runtime/libasprintf/autosprintf.texi (Using autosprintf): Expand text.
(Source code changes, Build system changes): New nodes.
2025-11-11 12:24:10 +01:00
Bruno Haible
0f23092fe8 autopoint: Diagnose multiple invocations of AM_GNU_GETTEXT_VERSION.
Reported by Santiago Vila in
<https://lists.gnu.org/archive/html/bug-gettext/2025-11/msg00001.html>.

* gettext-tools/autotools/autopoint.in: Report an error if "$xreq" or "$xver"
consists of more than one line.
2025-11-05 15:01:12 +01:00
Bruno Haible
05f57bcd68 Update translations from TP.
* gettext-runtime/po/*.po: Update from TP.
* gettext-tools/po/*.po: Update from TP.
* gettext-tools/examples/po/*.po: Update from TP.
2025-10-24 15:43:21 +02:00
Bruno Haible
6eb3598f76 build: Add scripts for fetching the PO files.
* gettext-runtime/po/fetch-po: New file.
* gettext-tools/po/fetch-po: New file.
* gettext-tools/examples/po/fetch-po: New file.
* check-copyright-headers (func_check_file): Don't complain about the LINGUAS
files, that will now have more than 10 lines.
2025-10-24 15:43:00 +02:00
Bruno Haible
f3edef2e5b po: Add customizable 'fetch-po' script.
* gettext-tools/wizard/po-templates/traditional/fetch-po: New file.
* gettext-tools/wizard/Makefile.am (po_SCRIPTS): New variable.
(EXTRA_DIST): Add the po_SCRIPTS.
* gettext-tools/wizard/gettextize.in: Copy but don't overwrite po/fetch-po.
* gettext-tools/wizard/po-templates/traditional/Makefile.in.in (fetch-po): New
target.
* gettext-tools/examples/po/Makefile.am (fetch-po): New target.
* gettext-tools/examples/hello-*/po/Makefile.am (fetch-po): New target.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile (fetch-po): New
target.
* gettext-tools/doc/gettext.texi (po/fetch-po): New subsection.
(po/LINGUAS): Explain how it related to the 'fetch-po' script.
(Release Management): Document how to fetch the PO files before a release.
* NEWS: Mention the change.
2025-10-24 14:08:26 +02:00
Bruno Haible
e003323602 New program 'po-fetch'.
* gettext-tools/misc/po-fetch.in: New file.
* gettext-tools/misc/Makefile.am: New file.
* gettext-tools/configure.ac: Add AC_CONFIG_FILES invocations for the misc/
directory.
* gettext-tools/Makefile.am (SUBDIRS): Add misc.
(EXTRA_DIST): Remove misc/disclaim-translations.txt.
(pkgdata_DATA): Remove variable.
* gettext-tools/doc/po-fetch.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (po-fetch): Add global menu entry.
(po-fetch Invocation): New section.
* PACKAGING: Mention the installed 'po-fetch' program.
* NEWS: Mention 'po-fetch'.
2025-10-21 15:54:18 +02:00
Bruno Haible
5f955e8193 build: Remove duplicate file from version control.
* gettext-tools/examples/po/remove-potcdate.sed: Remove file.
* autogen.sh: Copy remove-potcdate.sed to
gettext-tools/examples/po/remove-potcdate.sed.
2025-10-19 08:34:24 +02:00
Bruno Haible
0136f405d3 build: Distribute one more file.
* gettext-runtime/install-tests/Makefile.am (EXTRA_DIST): Add itest.pot.
2025-10-19 03:00:18 +02:00
Bruno Haible
3c3f36ee01 build: Distribute all tree-sitter patches.
* gettext-tools/Makefile.am (EXTRA_DIST): Add
build-aux/tree-sitter-d-optimization-bug.diff, added on 2025-05-03.
2025-10-19 02:54:54 +02:00
Bruno Haible
8c716a85ec New directory gettext-tools/wizard/po-templates/traditional/.
* gettext-tools/wizard/po-templates/traditional/*: New files, moved here from
gettext-runtime/po/.
* gettext-tools/wizard/po-templates/traditional/Makefile.in.in (install-data,
installdirs-data, uninstall-data, dist2): Remove special code for the
'gettext-tools' package.
* gettext-tools/wizard/po-templates/traditional/Makevars.template: Moved here
from gettext-tools/po/.
* autogen.sh: Copy the contents of the gettext-runtime/po/ and gettext-tools/po/
directories from gettext-tools/wizard/po-templates/traditional/.
* gettext-tools/wizard/Makefile.am (pkgdatadir, podir): New variables.
(po_DATA): Add po-templates/traditional/*.
(EXTRA_DIST): Likewise.
(uninstall-sources): Also remove $(podir)/Makevars.
* Makefile.am (distcheck-hook): Update.
2025-10-18 19:44:04 +02:00
Bruno Haible
5847bb1df1 doc: Mention how to localize other data formats.
* gettext-tools/doc/gettext.texi (Data Formats): Mention po4a. Describe how to
localize LibreOffice documents.
2025-10-17 09:30:21 +02:00
Bruno Haible
75a5c46616 po: Don't msgmerge the PO files through Makefile.in.in.
* gettext-runtime/po/Makefile.in.in (MSGMERGE_UPDATE): Remove variable.
(UPDATEPOFILES): Remove variable.
(POFILESDEPS*): Remove variables.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(mostlyclean): Add *.gpo.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-runtime/po/Makevars (PO_DEPENDS_ON_POT): Remove variable.
* gettext-tools/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/po/Makevars.template (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c-gnome2/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c-gnome3/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c-http/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c++/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c++20/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-c++-gnome2/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c++-gnome3/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c++-kde/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-objc/po/Makevars (PO_DEPENDS_ON_POT): Likewise.
* gettext-tools/examples/hello-objc-gnome2/po/Makevars (PO_DEPENDS_ON_POT):
Likewise.
* gettext-tools/examples/hello-c++-wxwidgets/po/Makefile.am (MSGMERGE_UPDATE):
Remove variable.
(UPDATEPOFILES): Remove variable.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(MOSTLYCLEANFILES): Add *.gpo.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-tools/examples/hello-python/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-guile/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-clisp/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-librep/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-rust/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-go/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-go-http/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-ruby/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-sh/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-gawk/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-pascal/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-modula2/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-d/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-ocaml/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-smalltalk/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-perl/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-php/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-ycp/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-c++-qt/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-java/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-java-awt/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-java-swing/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-java-qtjambi/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-csharp/po/Makefile.am (MSGMERGE_UPDATE): Remove
variable.
(UPDATEPOFILES): Remove variable.
(RESOURCESDLLFILES): Change emitted commands to use an intermediate .gpo file.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(MOSTLYCLEANFILES): Add *.gpo.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-tools/examples/hello-csharp-forms/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-tcl/po/Makefile.am (MSGMERGE_UPDATE): Remove
variable.
(UPDATEPOFILES): Remove variable.
(MSGFILES): Change emitted commands to use an intermediate .gpo file.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(MOSTLYCLEANFILES): Add *.gpo.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-tools/examples/hello-tcl-tk/po/Makefile.am: Likewise.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile (MSGMERGE_UPDATE):
Remove variable.
(UPDATEPOFILES): Remove variable.
(.SUFFIXES): Add '.gpo'. Remove '.po-update'.
($(POFILES)): Remove dependencies. Don't invoke MSGMERGE_UPDATE.
(update-po): Don't make $(UPDATEPOFILES).
(.nop.po-update): Remove rule.
* gettext-tools/examples/po/Makefile.am (MSGMERGE_OPTIONS): Add
--no-fuzzy-matching --quiet.
(MSGMERGE_UPDATE): Remove variable.
(UPDATEPOFILES): Remove variable.
(GPOFILES): New variable.
(.SUFFIXES): Add '.gpo'. Remove '.nop', '.po-update'.
(.po.gpo): New rule.
($(POFILES)): Remove rule.
(DISTCLEANFILES): New variable.
(update-po): Don't make $(UPDATEPOFILES). Make the small PO files.
(.nop.po-update): Remove rule.
* gettext-tools/examples/po/mmsmallpo.sh: Use $language.gpo instead of
$language.po.
* gettext-tools/doc/gettext.texi (Translations under Version Control): Remove
documentation of PO_DEPENDS_ON_POT.
(Release Management): Update wording.
* Admin/release-steps: Don't msgmerge the PO files from translationproject.org.
* NEWS: Mention the change.
2025-10-14 00:55:27 +02:00
Bruno Haible
2ff034612e examples: Fix hello-tcl* examples (regression 2024-12-06).
* gettext-tools/examples/hello-tcl*/po/Makefile.am (CATALOGS): Use suffix .msg,
not .gmo.
2025-10-13 02:15:25 +02:00
Bruno Haible
61a2bbacb5 check-examples: Update comments.
* gettext-tools/examples/check-examples: Update comments.
2025-10-12 22:36:56 +02:00
Bruno Haible
a3aef1a1d3 examples: Improve error message when there is a mistake in a PO file.
* gettext-tools/examples/hello-*/po/Makefile.am (.po.gmo): Use suffix .gpo
instead of .1po.
* gettext-tools/examples/hello-java*/po/Makefile.am (update-properties,
update-classes): Likewise.
* gettext-tools/examples/hello-c++-qt/po/Makefile.am (.po.qm): Likewise.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile ($(STRINGSFILES)):
Likewise.
2025-10-12 19:50:55 +02:00
Bruno Haible
4d64f8c471 xgettext: Rust: Recognize 'gettextrs::gettext' invocations like 'gettext'
invocations.

Reported by Schmiddiii <gnu-savannah@schmidhuberj.de>
at <https://savannah.gnu.org/bugs/?67601>.

* gettext-tools/src/x-rust.c (ts_symbol_scoped_identifier): New variable.
(extract_from_function_call): Accept a scoped_identifier as first argument.
(extract_from_node): Allow a scoped_identifier as callee.
(extract_rust): Initialize ts_symbol_scoped_identifier.
* gettext-tools/tests/xgettext-rust-1: Add another test case.
* gettext-tools/tests/xgettext-rust-6: Likewise.
* NEWS: Mention the fix.
2025-10-12 16:32:24 +02:00
Bruno Haible
731022e254 po: Improve error message when there is a mistake in a PO file.
* gettext-runtime/po/Makefile.in.in (.po.gmo): Use suffix .gpo instead of .1po.
2025-10-12 13:51:18 +02:00
Bruno Haible
4f380c8586 po: Simplify.
* gettext-runtime/po/Makefile.in.in (.NOEXPORT): Remove workaround for versions
of GNU make from before 1993.
2025-10-12 13:42:46 +02:00
Bruno Haible
5a0c27e5ab build: Move more code into libgettextsrc.
* gettext-tools/src/lang-table.h (language_table, language_table_size,
language_variant_table, language_variant_table_size): Mark as
LIBGETTEXTSRC_DLL_VARIABLE.
* gettext-tools/src/Makefile.am (libgettextsrc_la_SOURCES): Add msgl-fsearch.c,
lang-table.c, plural-count.c.
(msgmerge_SOURCES): Remove msgl-fsearch.c, lang-table.c, plural-count.c.
(msginit_SOURCES): Likewise.
* gettext-tools/src/FILES: Update.
2025-10-12 13:03:57 +02:00
Bruno Haible
092e5329e6 msginit: Produce a merged PO file instead of failing.
* gettext-tools/src/msginit.c: Include <omp.h>, msgl-merge.h, backupfile.h,
copy-file.h.
(catalogname): Remove variable.
(main): When the PO file already exists, create a backup file, then merge the
two files.
(usage): Say what happens if the output file already exists.
(struct header_entry_field): New type.
(fresh_fields): Renamed from fields.
(NFIELDS): Remove macro.
(FRESH_FIELDS_LAST_TRANSLATOR): Renamed from FIELD_LAST_TRANSLATOR.
(update_fields): New variable.
(UPDATE_FIELDS_LAST_TRANSLATOR): New macro.
(fill_header): Add 'fresh' parameter. Allocate field_value array on the heap.
* gettext-tools/src/Makefile.am (msginit_SOURCES): Add msgl-fsearch.c,
msgl-merge.c.
(msginit_CFLAGS, msginit_CXXFLAGS): Link with the OpenMP flags.
* gettext-tools/doc/msginit.texi: Say what happens if the output file already
exists.
* gettext-tools/doc/gettext.texi (Creating): Change title. Mention that msginit
can also be used when continuing an existing translation.
* NEWS: Mention the improvement.
2025-10-12 13:03:50 +02:00
Bruno Haible
e6bff68d9d Refactor: Librarify the core of msgmerge.
* gettext-tools/src/msgl-merge.h: New file, based on
gettext-tools/src/msgmerge.c.
* gettext-tools/src/msgl-merge.c: New file, based on
gettext-tools/src/msgmerge.c.
* gettext-tools/src/msgmerge.c: Include msgl-merge.h. Simplify includes.
Remove definitions that are moved to msgl-merge.c.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add msgl-merge.h.
(msgmerge_SOURCES): Add msgl-merge.c.
* gettext-tools/po/POTFILES.in: Add src/msgl-merge.c.
2025-10-12 02:12:49 +02:00
Bruno Haible
6da5013c70 OCaml: Tweak documentation.
* gettext-tools/doc/lang-ocaml.texi: Add note regarding format strings.
2025-10-12 00:12:58 +02:00
Bruno Haible
5ef6297855 Fix failure of lang-javascript on macOS 15. 2025-10-07 13:41:04 +02:00
Bruno Haible
fc26a91ef6 Update after gnulib changed. 2025-10-05 22:22:28 +02:00
Bruno Haible
dcb585cbf2 Refactor: New subdirectory gettext-tools/wizard/, part 2. 2025-10-05 22:19:36 +02:00
Bruno Haible
26413ef170 Refactor: New subdirectory gettext-tools/autotools/.
* gettext-tools/Makefile.am (SUBDIRS): Add autotools. Remove misc.
(distdir2): Update.
* gettext-tools/autotools/Makefile.am: Renamed from
gettext-tools/misc/Makefile.am.
* gettext-tools/autotools/archive.dir.tar: Renamed from
gettext-tools/misc/archive.dir.tar.
* gettext-tools/autotools/add-to-archive: Renamed from
gettext-tools/misc/add-to-archive.
* gettext-tools/autotools/cvsuser.c: Renamed from gettext-tools/misc/cvsuser.c.
* gettext-tools/autotools/convert-archive.in: Renamed from
gettext-tools/misc/convert-archive.in.
* gettext-tools/autotools/autopoint.in: Renamed from
gettext-tools/misc/autopoint.in.
* gettext-tools/configure.ac: Update AC_CONFIG_FILES invocations.
* gettext-tools/man/Makefile.am (man_MAN1AUTOTOOLS): Renamed from man_MAN1MISC.
($(man_MAN1AUTOTOOLS)): Renamed from $(man_MAN1MISC).
(autopoint.1): Update.
* gettext-tools/examples/po/Makefile.am (USE_BUILT_PROGS): Update.
* gettext-tools/tests/autopoint-1: Update.
* gettext-tools/tests/autopoint-2: Likewise.
* gettext-tools/tests/autopoint-3: Likewise.
* check-copyright-headers (func_check_file): Update.
2025-10-05 20:00:05 +02:00
Bruno Haible
fc271fe03b Put archive.dir.tar under version control, part 2.
* gettext-tools/misc/Makefile.am ($(srcdir)/archive.dir.tar): Remove rule.
2025-10-05 18:27:03 +02:00
Bruno Haible
21a3caa801 Refactor: New subdirectory gettext-tools/wizard/.
* gettext-tools/configure.ac: Invoke AC_CONFIG_FILES for wizard/Makefile,
wizard/gettextize, instead of for misc/gettextize.
* gettext-tools/Makefile.am (SUBDIRS): Add wizard.
(distdir2): Recurse into wizard/.
* gettext-tools/wizard/Makefile.am: New file, based on
gettext-tools/misc/Makefile.am.
* gettext-tools/wizard/gettextize.in: Renamed from
gettext-tools/misc/gettextize.in.
* gettext-tools/misc/Makefile.am (bin_SCRIPTS, DISTCLEANFILES): Remove
gettextize.
(install-data-local, uninstall-local, uninstall-sources): Remove rules.
* gettext-tools/man/Makefile.am (man_MAN1WIZARD): New variable.
(man_MAN1MISC): Remove gettextize.1.
($(man_MAN1WIZARD)): New rule.
(gettextize.1): Update.
($(man_MAN1MISC)): Simplify.
2025-10-05 17:33:27 +02:00
Bruno Haible
7e90ce557b Restore syntax highlighting in Emacs 30 or newer.
Reported by Sab Pyrope <sab.pyrope@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-03/msg00017.html>
and by Julien Palard <julien@palard.fr> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-10/msg00000.html>.

It's a regression in Emacs 30, in commit
17e26cf57e18c5df2172a7049591d89fc53b3fb6 .

* gettext-tools/emacs/HACKING: Document how to bisect Emacs regressions.
* gettext-tools/emacs/po-mode.el (po-mode-version-string): Bump to 2.31.
(po-mode): Invoke run-mode-hooks instead of run-hooks.
* NEWS: Mention the fix.
2025-10-02 22:50:11 +02:00
Bruno Haible
7546f94840 xgettext: Java: Remove unjustified warning "'}' found where ')' was expected".
Reported by Alexander Hubmann-Haidvogel <ahubmann@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-09/msg00000.html>
and by Bjoern Voigt <bjoernv@arcor.de> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-09/msg00023.html>.

* gettext-tools/src/x-java.c (extract_parenthesized): When a semicolon is seen
inside braces, start a new argparser instead of returning.
* gettext-tools/tests/xgettext-java-1: Add test cases with inner classes.
2025-10-01 00:04:45 +02:00
Bruno Haible
032b007fea tests: Increase debuggability.
* gettext-tools/tests/xgettext-python-9: Show the warnings in the log when
failing.
2025-09-30 23:59:22 +02:00
Bruno Haible
1dba8793ec libgettextpo: Add API for the workflow flags and the sticky flags.
Reported by Alexander Potashev <aspotashev@gmail.com>
at <https://savannah.gnu.org/bugs/?67470>.

* gettext-tools/src/message.h (format_flag, not_format_p): New declarations.
* gettext-tools/src/message.c (format_flag): New variable.
(not_format_p): New function.
* gettext-tools/src/write-po.c (make_format_description_string): Add comments.
(significant_format_p): Likewise.
* gettext-tools/libgettextpo/gettext-po.in.h (po_flag_iterator_t): New type.
(po_message_has_workflow_flag, po_message_set_workflow_flag,
po_message_workflow_flags_iterator): New declarations.
(po_message_has_sticky_flag, po_message_set_sticky_flag,
po_message_sticky_flags_iterator): New declarations.
(po_flag_iterator_free, po_flag_next): New declarations.
* gettext-tools/libgettextpo/gettext-po.c (struct po_flag_iterator): New type.
(po_message_has_workflow_flag, po_message_set_workflow_flag,
po_message_workflow_flags_iterator): New functions.
(po_message_get_format): Simplify by using not_format_p.
(po_message_has_sticky_flag, po_message_set_sticky_flag,
po_message_sticky_flags_iterator): New functions.
(po_flag_iterator_free, po_flag_next): New functions.
* gettext-tools/tests/gettextpo-1-prg.c (main): Add more test cases.
* gettext-tools/doc/gettext.texi (po_message_t API): Document the new functions.
(po_flag_iterator_t API): New subsection.
* NEWS: Mention the new functions.
2025-09-30 15:35:06 +02:00
Bruno Haible
f5fd381b40 libgettextpo: New function po_message_get_format.
Reported by Alexander Potashev <aspotashev@gmail.com> in
<https://savannah.gnu.org/bugs/?67485>.

* gettext-tools/libgettextpo/gettext-po.in.h (po_message_get_format): New
declaration.
* gettext-tools/libgettextpo/gettext-po.c (po_message_get_format): New function.
* gettext-tools/tests/gettextpo-1-prg.c (main): Test the return value of
po_message_get_format. Add a test case of po_message_set_format with value -1.
* gettext-tools/doc/gettext.texi (po_message_t API): Document
po_message_get_format.
* NEWS: Mention the change.
2025-09-27 13:20:39 +02:00
Bruno Haible
1f89fa1de8 Upgrade to libtool 2.6.0.
* m4/libtool.m4: Update from libtool-2.6.0.
* m4/ltoptions.m4: Likewise.
* m4/ltsugar.m4: Likewise.
* m4/ltversion.m4: Likewise.
* m4/lt~obsolete.m4: Likewise.
* build-aux/ltmain.sh: Likewise.
2025-09-22 00:41:29 +02:00
Bruno Haible
a32db7a22e gettext.h: Avoid warning with gcc < 4.2.
Reported by Orgad Shaneh <orgads@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-09/msg00183.html>.

* gnulib-local/lib/gettext.h (gettext, dgettext, dcgettext): Don't use attribute
__gnu_inline__ with gcc < 4.2.
2025-09-14 18:37:36 +02:00
Bruno Haible
1910a92249 lang-javascript: Avoid failure on macOS 13..15.
* gettext-tools/tests/lang-javascript: On macOS, test only in the UTF-8 locale.
2025-09-14 09:47:44 +02:00
Bruno Haible
a73fd8a501 Update after gnulib changed.
* gettext-tools/libgrep/gnulib-lib/Makefile.am (AM_CPPFLAGS): Add -I option,
so that libintl.h gets found during the compilation of regex.c.
2025-09-14 04:43:06 +02:00
Bruno Haible
adc3ba97ed Put archive.dir.tar under version control.
This helps reducing CI failures when alpha.gnu.org is not responding.
It also simplifies the branch handling when a bug-fix release is made
on the maintenance branch of an older release.

* gettext-tools/misc/archive.dir.tar: New file.
* autopull.sh: Don't fetch it from alpha.gnu.org any more.
2025-09-08 16:20:17 +02:00
Bruno Haible
e2c4aba219 build: Make CI's git hostname rewriting rules apply.
* .gitmodules: Canonicalize savannah host name.
2025-09-08 08:43:32 +02:00
Bruno Haible
8f38e562d6 Update after gnulib changed.
* libtextstyle/tests/Makefile.am (AM_CFLAGS): Initialize.
* gettext-tools/gnulib-tests/Makefile.am (AM_CFLAGS): Initialize.
2025-09-04 00:40:21 +02:00
Bruno Haible
0736aca4af Update to the newest gnulib. 2025-09-04 00:30:53 +02:00
Bruno Haible
a40c7b7f84 doc: Update table of programming languages.
* gettext-tools/doc/gettext.texi (List of Programming Languages): Update table
in comments.
2025-08-24 01:20:29 +02:00
Bruno Haible
ce283b4b85 its: Improve libxml error handling.
When there is a non-fatal error, the previous code would just print a message
to stderr and continue the operation, without affecting the exit code.

* gettext-tools/src/its.c: Include <setjmp.h>, <stdarg.h>.
(xml_error_exit): New variable.
(structured_error): Longjmp to xml_error_exit.
(generic_error): New function.
(its_rule_list_add_from_file, its_rule_list_add_from_string,
its_rule_list_extract, its_merge_context_merge, its_merge_context_alloc,
its_merge_context_write): Invoke also xmlSetGenericErrorFunc. Use setjmp to
abort the operation when a non-fatal error occurs.
2025-08-13 22:20:46 +02:00
Bruno Haible
6836b43624 its: Fix error handling.
* gettext-tools/src/its.c (structured_error, its_rule_list_add_from_file,
its_rule_list_add_from_string, its_rule_list_extract, its_merge_context_alloc):
Swap error() arguments.
2025-08-11 16:54:20 +02:00
Bruno Haible
b1cbf5dd77 Rely more on Gnulib.
* gettext-tools/src/write-java.c (S_*): Remove macros, relying on gnulib module
sys_stat-h.
* gettext-tools/src/write-csharp.c (S_*): Likewise.
2025-08-10 22:03:19 +02:00
Bruno Haible
057cf901ba Use standard way of including <config.h>.
* gettext-runtime/src/*.c: Include <config.h> unconditionally.
* gettext-runtime/libasprintf/lib-asprintf.h: Likewise.
* libtextstyle/lib/color.c: Likewise.
* gnulib-local/lib/markup.c: Likewise.
* gettext-tools/src/*.y: Likewise.
* gettext-tools/src/*.c: Likewise.
* gettext-tools/libgrep/*.c: Likewise.
* gettext-tools/libgettextpo/*.c: Likewise.
* gettext-tools/tests/*.c: Likewise.
2025-08-10 17:34:20 +02:00
Bruno Haible
c4c7c3839a INSTALL: Tweak wording.
* INSTALL: Fix a copy-and-paste mistake.
2025-08-05 22:10:35 +02:00
Bruno Haible
eb25e838ad build: Make autogen.sh more reliable.
* autogen.sh: Fail if gnulib-tool fails.
2025-08-05 22:09:01 +02:00
Bruno Haible
b214284bcb tests: Fix a lang-go failure.
* gettext-tools/tests/lang-go: Add workaround against
"go: GOPROXY list is not the empty string, but contains no entries" error.
2025-08-05 08:43:59 +02:00
Bruno Haible
ae418b7028 Update after gnulib changed.
* gettext-tools/tests/Makefile.am (TESTS_ENVIRONMENT): Define top_builddir,
consistently with Gnulib.
* gettext-tools/tests/init-env.in (top_builddir): Remove definition here.
2025-08-05 07:39:14 +02:00
Bruno Haible
7e8f1357f4 Update to the newest gnulib. 2025-08-05 07:39:10 +02:00
Bruno Haible
2d6f665b97 intl-java: Remove an unused variable.
Reported by Coverity.

* gettext-runtime/intl-java/gnu/gettext/GettextResource.java (ngettextnull):
Remove an unused variable.
2025-08-03 20:11:40 +02:00
Bruno Haible
ae52c096d7 libcroco: Fix double-free and free-after-use bug.
Reported by Coverity.

* libtextstyle/gnulib-local/lib/libcroco/cr-sel-eng.c
(cr_sel_eng_unregister_pseudo_class_sel_handler): Don't access or free 'elem'
after it has been freed. Remove always-NULL variable.
2025-08-03 20:02:26 +02:00
Bruno Haible
6fa3d8eca2 intl: Fix a small memory leak.
Reported by Coverity.

* gettext-runtime/intl/loadmsgcat.c (_nl_load_domain): Free
sysdep_segment_values before 'goto invalid'.
2025-08-03 19:34:19 +02:00
Bruno Haible
cad29a148e examples: Fix a compiler warning.
* gettext-tools/examples/hello-objc-gnustep/Hello.m (Hello): Remove an unused
variable.
2025-08-03 19:33:22 +02:00
Bruno Haible
0e709dbdee gettext.m4: Fix build on Cygwin with gcc 13 or newer.
This gcc version links with -lintl -liconv by default, making it appear as if
gettext() et al. were defined in libc. But GNU gettext still needs to build a
new libintl.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): On Cygwin, set
USE_INCLUDED_LIBINTL=yes regardless of the gcc version.
2025-08-01 22:23:22 +02:00
Bruno Haible
133de2a1c5 gettext.m4: Modernize.
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Rename configure option
--with-included-gettext to --with-included-libintl. Rename cache
variable nls_cv_force_use_gnu_gettext to gt_cv_force_use_gnu_libintl.
Rename cache variable nls_cv_use_gnu_gettext to gt_cv_use_gnu_libintl.
2025-08-01 22:22:37 +02:00
Bruno Haible
0c0bf3abb2 tests: Fix a lang-java failure on native Windows with MSVC.
* gettext-tools/tests/lang-java: On native Windows, don't test the UTF-8 locale.
2025-07-30 16:22:32 +02:00
Bruno Haible
0f3521607b hostname: Fix a small memory leak.
Reported by Coverity.

* gettext-tools/src/hostname.c (print_hostname): Free hostname before returning.
2025-07-28 16:24:43 +02:00
Bruno Haible
f9e3329954 Fix a small memory leak.
Reported by Coverity.

* gettext-tools/src/format-python.c (format_parse): Free name before returning.
2025-07-28 16:24:37 +02:00
Bruno Haible
4e4b995657 examples: Add hello-ocaml example.
* gettext-tools/examples/hello-ocaml/INSTALL: New file.
* gettext-tools/examples/hello-ocaml/autogen.sh: New file.
* gettext-tools/examples/hello-ocaml/autoclean.sh: New file.
* gettext-tools/examples/hello-ocaml/dune.in: New file.
* gettext-tools/examples/hello-ocaml/dune-project.in: New file.
* gettext-tools/examples/hello-ocaml/hello.ml.in: New file.
* gettext-tools/examples/hello-ocaml/Makefile.am: New file.
* gettext-tools/examples/hello-ocaml/configure.ac: New file.
* gettext-tools/examples/hello-ocaml/m4/Makefile.am: New file.
* gettext-tools/examples/hello-ocaml/po/LINGUAS: New file.
* gettext-tools/examples/hello-ocaml/po/Makefile.am: New file.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-ocaml.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-ocaml.
(hello-ocaml.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-ocaml.
($(srcdir)/../hello-ocaml/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check__hello_ocaml): New function.
* gettext-tools/examples/README: Mention hello-ocaml.
* gettext-tools/doc/lang-ocaml.texi: Likewise.
* NEWS: Likewise.
2025-07-28 12:53:21 +02:00
Bruno Haible
8a1197f724 OCaml support: Add a unit test.
* gettext-tools/tests/lang-ocaml: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* HACKING: Document dependencies for lang-ocaml.
2025-07-28 10:16:38 +02:00
Bruno Haible
66ce533273 OCaml support: Add OCaml support in the tools.
This implements several improvements, compared to
"ocaml-gettext --action extract ...":
  - Comments are extracted.
  - '#, ocaml-format' annotation on f_ arguments.
  - Recognizes concatenated strings, such as ("abc" ^ "def").
  - Supports (s_ "").

* autopull.sh: Check out tree-sitter-ocaml. Set TREE_SITTER_OCAML_VERSION.
* gettext-tools/build-aux/tree-sitter-ocaml-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_OCAML_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter-ocaml source code
and patch.
* gettext-tools/doc/gettext.texi (PO Files): Mention ocaml-format.
(Translators for other Languages): New subsection "OCaml Format Strings".
* gettext-tools/doc/lang-ocaml.texi: Mention all the supported *gettext
functions. Mention format strings with positions.
* gettext-tools/doc/xgettext.texi: Document the OCaml support in more places.
* gettext-tools/src/message.h (format_ocaml): New enum value.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_ocaml.
* gettext-tools/src/format-ocaml.c: New file, based on
gettext-tools/src/format-awk.c.
* gettext-tools/src/format.h (formatstring_ocaml): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add formatstring_ocaml.
* gettext-tools/src/x-ocaml.h (SCANNERS_OCAML): Reference flag_table_ocaml and
formatstring_ocaml.
(extract_ocaml): Declare with first argument of type 'FILE *'.
* gettext-tools/src/x-ocaml.c: Completely rewritten.
* gettext-tools/src/xgettext.c (flag_table_ocaml): New variable.
(usage): Document the OCaml support in more places.
(xgettext_record_flag): Support format_ocaml.
* gettext-tools/src/FILES: Mention format-ocaml.c.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-ocaml.c.
(LIBXGETTEXTTS): Add libxgettextts5.a.
(libxgettextts5_a_*): New variables.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-ocaml.c.
* gettext-tools/po/POTFILES.in: Add src/format-ocaml.c.
* gettext-tools/tests/format-ocaml-1: New file.
* gettext-tools/tests/format-ocaml-2: New file.
* gettext-tools/tests/xgettext-ocaml-1: New file.
* gettext-tools/tests/xgettext-ocaml-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
* NEWS: Mention the OCaml support.
2025-07-28 00:09:35 +02:00
Bruno Haible
b4dc38d4bd Refactor: Simplify.
* gettext-tools/src/format-python-brace.c (parse_named_field,
parse_numeric_field, parse_directive, parse_upto): Remove 'translated'
parameter.
(format_parse): Update.
2025-07-27 09:47:12 +02:00
Bruno Haible
1c80e3154e Fix typos in comments.
* gettext-tools/src/format-lua.c: Fix typos in comments.
* gettext-tools/src/format-d.c: Likewise.
2025-07-27 09:46:59 +02:00
Bruno Haible
6d5a50fc48 OCaml support: Add OCaml support in xgettext.
* gettext-tools/doc/lang-ocaml.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (No string concatenation): Mention string
concatenation in OCaml.
(List of Programming Languages): Include lang-ocaml.texi.
* gettext-tools/doc/xgettext.texi: Document the -L OCaml option.
* gettext-tools/src/x-ocaml.h: New file.
* gettext-tools/src/x-ocaml.c: New file.
* gettext-tools/src/xgettext.c: Include x-ocaml.h.
(flag_table_ocaml): New variable.
(main): Invoke init_flag_table_ocaml, x_ocaml_extract_all, x_ocaml_keyword.
(usage): Document the -L OCaml option.
(language_to_extractor, extension_to_language): Support OCaml.
* gettext-tools/src/FILES: Mention x-ocaml.h, x-ocaml.c.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add x-ocaml.h.
(xgettext_SOURCES): Add x-ocaml.c.
* gettext-tools/po/POTFILES.in: Add src/x-ocaml.c.
2025-07-23 11:30:27 +02:00
Bruno Haible
101f7026ad tests: Fix a lang-java failure on native Windows.
* gettext-tools/tests/lang-java: On native Windows, convert newlines in the
output before comparing.
2025-07-22 12:40:35 +02:00
Bruno Haible
b9a55188d3 tests: Recognize the *-*-windows* config triplets introduced on 2023-06-26.
* gettext-tools/tests/init-env.in: Treat windows* as equivalent to mingw*.
* gettext-tools/tests/intl-7: Likewise.
* gettext-tools/tests/lang-c: Likewise.
* gettext-tools/tests/lang-c++: Likewise.
* gettext-tools/tests/lang-c++-boost: Likewise.
* gettext-tools/tests/lang-c++20: Likewise.
* gettext-tools/tests/lang-c++26: Likewise.
* gettext-tools/tests/lang-d: Likewise.
* gettext-tools/tests/lang-modula2: Likewise.
* gettext-tools/tests/lang-objc: Likewise.
* gettext-tools/tests/msgfilter-8: Likewise.
2025-07-22 12:37:42 +02:00
Bruno Haible
ef13e87973 tests: Fix a lang-java failure on native Windows.
* gettext-tools/tests/init-env.in (CLASSPATH_SEPARATOR): New variable.
* gettext-tools/tests/lang-java: Use it instead of hardcoding ':'.
2025-07-21 22:08:41 +02:00
Bruno Haible
f66e5482ea Fix typos.
Reported by <Jens.Schleusener@fossies.org>.

* gettext-tools/libgrep/m-regex.c: Fix typo in comments.
* gettext-tools/misc/autopoint.in: Likewise.
* gettext-tools/misc/gettextize.in: Likewise.
* gettext-tools/src/format-python-brace.c: Likewise.
* gettext-tools/src/gnu/gettext/DumpResource.java: Likewise.
* gettext-tools/src/its.h: Likewise.
* gettext-tools/src/locating-rules.h: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/read-catalog-abstract.h: Likewise.
* gettext-tools/src/read-catalog-abstract.c: Likewise.
* gettext-tools/src/read-catalog.h: Likewise.
* gettext-tools/src/read-properties.c: Likewise.
* gettext-tools/src/write-java.c: Likewise.
* gettext-tools/src/write-mo.c: Likewise.
* gettext-tools/src/x-d.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-sh.c: Likewise.
* gettext-tools/emacs/po-mode.el: Fix typos in help and comments.
* gettext-tools/doc/gettext.texi: Fix typos.
* NEWS: Fix typos.
2025-07-21 22:08:41 +02:00
Bruno Haible
1873f881df examples: Reenable checking of hello-c-gnome3 and hello-c++-gnome3.
* gettext-tools/examples/check-examples (func_check__hello_c_gnome3,
func_check__hello_cxx_gnome3): Reenable most checks.
2025-07-21 22:08:37 +02:00
Bruno Haible
cbc153416e examples: Make 'check-example' more maintainable.
Some examples require specific sets of environment variables.
E.g. hello-go requires a PATH which uses GCC 13 or 14, not GCC 15,
due to <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119098>.

* gettext-tools/examples/check-examples: Rewrite to use one top-level function
per sample, instead of one top-level function for each check.
2025-07-20 17:56:37 +02:00
Bruno Haible
d16c3c8f05 Release 0.26 2025-07-19 22:23:05 +02:00
Bruno Haible
e43acdc385 Update release steps. 2025-07-19 21:54:28 +02:00
Bruno Haible
4595dc0b40 examples: Use infrastructure from gettext version 0.26.
* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 0.26.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.
2025-07-19 21:54:28 +02:00
Bruno Haible
f89200f277 Update translations from TP.
* gettext-runtime/po/*.po: Update from TP.
* gettext-tools/po/*.po: Update from TP.
* gettext-tools/examples/po/*.po: Update from TP.
2025-07-19 21:54:28 +02:00
Bruno Haible
3ed149a373 Prepare for 0.26 release.
* gettext-runtime/doc/matrix.texi: Update from TP.
* gettext-runtime/doc/nls.texi (STATUS): Update.
* 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/po/Makefile.in.in: Update Origin.
* gettext-runtime/intl/Makefile.am (LTV_*): Bump to 12:5:4.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 2:6:2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:15:5.
* gettext-tools/misc/autopoint.in: Likewise. Accept version 0.26.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.26.
2025-07-19 21:54:28 +02:00
Bruno Haible
c0cf67dd46 Update to the newest gnulib. 2025-07-19 21:54:23 +02:00
Bruno Haible
7fce5309f0 xgettext: JavaScript: Add one more test.
Reported by <fiurgeist@gmail.com>
at <https://savannah.gnu.org/bugs/index.php?67337>.

* gettext-tools/tests/xgettext-javascript-14: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-07-19 08:30:02 +02:00
Bruno Haible
106647be6d msginit: Fix encoding of second title line, part 2.
Reported by Matilin Torre <watilin@protonmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-07/msg00024.html>.

To reproduce the problem:
$ LC_ALL=de_DE.ISO-8859-1 msginit -l fr_FR.ISO-8859-1 -i some_utf-8.pot -o fr.po

* gettext-tools/src/msginit.c (output_charset): New variable.
(content_type): Use output_charset.
(get_title): Use output_charset instead of ignoring was_utf8.
(fill_header): Initialize output_charset. Moved logic from content_type()
to here.
2025-07-18 21:38:32 +02:00
Bruno Haible
6aefadd72b msginit: Fix encoding of second title line, part 1.
Reported by Matilin Torre <watilin@protonmail.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-07/msg00024.html>.

* gettext-tools/src/msginit.c: Include xstriconv.h.
(get_title): Don't set OUTPUT_CHARSET; this does not work any more since 2005,
when an optimization was made in dcigettext.c. Instead, use xstr_iconv().
2025-07-18 21:34:55 +02:00
Bruno Haible
a0e74b9583 msgfmt: Verify that .mo files are reproducible across GNU gettext versions.
* gettext-tools/tests/msgfmt-21: New file.
* gettext-tools/tests/testdata/mf-21.mo: New generated file.
* gettext-tools/tests/Makefile.am (TESTS): Add msgfmt-21.
(EXTRA_DIST): Add testdata/mf-21.mo.
2025-07-12 14:41:08 +02:00
Bruno Haible
6a0792037f Update to the newest gnulib. 2025-07-12 14:38:01 +02:00
Bruno Haible
fd84361f0e build: On mingw, avoid link dependency from xgettext.exe to libstdc++.
Reported by Michele Locati <michele@locati.it> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-10/msg00007.html>.

* gettext-tools/src/Makefile.am (xgettext_CXXFLAGS): New variable.
2025-07-09 08:29:56 +02:00
Bruno Haible
09cfa7cb53 build: Use a more understandable directory name for ITS data files.
Reported by Santiago Vila <sanvila@debian.org>.

* gettext-tools/configure.ac (PACKAGE_SUFFIX): Use PACKAGE_VERSION, not
ARCHIVE_VERSION.
2025-07-09 08:29:56 +02:00
Bruno Haible
ac0dd7475b build: Update .gitignore files. 2025-07-08 16:05:22 +02:00
Bruno Haible
2bc44e010c build: Remove autosprintf_all.html upon "make maintainer-clean".
* gettext-runtime/libasprintf/Makefile.am (MAINTAINERCLEANFILES): New variable.
2025-07-08 12:06:29 +02:00
Bruno Haible
27d8a1add2 tests: Fix suggested valgrind invocation.
A while ago, valgrind exited with exit code != 0 when it encountered an error.
This is apparently not the case any more.

* gettext-tools/tests/Makefile.am (CHECKER): Add --error-exitcode option.
2025-07-07 09:17:58 +02:00
Bruno Haible
673ca474f5 xgettext: Perl: Add unit test for bug.
* gettext-tools/tests/xgettext-perl-11: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-07-07 09:16:01 +02:00
Bruno Haible
80d0903beb xgettext: Perl: Fix a memory leak (regression 2003-06-27).
* gettext-tools/src/x-perl.c (phase2_getc): Free the result of
from_current_source_encoding.
2025-07-07 09:07:39 +02:00
Bruno Haible
f98de965a0 xgettext: Perl: Fix bug with comment lines longer than 1024 (regr. 2024-09-26).
Reported by Alyssa Ross <hi@alyssa.is> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-07/msg00009.html>.

* gettext-tools/src/x-perl.c (phase2_getc): Move the sb_free call until after
the savable_comment_add call.
2025-07-07 09:02:41 +02:00
Bruno Haible
8a76b0b1c9 doc: More precisions about POSIX printf portability.
* gettext-tools/doc/lang-sh.texi (The printf approach): Add more details.
Based on info given by Jörg Schilling in 2020.
2025-07-04 10:26:09 +02:00
Bruno Haible
a0130a04b0 Prepare for prerelease.
* gettext-tools/po/POTFILES.in: Update file list.
2025-07-04 08:49:38 +02:00
Bruno Haible
7c70492939 Update to the newest gnulib. 2025-07-04 08:36:28 +02:00
Bruno Haible
0c0bd837fa xgettext: Warn when a message contains an URL or email address.
Reported by Arsen Arsenović <arsen@aarsen.me>
at <https://savannah.gnu.org/bugs/?67000>.

* gettext-tools/src/xg-check.c: Include c-strstr.h.
(SIZEOF): New macro.
(string_has_url, message_has_url, string_has_email, message_has_email,
url_check_message): New functions.
(xgettext_check_message_list): Invoke url_check_message.
* gettext-tools/tests/xgettext-20: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.
2025-07-04 04:00:23 +02:00
Bruno Haible
475c199fc9 msgcat, msgen, xgettext: Tweak processing order.
* gettext-tools/src/msgcat.c (main): Sort the list of messages as the last
processing step before writing the PO file.
* gettext-tools/src/msgen.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
2025-07-03 18:56:11 +02:00
Bruno Haible
94906022d9 xgettext: Check msgid and msgid_plural for compatibility as format strings.
* gettext-tools/src/if-error.h: Include <stdarg.h>.
(if_verror): New declaration.
* gettext-tools/src/if-error.c (if_verror): New function, extracted from
if_error.
(if_error): Invoke it.
* gettext-tools/src/xg-check.h (xgettext_check_message_list): Renamed from
syntax_check_message_list.
* gettext-tools/src/xg-check.c: Include format.h, if-error.h.
(struct formatstring_error_logger_locals): New type.
(formatstring_error_logger, format_check_message): New functions.
(xgettext_check_message_list): Renamed from syntax_check_message_list. Invoke
also format_check_message.
* gettext-tools/src/xgettext.c (main): Invoke xgettext_check_message_list
instead of syntax_check_message_list.
* gettext-tools/tests/xgettext-19: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.
2025-07-03 17:41:22 +02:00
Bruno Haible
92eed46803 Lisp, Scheme support: Fix format string checking.
* gettext-tools/src/format-lisp.c (format_check): Allow missing arguments if
!equality.
* gettext-tools/src/format-scheme.c (format_check): Likewise.
2025-07-03 17:41:22 +02:00
Bruno Haible
1b64c53623 Lua support: Fix format string checking.
* gettext-tools/src/format-lua.c (format_check): Allow missing arguments if
!equality. Report all argument type mismatches at once.
2025-07-03 17:41:15 +02:00
Bruno Haible
f405ab69d9 tests: Strengthen tests.
* gettext-tools/tests/lang-bash: Invoke msgfmt with option '-c'.
* gettext-tools/tests/lang-c: Likewise.
* gettext-tools/tests/lang-c++: Likewise.
* gettext-tools/tests/lang-c++20: Likewise.
* gettext-tools/tests/lang-c++26: Likewise.
* gettext-tools/tests/lang-c++-boost: Likewise.
* gettext-tools/tests/lang-clisp: Likewise.
* gettext-tools/tests/lang-csharp: Likewise.
* gettext-tools/tests/lang-d: Likewise.
* gettext-tools/tests/lang-elisp: Likewise.
* gettext-tools/tests/lang-gawk: Likewise.
* gettext-tools/tests/lang-go: Likewise.
* gettext-tools/tests/lang-guile: Likewise.
* gettext-tools/tests/lang-java: Likewise.
* gettext-tools/tests/lang-javascript: Likewise.
* gettext-tools/tests/lang-librep: Likewise.
* gettext-tools/tests/lang-lua: Likewise.
* gettext-tools/tests/lang-modula2: Likewise.
* gettext-tools/tests/lang-objc: Likewise.
* gettext-tools/tests/lang-pascal: Likewise.
* gettext-tools/tests/lang-perl-1: Likewise.
* gettext-tools/tests/lang-perl-2: Likewise.
* gettext-tools/tests/lang-php: Likewise.
* gettext-tools/tests/lang-python-1: Likewise.
* gettext-tools/tests/lang-python-2: Likewise.
* gettext-tools/tests/lang-ruby: Likewise.
* gettext-tools/tests/lang-rust: Likewise.
* gettext-tools/tests/lang-sh-1: Likewise.
* gettext-tools/tests/lang-sh-2: Likewise.
* gettext-tools/tests/lang-sh-3: Likewise.
* gettext-tools/tests/lang-smalltalk: Likewise.
* gettext-tools/tests/lang-tcl: Likewise.
* gettext-tools/tests/lang-vala: Likewise.
2025-07-03 17:41:15 +02:00
Bruno Haible
d3f5b62c65 Python: Fix compilation error (regression 2025-06-24).
* gettext-tools/src/format-python-brace.c (parse_directive): Pass NULL, not
false.
2025-07-03 17:41:15 +02:00
Bruno Haible
0de73d2694 Modula-2 support: Fix possible crash during format string checking.
* gettext-tools/src/format-modula2.c (format_check): Fix error message. Fix loop
bound.
2025-07-03 17:40:37 +02:00
Bruno Haible
62e3b84b92 xgettext: Fix bug with syntax-checks on messages from Perl source code.
* gettext-tools/src/x-perl.c (extract_perl): Don't free logical_file_name,
because it is referenced by the 'pos' field of the returned messages, and
xg-check.c accesses and prints it.
2025-07-03 15:48:48 +02:00
Bruno Haible
762db318fc xgettext: Fix handling of syntax-checks with multi-domain POT files.
* gettext-tools/src/xgettext.c (main): Consider the total number of errors.
2025-07-03 11:19:38 +02:00
Bruno Haible
efb20317fb msggrep: Add new options -W and -S.
Reported at <https://savannah.gnu.org/bugs/?40489>.

* gettext-tools/src/msggrep.c (workflow_flags, sticky_flags): New variables.
(main): Initialize them. Handle the options -W and -S.
(usage): Document the -W and -S options.
(is_message_selected_no_invert): Return true if one of the specified workflow
flags or one of the specified sticky flags is set.
* gettext-tools/tests/msggrep-12: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/msggrep.texi: Document the -W and -S options.
* NEWS: Mention the change.
2025-07-03 08:48:44 +02:00
Bruno Haible
310e42a7a7 msggrep: Finish documenting the -X option (left-over from 2006-03-17).
* gettext-tools/doc/msggrep.texi: Mention the -X option in the summary.
2025-07-03 07:55:01 +02:00
Bruno Haible
86274f8321 Update NEWS after 0.25.1 release.
* NEWS: Mention 0.25.1 release.
2025-07-02 03:50:58 +02:00
Bruno Haible
027f0c7047 Merge from 0.25.x branch: Prepare for 0.25.1 release.
* gettext-tools/misc/autopoint.in: Accept versions 0.23.2, 0.24.2, 0.25.1.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.25.1.
* NEWS: Update.
2025-07-02 01:12:21 +02:00
Bruno Haible
81e3adea05 autopoint: Don't fail if no gettext version is specified, part 2.
* gettext-tools/misc/autopoint.in (func_trace_sed): Recognize also macro calls
without arguments.
* gettext-tools/tests/autopoint-1: Remove unneeded parentheses in macro call.
2025-07-01 22:44:09 +02:00
Bruno Haible
f451794c99 autopoint: Update unit test, part 2.
* gettext-tools/tests/autopoint-1: Remove debugging trace.
2025-07-01 16:56:49 +02:00
Bruno Haible
4b4a1bee4b autopoint: Update unit test.
* gettext-tools/tests/autopoint-1: Update for new autopoint behaviour.
2025-07-01 16:50:52 +02:00
Bruno Haible
d0e209799a Fix an autoreconf failure in packages that only need AM_NLS.
Rationale: https://lists.gnu.org/archive/html/bug-gettext/2025-06/msg00009.html

* gettext-tools/m4/Makefile.am (aclocaldir, aclocal_DATA): New variables.
* PACKAGING: Update.
2025-07-01 15:46:15 +02:00
Bruno Haible
dda9128815 autopoint: Don't fail if no gettext version is specified.
Rationale: https://lists.gnu.org/archive/html/bug-gettext/2025-06/msg00009.html

* gettext-tools/misc/autopoint.in: Instead of failing with "Missing version",
use version 0.23.1. Set omitintl=yes if there is no AM_GNU_GETTEXT invocation.
2025-07-01 15:46:15 +02:00
Bruno Haible
8d373b0656 Support reading PO files with '#=' lines.
* gettext-tools/src/read-catalog-abstract.c
(catalog_reader_seen_generic_comment): Treat '=' like ','.
* gettext-tools/src/read-catalog.c (default_comment_special): Allow several
calls to this method to make side effects on dcatr.
* gettext-tools/src/read-catalog-special.h: Update comment.
* gettext-tools/src/read-catalog-special.c: Likewise.
* gettext-tools/tests/msgcat-24: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-30 13:50:51 +02:00
Bruno Haible
c97fababab doc: Document the short-term PO file format evolution.
* gettext-tools/doc/gettext.texi (PO File Format Evolution): New section.
2025-06-30 13:50:43 +02:00
Bruno Haible
98cf2d1e31 doc: Structure the "PO Files" chapter.
* gettext-tools/doc (PO Files): Split into sections. Introduce workflow flags
and sticky flags. Mention the 'no-wrap' flag.
2025-06-30 13:50:39 +02:00
Bruno Haible
eff9937e4f Simplify code: The syntax-check flags are only used inside xgettext.
* gettext-tools/src/message.h: Improve comments regarding do_syntax_check.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Don't manipulate
do_syntax_check field.
* gettext-tools/src/msgmerge.c (message_merge): Likewise.
* gettext-tools/src/read-catalog-special.h (parse_comment_special): Change 'scp'
parameter to a pointer.
* gettext-tools/src/read-catalog-special.c (parse_comment_special): Support a
null 'scp' argument.
* gettext-tools/src/read-catalog.h (DEFAULT_CATALOG_READER_TY): Remove
do_syntax_check field.
* gettext-tools/src/read-catalog.c (default_constructor,
default_copy_comment_state, default_reset_comment_state,
default_comment_special): Don't reference do_syntax_check field.
2025-06-30 13:49:13 +02:00
Bruno Haible
eb92bff15a examples: Extend the hello-sh example, part 2.
* gettext-tools/examples/hello-sh/hello-2.sh: New file, based on
gettext-tools/examples/hello-sh/hello-1.sh.
* gettext-tools/examples/hello-sh/hello-3.sh: New file, based on
gettext-tools/examples/hello-sh/hello-2.sh.
2025-06-29 09:08:45 +02:00
Bruno Haible
35fee570e4 Tweak last commit.
* gettext-tools/src/msgcmp.c (main): Tweak whitespace.
2025-06-29 00:15:04 +02:00
Bruno Haible
3703298b8b Refactor: Use gnulib's 'options' module.
* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC, GNULIB_MODULES_TOOLS_FOR_SRC): Add
'options'. Remove 'getopt-gnu'.
* gettext-runtime/src/envsubst.c: Include options.h instead of <getopt.h>.
(long_options): Remove variable.
(main): Define options array here. Call start_options, get_next_option instead
of getopt_long().
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-runtime/src/printf_gettext.c: Likewise.
* gettext-runtime/src/printf_ngettext.c: Likewise.
* gettext-tools/src/cldr-plurals.c: Likewise.
* gettext-tools/src/hostname.c: Likewise.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/recode-sr-latin.c: Likewise.
* gettext-tools/src/urlget.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.
* gettext-tools/tests/tstgettext.c: Likewise.
* gettext-tools/tests/tstngettext.c: Likewise.
2025-06-28 23:48:03 +02:00
Bruno Haible
3028a28da5 Update to the newest gnulib. 2025-06-28 23:40:06 +02:00
Bruno Haible
836374b49a Adhere to GNU Coding Style.
* gettext-runtime/src/envsubst.c (main): Use common 'switch' indentation.
* gettext-tools/src/hostname.c (main): Likewise.
* gettext-tools/src/recode-sr-latin.c (main): Likewise.
* gettext-tools/src/urlget.c (main): Likewise.
* gettext-tools/tests/tstgettext.c (main): Likewise.
* gettext-tools/tests/tstngettext.c (main): Likewise.
2025-06-28 23:38:03 +02:00
Bruno Haible
8750e7ebb5 xgettext: Remove undocumented no-op option '-W'.
This was a regression from 2015-01-29.

* gettext-tools/src/xgettext.c (main): Remove short option '-W'.
2025-06-28 10:19:51 +02:00
Bruno Haible
8caa0b51ba msgconv, msgen, msgfilter, msggrep, msgmerge: The option '-n' takes no argument.
This was a regression from 2014-03-24.

* gettext-tools/src/msgconv.c (main): Change "n:" to "n" in getopt_long
argument.
* gettext-tools/src/msgen.c (main): Likewise.
* gettext-tools/src/msgfilter.c (main): Likewise.
* gettext-tools/src/msggrep.c (main): Likewise.
* gettext-tools/src/msgmerge.c (main): Likewise.
2025-06-28 10:18:22 +02:00
Bruno Haible
b719e5bfd2 Shell: Document two more approaches.
* gettext-tools/doc/lang-sh.texi (sh): Tweaks.
(sh - Three approaches): New subsubsection.
(The gettext.sh approach): New subsubsection, incorporating the "gettext.sh"
subsubsection.
(The printf approach, The printf_gettext approach): New subsubsections.
(Preparing for gettext.sh): Renamed from "Preparing Shell Scripts".
(Preparing for printf, Preparing for printf_gettext): New subsubsections.
* gettext-tools/doc/gettext.texi: Update detailed node list.
* NEWS: Mention the change.
2025-06-27 23:19:00 +02:00
Bruno Haible
f1fc656bcc examples: Extend the hello-sh example.
* gettext-tools/examples/hello-sh/hello-1.sh: Renamed from
gettext-tools/examples/hello-sh/hello.sh.
* gettext-tools/examples/hello-sh/hello-2.sh: New file, based on
gettext-tools/examples/hello-sh/hello-1.sh.
* gettext-tools/examples/hello-sh/hello-3.sh: New file, based on
gettext-tools/examples/hello-sh/hello-2.sh.
* gettext-tools/examples/hello-sh/configure.ac: Update AC_CONFIG_SRCDIR
invocation and AC_CONFIG_FILES invocations.
* gettext-tools/examples/hello-sh/Makefile.am (bin_SCRIPTS): Remove hello.
Add hello-1, hello-2, hello-3.
* gettext-tools/examples/hello-sh/po/Makefile.am (POTFILES): Remove hello.sh.
Add hello-1.sh, hello-2.sh, hello-3.sh.
* gettext-tools/examples/po/Makefile.am (POTFILES): Update accordingly.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES): Update file list.
2025-06-27 23:18:54 +02:00
Bruno Haible
702435bc02 Shell: Add another unit test.
* gettext-tools/tests/lang-sh-3: New file, based on
gettext-tools/tests/lang-sh-2.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-27 23:18:50 +02:00
Bruno Haible
3a763e6a6b build: Use module 'kwset' from gnulib.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_LIBGREP): Add kwset.
(GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES): Update.
* gettext-tools/libgrep/m-fgrep.c (Fcompile, Fexecute): Update for changed kwset
API.
* gettext-tools/libgrep/kwset.h: Remove file.
* gettext-tools/libgrep/kwset.c: Remove file.
* gettext-tools/libgrep/Makefile.am (libgrep_a_SOURCES): Remove kwset.h,
kwset.c.
2025-06-27 00:04:45 +02:00
Bruno Haible
af0d135964 Update to the newest gnulib. 2025-06-26 23:16:55 +02:00
Bruno Haible
a121288fc3 build: Update regarding current gnulib.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES): Update.
2025-06-26 23:16:55 +02:00
Bruno Haible
110552bc0a build: Fix "make distcheck" failure.
* gettext-runtime/man/*.x: Add copyright and license header.
2025-06-25 06:57:36 +02:00
Bruno Haible
f0bdc7524e xgettext: Shell: Recognize printf_gettext, printf_ngettext invocations.
* gettext-tools/src/x-sh.c (init_keywords, init_flag_table_sh): Add knowledge
about printf_gettext and printf_ngettext.
(read_command): Recognize '-c' option of printf_gettext and printf_ngettext.
* gettext-tools/tests/xgettext-sh-1: Add test cases with printf_gettext and
printf_ngettext.
* gettext-tools/doc/xgettext.texi: Document it.
2025-06-25 04:16:09 +02:00
Bruno Haible
22546c9c06 gettext-runtime: New programs 'printf_gettext', 'printf_ngettext'.
* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC): Add c-ctype, c-strtold,
fzprintf-posix, mbrtoc32, mbszero, quote, stdint-h, strtoimax, strtold,
strtoumax, xstrtold.
* gettext-runtime/src/printf-command.h: New file.
* gettext-runtime/src/printf-command.c: New file.
* gettext-runtime/src/printf_gettext.c: New file.
* gettext-runtime/src/Makefile.am (bin_PROGRAMS): Add printf_gettext,
printf_ngettext.
(noinst_LIBRARIES, libgrtsrc_a_SOURCES): New variables.
(printf_gettext_SOURCES, printf_gettext_CFLAGS, printf_gettext_LDFLAGS): New
variables.
(printf_ngettext_SOURCES, printf_ngettext_CFLAGS, printf_ngettext_LDFLAGS): New
variables.
(LDADD): Add libgrtsrc.a.
* gettext-runtime/po/POTFILES.in: Add src/printf-command.c,
src/printf_gettext.c, src/printf_ngettext.c.
* gettext-runtime/man/printf_gettext.x: New file.
* gettext-runtime/man/printf_ngettext.x: New file.
* gettext-runtime/man/Makefile.am (man_aux): Add printf_gettext.x,
printf_ngettext.x.
(man_MAN1GEN): Add printf_gettext.1, printf_ngettext.1.
(man_MAN1IN): Add printf_gettext.1.in, printf_ngettext.1.in.
(man_HTML1GEN): Add printf_gettext.1.html, printf_ngettext.1.html.
(man_HTML1IN): Add printf_gettext.1.html.in, printf_ngettext.1.html.in.
(printf_gettext.1, rintf_ngettext.1, printf_gettext.1.in, printf_ngettext.1.in):
Add dependencies.
(printf_gettext.1.html, printf_ngettext.1.html, printf_gettext.1.html.in,
printf_ngettext.1.html.in): Likewise.
* gettext-runtime/Makefile.am (distdir1): Depend on man/printf_gettext.1 and
man/printf_ngettext.1.
(man/printf_gettext.1, man/printf_ngettext.1): Depend on gen-man1.
(gen-man1): Make src/printf_gettext, src/printf_ngettext and printf_gettext.1,
printf_ngettext.1.
* gettext-runtime/doc/rt-printf_gettext.texi: New file.
* gettext-runtime/doc/rt-printf_ngettext.texi: New file.
* gettext-runtime/doc/Makefile.am (EXTRA_DIST): Add them.
* gettext-tools/doc/lang-sh.texi (printf_gettext Invocation,
printf_ngettext Invocation): New subsubsections.
* gettext-tools/doc/gettext.texi (@direntry): Add printf_gettext, .
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add rt-printf_gettext.texi,
rt-printf_ngettext.texi.
* gettext-runtime/NEWS: Mention the new programs.
* NEWS: Likewise.
* PACKAGING: Add the printf_gettext and printf_ngettext programs and their
documentation.
2025-06-25 04:16:03 +02:00
Bruno Haible
adf6e5709b gettext-runtime: Improve --help output.
* gettext-runtime/src/gettext.c (usage): Add section title
"Options and arguments".
* gettext-runtime/src/ngettext.c (usage): Likewise.
* gettext-runtime/doc/rt-gettext.texi: Add section titles
"Options and arguments" and "Informative output".
* gettext-runtime/doc/rt-ngettext.texi: Likewise.
2025-06-25 04:15:58 +02:00
Bruno Haible
338edb5ccc C++: Add another unit test.
* gettext-tools/tests/lang-c++-boost: New file, based on
gettext-tools/tests/lang-c++26.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/lang-c.texi: Mention how to use C++ with the Boost library.
* HACKING: Mention the Boost library.
2025-06-24 12:28:55 +02:00
Bruno Haible
fb7d214543 Shell: Add another unit test.
* gettext-tools/tests/lang-sh-1: Renamed from gettext-tools/tests/lang-sh.
* gettext-tools/tests/lang-sh-2: New file, based on
gettext-tools/tests/lang-sh-1.
* gettext-tools/tests/Makefile.am (TESTS): Remove lang-sh. Add lang-sh-1,
lang-sh-2.
2025-06-24 11:34:38 +02:00
Bruno Haible
b013095ee1 Python: Add another unit test.
* gettext-tools/tests/lang-python-2: New file, based on
gettext-tools/tests/lang-python-1.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-24 11:34:38 +02:00
Bruno Haible
51ec1c4157 Python: Update python-brace-format, assuming Python >= 3.1.
* gettext-tools/src/format-python-brace.c (struct toplevel_counters): New type.
(parse_directive): Take a 'struct toplevel_counters *' parameter. Allow empty
argument names at the top-level. But reject format strings with both absolute
argument numbers and unnamed arguments at the top-level.
(parse_upto): Take a 'struct toplevel_counters *' parameter.
(format_parse): Pass a 'struct toplevel_counters *' to parse_upto.
* gettext-tools/tests/format-python-brace-1: Update.
* gettext-tools/tests/format-python-brace-2: Add another test case.
* gettext-tools/doc/lang-python.texi: Add more examples of formatting with
positions.
2025-06-24 11:34:38 +02:00
Bruno Haible
340f82cfab Python: Fix bug in python-brace-format.
* gettext-tools/src/format-python-brace.c (parse_directive): The name ends
before ':', not before '}'.
2025-06-24 11:34:38 +02:00
Bruno Haible
78e9a5d2d9 Python: Remove an obsolete unit test.
Python versions < 2.3 are irrelevant nowadays.

* gettext-tools/tests/lang-python-1: Renamed from
gettext-tools/tests/lang-python-2.
* gettext-tools/tests/Makefile.am (TESTS): Remove lang-python-2.
2025-06-24 11:34:38 +02:00
Bruno Haible
baa7777077 Support format strings longer than 2 GiB on 64-bit platforms.
* gettext-tools/configure.ac: In config.h, define GCD_WORD_T.
* gettext-tools/src/format-invalid.h: In format strings, use %zu instead of %u.
* gettext-tools/src/format-awk.c: Use size_t instead of 'unsigned int'. In
format strings, use %zu instead of %u.
* gettext-tools/src/format-boost.c: Likewise.
* gettext-tools/src/format-c.c: Likewise.
* gettext-tools/src/format-c-parse.h: Likewise.
* gettext-tools/src/format-c++-brace.c: Likewise.
* gettext-tools/src/format-csharp.c: Likewise.
* gettext-tools/src/format-d.c: Likewise.
* gettext-tools/src/format-elisp.c: Likewise.
* gettext-tools/src/format-gcc-internal.c: Likewise.
* gettext-tools/src/format-gfc-internal.c: Likewise.
* gettext-tools/src/format-go.c: Likewise.
* gettext-tools/src/format-java.c: Likewise.
* gettext-tools/src/format-java-printf.c: Likewise.
* gettext-tools/src/format-javascript.c: Likewise.
* gettext-tools/src/format-kde.c: Likewise.
* gettext-tools/src/format-kde-kuit.c: Likewise.
* gettext-tools/src/format-librep.c: Likewise.
* gettext-tools/src/format-lisp.c: Likewise.
* gettext-tools/src/format-lua.c: Likewise.
* gettext-tools/src/format-modula2.c: Likewise.
* gettext-tools/src/format-pascal.c: Likewise.
* gettext-tools/src/format-perl.c: Likewise.
* gettext-tools/src/format-perl-brace.c: Likewise.
* gettext-tools/src/format-php.c: Likewise.
* gettext-tools/src/format-python.c: Likewise.
* gettext-tools/src/format-python-brace.c: Likewise.
* gettext-tools/src/format-qt.c: Likewise.
* gettext-tools/src/format-qt-plural.c: Likewise.
* gettext-tools/src/format-ruby.c: Likewise.
* gettext-tools/src/format-rust.c: Likewise.
* gettext-tools/src/format-scheme.c: Likewise.
* gettext-tools/src/format-sh.c: Likewise.
* gettext-tools/src/format-sh-printf.c: Likewise.
* gettext-tools/src/format-smalltalk.c: Likewise.
* gettext-tools/src/format-tcl.c: Likewise.
* gettext-tools/src/format.h (get_python_format_unnamed_arg_count): Return
size_t instead of 'unsigned int'.
2025-06-23 21:20:46 +02:00
Bruno Haible
ac4c1e3c84 Update to the newest gnulib. 2025-06-23 21:20:23 +02:00
Bruno Haible
6d1d57e158 gettext-runtime: Fix --help output in relocatable installations.
* gettext-runtime/src/gettext.c (usage): Show the relocated LOCALEDIR.
* gettext-runtime/src/ngettext.c (usage): Likewise.
2025-06-23 21:20:13 +02:00
Bruno Haible
4e7a638fd7 Adhere to GNU Coding Style.
* gettext-runtime/src/gettext.c (usage): Add space after 'printf'.
* gettext-runtime/src/ngettext.c (usage): Likewise.
* gettext-runtime/src/envsubst.c (usage): Likewise.
2025-06-23 21:20:07 +02:00
Bruno Haible
2fdcb6546c Add support for Shell printf format strings, part 3.
* gettext-tools/src/format-invalid.h (INVALID_FLAG_FOR): New macro.
* gettext-tools/src/format-java-printf.c (INVALID_FLAG_FOR): Remove macro.
* gettext-tools/src/format-sh-printf.c (format_parse): Reject format strings
with invalid flag+specifier combinations.
* gettext-tools/tests/format-sh-printf-1: Add more test cases.
* gettext-tools/doc/gettext.texi (sh-format): Mention the ' flag.
2025-06-23 21:20:02 +02:00
Bruno Haible
c6373812d7 Add support for Shell printf format strings, part 2.
* gettext-tools/po/POTFILES.in: Add src/format-sh-printf.c.
* gettext-tools/tests/format-sh-printf-1: Use 'printf' instead of 'echo',
because 'echo' processes escape sequences on macOS, OpenBSD, Solaris.
2025-06-23 21:19:56 +02:00
Bruno Haible
c93b9f3976 Add support for Shell printf format strings.
* gettext-tools/src/message.h (enum format_type): Add format_sh_printf.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_sh_printf.
* gettext-tools/src/format.h (formatstring_sh_printf): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add an entry for
format_sh_printf.
* gettext-tools/src/format-sh-printf.c: New file, based on
gettext-tools/src/format-awk.c.
* gettext-tools/src/FILES: Mention it.
* gettext-tools/src/x-sh.h (SCANNERS_SH): Use formatstring_sh_printf as
secondary format string type.
* gettext-tools/src/xgettext.c (xgettext_record_flag): Update accordingly.
* gettext-tools/src/x-sh.c (init_flag_table_sh): Register gettext, ngettext with
flag 'pass-sh-printf-format'. Register 'printf' with flag 'sh-printf-format'.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-sh-printf.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Likewise.
* gettext-tools/doc/gettext.texi (PO Files): Mention sh-printf-format.
(sh-format): Document also the sh-printf-format strings.
* gettext-tools/doc/lang-sh.texi (sh): Mention the coreutils 'printf' command.
* gettext-tools/tests/xgettext-sh-1: Add a test case with a printf invocation.
* gettext-tools/tests/format-sh-printf-1: New file, based on
gettext-tools/tests/format-awk-1.
* gettext-tools/tests/format-sh-printf-2: New file, based on
gettext-tools/tests/format-awk-2.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* NEWS: Mention the change.
2025-06-22 10:56:59 +02:00
Bruno Haible
6d6241d0fe tcl-format: Accept null precision.
Proof that it's valid:
$ tclsh
puts [format "%.f" 3.1415926535]

* gettext-tools/src/format-tcl.c: Fix comment regarding the precision.
* gettext-tools/tests/format-tcl-1: Add a test case with null precision.
2025-06-22 03:17:40 +02:00
Bruno Haible
a0fbd6869b rust-format: Reject null precision.
* gettext-tools/tests/format-rust-1: Add more test cases with null precision.
2025-06-22 03:12:44 +02:00
Bruno Haible
5b2a00875c ruby-format: Accept null precision.
Proof that it's valid:
$ ruby
puts "%.f" % 3.1415926535

* gettext-tools/src/format-ruby.c: Clarify comment regarding the precision.
* gettext-tools/tests/format-ruby-1: Add test cases with null precision.
2025-06-22 03:09:48 +02:00
Bruno Haible
3e846209ca python-brace-format: Reject null precision.
Proof that it's invalid:
$ python
print("{value:.}".format(value = 3.141592535))

* gettext-tools/tests/format-python-brace-1: Add another test case with null
precision.
2025-06-22 02:58:31 +02:00
Bruno Haible
b6ea1c2cbe python-format: Accept null precision.
Proof that it's valid:
$ python
print("%(value).f" % { 'value': 3.1415926535 })

* gettext-tools/src/format-python.c: Fix comment regarding the precision.
* gettext-tools/tests/format-python-1: Add a test case with null precision.
2025-06-22 02:48:26 +02:00
Bruno Haible
c0a5ed0180 php-format: Reject null precision.
Rationale: The handling of null precision in php is buggy,
cf. <https://github.com/php/php-src/issues/18897>.

* gettext-tools/src/format-php.c: Fix comment regarding the precision.
* gettext-tools/tests/format-php-1: Add a test case with null precision.
2025-06-22 02:38:50 +02:00
Bruno Haible
3c4aff9b3b perl-format: Accept null precision.
Proof that it's valid:
$ perl
printf "%.f", 3.1415926535

* gettext-tools/src/format-perl.c: Clarify comment regarding the precision.
* gettext-tools/tests/format-perl-1: Add a test case with null precision.
2025-06-22 02:16:38 +02:00
Bruno Haible
fd6617fb54 pascal-format: Accept null precision.
Proof that it's valid:
------------------------- foo.pp -------------------------
program foo;
uses sysutils;
begin
  writeln(format('%.f', [3.1415926535]));
end.
----------------------------------------------------------

* gettext-tools/src/format-pascal.c: Fix comment regarding the precision.
(format_parse): Accept a null precision after '.'.
* gettext-tools/tests/format-pascal-1: Add a test case with null precision.
2025-06-22 02:11:33 +02:00
Bruno Haible
6c569a0012 lua-format: Accept null precision. Limit width and precision to two digits.
Proof that it's valid:
$ lua
print(string.format("%.f", 3.1415926535))

* gettext-tools/src/format-lua.c: Fix comment regarding the width and the
precision.
(format_parse): Recognize at most two digits for the width. Recognize at most
two digits for the precision.
* gettext-tools/tests/format-lua-1: Add test cases with large width, null
precision, and large precision.
2025-06-22 01:37:58 +02:00
Bruno Haible
6859ac3476 librep-format: Accept null precision.
Proof that it's valid:
$ rep
(format t "%.d" 3.1415926535)

* gettext-tools/src/format-librep.c: Fix comment regarding the precision.
* gettext-tools/tests/format-librep-1: Add a test case with null precision.
2025-06-22 01:30:12 +02:00
Bruno Haible
5a22e428a6 javascript-format: Reject null precision.
Proof that it's invalid:
------------------------------- foo.js -------------------------------
const Format = imports.format;
String.prototype.format = Format.format;
print("%.f".format(3.1415916535));
----------------------------------------------------------------------
$ gjs foo.js

* gettext-tools/src/format-invalid.h (INVALID_PRECISION_MISSING): New macro.
* gettext-tools/src/format-java-printf.c (INVALID_PRECISION_MISSING): Remove
macro.
* gettext-tools/src/format-javascript.c: Fix comment regarding the precision.
(format_parse): Report an error if the precision is null (empty).
* gettext-tools/tests/format-javascript-1: Add a test case with null precision.
2025-06-22 01:20:32 +02:00
Bruno Haible
96d16fc051 java-printf-format: Reject null precision.
Proof that it's invalid:
--------------------------- foo.java ---------------------------
public class foo {
  public static void main(String[] args) {
    System.out.println(String.format("%.f\n", 3.1415926535));
  }
}
----------------------------------------------------------------

* gettext-tools/tests/format-java-printf-1: Add a test case with null precision.
2025-06-22 01:12:35 +02:00
Bruno Haible
b5d6f12371 go-format: Accept null precision.
* gettext-tools/src/format-go.c: Clarify comment regarding the precision.
(format_parse): Accept a null precision after '.'.
* gettext-tools/tests/format-go-1: Add a test case with null precision.
2025-06-22 01:08:15 +02:00
Bruno Haible
d29d2aa61a elisp-format: Accept null precision.
Proof that is is valid:
(format "%.f" 3.1415926)

* gettext-tools/src/format-elisp.c: Fix comment regarding the precision.
* gettext-tools/tests/format-elisp-1: Add a test case with null precision.
2025-06-22 00:54:23 +02:00
Bruno Haible
36f19a58d5 d-format: Accept null precision.
Proof that a null precision is valid:
------------------------------- foo.d -------------------------------
import std.stdio;
import std.format;
void main () { writeln (format ("%.f", 3.1415926)); }
---------------------------------------------------------------------

* gettext-tools/tests/format-d-1: Add a test case with null precision.
2025-06-22 00:16:28 +02:00
Bruno Haible
688d443b26 c-format: Accept null precision.
* gettext-tools/src/format-c-parse.h: Fix comment regarding the precision and
the ISO C23 size specifiers.
* gettext-tools/tests/format-c-1: Add a test case with null precision.
2025-06-21 23:49:24 +02:00
Bruno Haible
b470e7eb26 boost-format: Accept null precision.
* gettext-tools/src/format-boost.c: Fix comment regarding the precision.
* gettext-tools/tests/format-boost-1: Add a test case with null precision.
2025-06-21 23:45:59 +02:00
Bruno Haible
2305b059e2 awk-format: Accept null precision.
Proof that it's valid:
$ echo 3.1415926 | gawk '{ printf "%.f", $1 }'

* gettext-tools/src/format-awk.c: Fix comment regarding the precision.
* gettext-tools/tests/format-awk-1: Add a test case with null precision.
2025-06-21 23:36:00 +02:00
Bruno Haible
3e7c882bd7 xgettext: Shell: Reject \u and \U escape sequences that produce surrogates.
* gettext-tools/src/x-sh.c (read_word): Reject \u and \U values in the range
0xD800..0xDFFF.
* gettext-tools/tests/xgettext-sh-9: Add more test cases.
2025-06-21 06:49:23 +02:00
Bruno Haible
06858e5651 xgettext: Shell: Bump phase1_pushback buffer size.
* gettext-tools/src/x-sh.c (phase1_pushback): Bump size to 9.
* gettext-tools/tests/xgettext-sh-8: Add more test cases.
2025-06-21 06:46:55 +02:00
Bruno Haible
81c37f4901 xgettext: Shell: Recognize \u and \U escape sequences in $'...' strings.
* gettext-tools/src/xg-mixed-string.h (mixed_string_remove_prefix,
mixed_string_buffer_equals, mixed_string_buffer_startswith,
mixed_string_buffer_cloned_result): New declarations.
* gettext-tools/src/xg-mixed-string.c (mixed_string_remove_prefix): New
function.
(mixed_string_buffer_is_empty): Also test the absence of utf16_surr.
(mixed_string_buffer_equals, mixed_string_buffer_startswith,
mixed_string_buffer_cloned_result): New functions.
* gettext-tools/src/x-sh.c (struct token): Remove type.
(init_token, free_token, grow_token, string_of_token): Remove functions.
(struct word): Change type of 'token' field.
(free_word): Update.
(string_of_word, substring_of_word): Remove functions.
(read_word): Call mixed_string_buffer_init instead of init_token,
mixed_string_buffer_destroy instead of free_token,
mixed_string_buffer_append_char instead of grow_token. Update accesses to
wp->token. Recognize \u and \U escape sequences in $'...' strings.
(read_command): Call mixed_string_buffer_cloned_result instead of
string_of_word. Update accesses to inner.token.
* gettext-tools/tests/xgettext-sh-7: Use --from-code option.
* gettext-tools/tests/xgettext-sh-9: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention this and the previous change.
2025-06-21 02:53:23 +02:00
Bruno Haible
6ced019bdd xgettext: Shell: Recognize \c escape sequences in $'...' strings.
* gettext-tools/src/x-sh.c (read_word): Recognize \c escape sequences.
* gettext-tools/tests/xgettext-sh-1: Add test cases with ASCII $'...' strings.
2025-06-21 02:53:18 +02:00
Bruno Haible
528364fd5d tests: Avoid a test failure with valgrind.
* gettext-tools/tests/xgettext-python-9: Filter out the valgrind traces.
2025-06-21 02:51:44 +02:00
Bruno Haible
91cb1f1cbb Fix 'make installcheck' failure on Cygwin.
* gettext-tools/configure.ac (INSTALLED_LIBINTL, INSTALLED_LIBGETTEXTPO_DEPS):
New variables.
* gettext-tools/install-tests/Makefile.am (installcheck): Use
INSTALLED_LIBGETTEXTPO_DEPS.
2025-06-20 02:48:46 +02:00
Bruno Haible
ec07a48b8f Reject the dysfunctional gettext in Solaris libc, other than Solaris 11.4.
This fixes a 'make installcheck' failure.

<https://www.illumos.org/issues/13423> has been reported more than 4 years ago.
I don't have hope that they will fix it, ever.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): On Solaris other than
Solaris 11.4, don't use the gettext() function in libc.
* gettext-tools/tests/init.cfg (prepare_locale_): Remove function.
* gettext-tools/tests/format-c-3: Remove prepare_locale_ invocations.
* gettext-tools/tests/format-c-4: Likewise.
* gettext-tools/tests/format-c-5: Likewise.
* gettext-tools/tests/intl-0: Likewise.
* gettext-tools/tests/intl-1: Likewise.
* gettext-tools/tests/intl-2: Likewise.
* gettext-tools/tests/intl-3: Likewise.
* gettext-tools/tests/intl-4: Likewise.
* gettext-tools/tests/intl-6: Likewise.
* gettext-tools/tests/intl-7: Likewise.
* gettext-tools/tests/intl-thread-1: Likewise.
* gettext-tools/tests/intl-thread-2: Likewise.
* gettext-tools/tests/intl-thread-3: Likewise.
* gettext-tools/tests/lang-bash: Likewise.
* gettext-tools/tests/lang-c: Likewise.
* gettext-tools/tests/lang-c++: Likewise.
* gettext-tools/tests/lang-c++20: Likewise.
* gettext-tools/tests/lang-c++26: Likewise.
* gettext-tools/tests/lang-clisp: Likewise.
* gettext-tools/tests/lang-csharp: Likewise.
* gettext-tools/tests/lang-d: Likewise.
* gettext-tools/tests/lang-gawk: Likewise.
* gettext-tools/tests/lang-go: Likewise.
* gettext-tools/tests/lang-guile: Likewise.
* gettext-tools/tests/lang-java: Likewise.
* gettext-tools/tests/lang-javascript: Likewise.
* gettext-tools/tests/lang-librep: Likewise.
* gettext-tools/tests/lang-lua: Likewise.
* gettext-tools/tests/lang-modula2: Likewise.
* gettext-tools/tests/lang-objc: Likewise.
* gettext-tools/tests/lang-pascal: Likewise.
* gettext-tools/tests/lang-perl-1: Likewise.
* gettext-tools/tests/lang-perl-2: Likewise.
* gettext-tools/tests/lang-php: Likewise.
* gettext-tools/tests/lang-python-1: Likewise.
* gettext-tools/tests/lang-python-2: Likewise.
* gettext-tools/tests/lang-ruby: Likewise.
* gettext-tools/tests/lang-rust: Likewise.
* gettext-tools/tests/lang-sh: Likewise.
* gettext-tools/tests/lang-smalltalk: Likewise.
* gettext-tools/tests/lang-tcl: Likewise.
* gettext-tools/tests/lang-vala: Likewise.
* gettext-tools/tests/msgfmt-20: Likewise.
* gettext-tools/tests/plural-1: Likewise.
* NEWS: Mention the change.
2025-06-19 22:35:17 +02:00
Bruno Haible
04ccbe28b3 Fix 'make installcheck' failure on Cygwin.
* gettext-runtime/configure.ac (INSTALLED_LIBINTL): Add $LIBICONV.
2025-06-19 18:04:34 +02:00
Bruno Haible
2c41b836e6 Deprecate the gfc-internal-format flag.
* gettext-tools/src/format-gfc-internal.c: Update comment.
* gettext-tools/doc/gettext.texi (PO Files): Mark gfc-internal-format as
deprecated.
(gfc-internal-format): Mention "up to GCC 14".
2025-06-19 13:36:10 +02:00
Bruno Haible
65a6890f38 xgettext: GCC-source: Disable gfc-format-internal recognition.
* gettext-tools/src/x-c.h (SCANNERS_C): Replace formatstring_gfc_internal with
NULL.
* gettext-tools/tests/format-gfc-internal-1: Remove file.
* gettext-tools/tests/Makefile.am (TESTS): Remove it.
2025-06-19 13:36:04 +02:00
Bruno Haible
790fc440df Strengthen gcc-internal-format: Check that %< %>, %r %R, %{ %} come in pairs.
* gettext-tools/src/format-gcc-internal.c (format_parse): New local variables
in_quote_group, in_color_group, in_url_group. Add pairing checks for %< %>,
%r %R, %{ %}.
* gettext-tools/tests/format-gcc-internal-1: Update.
* gettext-tools/tests/format-gcc-internal-2: Update.
2025-06-19 13:35:55 +02:00
Bruno Haible
82ddb51455 Update gcc-internal-format for GCC 15.
Reported by Roland Illig, Andrew Pinski, Jakub Jelinek in
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119684>.
Also reported by Roland Illig in
<https://savannah.gnu.org/bugs/?50450>, <https://savannah.gnu.org/bugs/?50461>.

* gettext-tools/src/format-gcc-internal.c: Update for GCC 15.
* gettext-tools/tests/format-gcc-internal-1: Likewise.
* gettext-tools/tests/format-gcc-internal-2: Likewise.
* gettext-tools/doc/gettext.texi (gcc-internal-format): Likewise.
2025-06-19 13:35:46 +02:00
Bruno Haible
39b426b503 gettext-runtime: Fix "make installcheck" failure on MSVC with --enable-shared.
* gettext-runtime/intl/Makefile.am (libintl.h): Insert '__declspec (dllimport)'
in the variable declarations, like in libgnuintl.h.
2025-06-19 13:35:05 +02:00
Bruno Haible
eb587aa2a9 gettext-tools: Implement 'installcheck' target.
* gettext-tools/install-tests/test-version.c: New file.
* gettext-tools/install-tests/test-api.c: New file.
* gettext-tools/install-tests/de.po: New file.
* gettext-tools/install-tests/Makefile.am: New file.
* gettext-tools/configure.ac (PATH_SEPARATOR, AUGMENT_SHLIBPATH): New variables.
(AC_CONFIG_FILES): Add install-tests/Makefile.
* gettext-tools/Makefile.am (SUBDIRS): Add install-tests.
2025-06-19 11:51:30 +02:00
Bruno Haible
04f810d727 gettext-runtime: Implement 'installcheck' target.
* gettext-runtime/install-tests/test-version.c: New file.
* gettext-runtime/install-tests/test-api.c: New file.
* gettext-runtime/install-tests/itest.pot: New file.
* gettext-runtime/install-tests/locale/en_US/LC_MESSAGES/itest.mo: New file.
* gettext-runtime/install-tests/Makefile.am: New file.
* gettext-runtime/configure.ac (INSTALLED_LIBINTL, PATH_SEPARATOR,
AUGMENT_SHLIBPATH): New variables.
(AC_CONFIG_FILES): Add install-tests/Makefile.
* gettext-runtime/Makefile.am (SUBDIRS): Add install-tests.
2025-06-19 11:49:05 +02:00
Bruno Haible
caf86941ba libtextstyle: Implement 'installcheck' target.
* libtextstyle/install-tests/test-version.c: New file.
* libtextstyle/install-tests/test-api.c: New file.
* libtextstyle/install-tests/Makefile.am: New file.
* libtextstyle/configure.ac (AUGMENT_SHLIBPATH): New variable.
(AC_CONFIG_FILES): Add install-tests/Makefile.
* libtextstyle/Makefile.am (SUBDIRS): Add install-tests.
2025-06-19 11:45:26 +02:00
Bruno Haible
0ed33456eb build: Simplify.
* gettext-runtime/configure.ac (LIBSCHED): Remove variable.
2025-06-14 20:04:37 +02:00
Bruno Haible
e5c1be0451 Improve config.log traces.
* gettext-runtime/m4/progtest.m4 (AM_PATH_PROG_WITH_TEST): Emit the configure
line number into config.log.
2025-06-12 19:12:19 +02:00
Bruno Haible
3dbf4a9b3b build: Simplify handling of exported symbols on Windows, part 2.
* gettext-tools/configure.ac (WINDOWS_MSVC): New conditional.
* gnulib-local/modules/gettext-tools-misc (Makefile.am): Re-add the
--export-all-symbols linker option.
* gettext-tools/src/Makefile.am (libgettextsrc_la_LDFLAGS): Re-add the
--export-all-symbols linker option.
2025-06-08 23:09:37 +02:00
Bruno Haible
8000b5d9e3 gettext.m4: Recognize the shared GNU libintl on MSVC.
Reported by Kirill Makurin <maiddaisuki@outlook.com>
in <https://lists.gnu.org/archive/html/bug-m4/2025-06/msg00000.html>.

* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): On MSVC, don't try to use
_nl_msg_cat_cntr.
* NEWS: Mention it.
2025-06-07 05:01:34 +02:00
Bruno Haible
3d38aeb7d9 build: Simplify handling of exported symbols on Windows.
* gnulib-local/modules/gettext-tools-misc (Makefile.am): Don't compile
gettextlib-exports.c. Don't add now-redundant --export-all-symbols linker
option. Don't use GETTEXTLIB_EXPORTS_FLAGS.
* gettext-tools/src/Makefile.am (libgettextsrc_la_SOURCES): Don't add
gettextsrc-exports.c.
(libgettextsrc_la_LDFLAGS): Don't add now-redundant --export-all-symbols linker
option.
(libgettextsrc_la_CPPFLAGS): Don't add $(GETTEXTLIB_EXPORTS_FLAGS).
* gettext-tools/configure.ac (GETTEXTLIB_EXPORTS_FLAGS): Remove variable.
* gettext-tools/woe32dll/gettextlib-exports.c: Remove file.
* gettext-tools/woe32dll/gettextsrc-exports.c: Remove file.
* gettext-tools/woe32dll/export.h: Update comments.
2025-06-07 04:06:16 +02:00
Bruno Haible
b6d13dc267 build: Fix build error on MSVC with --enable-shared.
* autogen.sh: Avoid the float-h-tests, since they reference the variables
gl_FLT_SNAN, gl_DBL_SNAN, gl_LDBL_SNAN.
2025-06-06 19:44:05 +02:00
Bruno Haible
bc159575b7 build: Fix build failure on Cygwin and mingw without preinstalled libunistring.
* gettext-tools/configure.ac: Define DLL_VARIABLE and LIBGETTEXTSRC_DLL_VARIABLE
on Cygwin and mingw like on MSVC.
2025-06-06 15:34:31 +02:00
Bruno Haible
589f38cb99 libtextstyle: Fix build failure on Cygwin < 3.4.6.
* libtextstyle/lib/Makefile.am (config.h): Don't rename the _imp_ variable
associated with the gl_get_setlocale_null_lock function.
2025-06-06 12:56:05 +02:00
Bruno Haible
28198a8621 tests: xgettext-scheme-6: Fix potential conflict with xgettext-scheme-7.
* gettext-tools/tests/xgettext-scheme-6: Use common file name idiom.
2025-06-05 21:43:31 +02:00
Bruno Haible
26a6fa7729 build: Fix "make install" in MSVC builds with --enable-shared.
The problem was that intl-8.dll was not installed with execute permissions.

* gettext-runtime/intl/Makefile.am (install-exec-libintl): Use $(INSTALL),
not $(INSTALL_DATA), with libtool --mode=install.
* INSTALL.windows: Remove constraint to use --disable-shared on MSVC.
2025-06-05 21:43:27 +02:00
Bruno Haible
f02b67c633 build: Fix MSVC builds with --enable-shared.
This was a regression in commit 8e914861708ed459a2ae8157eb60d89375ab46cd
from 2023-09-06.

Thanks to Kirill Makurin <maiddaisuki@outlook.com> for fruitful discussions.

* autogen.sh: Among the gnulib-tests, avoid the modules array-map-tests,
array-oset-tests, carray-list-tests, and uninorm/decomposing-form-tests, since
they use variables from libgettextlib.
* gettext-tools/configure.ac (GL_GNULIB_LIBUNISTRING_DLL_VARIABLE_NAME): New
variable.
(WOE32DLL): New C macro.
(DLL_VARIABLE): On MSVC with --enable-shared, define to '__declspec(dllexport)'
when compiling libgettextlib, and define to '__declspec(dllimport)' when
compiling the programs in src/.
(LIBGETTEXTSRC_DLL_VARIABLE): New C macro.
* gettext-tools/gnulib-lib/Makefile.am (AM_CPPFLAGS): Define the C macro
IN_LIBGETTEXTLIB.
* gettext-tools/src/Makefile.am (libgettextsrc_la_CPPFLAGS): Define the C macro
IN_LIBGETTEXTSRC.
* gettext-tools/src/format.h: Use LIBGETTEXTSRC_DLL_VARIABLE instead of
DLL_VARIABLE.
* gettext-tools/src/message.h: Likewise.
* gettext-tools/src/msgl-cat.h: Likewise.
* gettext-tools/src/plural-table.h: Likewise.
* gettext-tools/src/po-charset.h: Likewise.
* gettext-tools/src/po-error.h: Likewise.
* gettext-tools/src/read-catalog.h: Likewise.
* gettext-tools/src/read-po.h: Likewise.
* gettext-tools/src/read-properties.h: Likewise.
* gettext-tools/src/read-stringtable.h: Likewise.
* gettext-tools/src/sentence.h: Likewise.
* gettext-tools/src/write-po.h: Likewise.
* gettext-tools/src/write-properties.h: Likewise.
* gettext-tools/src/write-stringtable.h: Likewise.
* gettext-tools/src/xerror-handler.h: Likewise.
* gettext-tools/libgettextpo/Makefile.am (config.h): Override the value of
LIBGETTEXTSRC_DLL_VARIABLE.
* gettext-runtime/configure.ac (WOE32DLL): New C macro.
(DLL_VARIABLE): Define to empty always.
2025-06-05 21:43:23 +02:00
Bruno Haible
3dae6dee52 Update to the newest gnulib. 2025-06-05 21:43:19 +02:00
Bruno Haible
b5c42c062c Fix compilation error on MSVC due to conflict of different stdlib.h files.
Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00071.html>.

* autogen.sh: Change gnulib-tool invocation for libgrep.
* gettext-tools/configure.ac (AC_CONFIG_FILES): Add libgrep/gnulib-lib/Makefile.
* gettext-tools/libgrep/Makefile.am: Don't include Makefile.gnulib.
(SUBDIRS): New variable.
(noinst_LIBRARIES): Add libgrep.a.
(AM_CPPFLAGS): Add -I options for gnulib-lib subdirectory.
(libgrep_a_DEPENDENCIES): New variable.
* gettext-tools/libgrep/gnulib-lib/Makefile.am: New file.
* gettext-tools/src/Makefile.am (LIBGREP): Add ../libgrep/gnulib-lib/libgnu.a.
2025-06-05 21:43:15 +02:00
Bruno Haible
e6b7b7939f build: Fix some crashes when building with --enable-shared on MSVC, part 2.
* gettext-tools/woe32dll/gettextlib-exports.c: Export also
gl_carray_list_implementation, gl_hash_map_implementation,
gl_hash_set_implementation, gl_linked_list_implementation.
2025-06-03 00:33:34 +02:00
Bruno Haible
3ef1d9ee84 tests: Fix test failure when rxgettext is not installed.
* gettext-tools/tests/format-ruby-3: Skip test if rxgettext is not installed.
2025-06-02 13:06:28 +02:00
Collin Funk
12bd8c45bb Update a country name.
* gettext-tools/doc/ISO_3166: Use "Eswatini" instead of "Swaziland".
* gettext-tools/doc/iso-3166.texi: Likewise.
2025-06-02 12:04:50 +02:00
Bruno Haible
a9583d31f7 Add a NEWS entry.
* NEWS: Mention the format string heuristic improvements.
2025-06-02 02:23:00 +02:00
Bruno Haible
e24ce889ee xgettext: Tcl: Improve heuristic for format strings.
* gettext-tools/src/format-tcl.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_tcl): Use it.
* gettext-tools/tests/format-tcl-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:57 +02:00
Bruno Haible
090868dedb xgettext: Ruby: Improve heuristic for format strings.
* gettext-tools/src/format-ruby.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_ruby): Use it.
* gettext-tools/tests/format-ruby-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:55 +02:00
Bruno Haible
1313c94003 xgettext: Python: Improve heuristic for format strings.
* gettext-tools/src/format-python.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_python): Use it.
* gettext-tools/tests/format-python-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:53 +02:00
Bruno Haible
dacdbfec87 xgettext: PHP: Improve heuristic for format strings.
* gettext-tools/src/format-php.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_php): Use it.
* gettext-tools/tests/format-php-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:50 +02:00
Bruno Haible
64784c018a xgettext: Perl: Improve heuristic for format strings.
* gettext-tools/src/format-perl.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_perl): Use it.
* gettext-tools/tests/format-perl-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:47 +02:00
Bruno Haible
93da58d7a9 xgettext: librep: Improve heuristic for format strings.
* gettext-tools/src/format-librep.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_librep): Use it.
* gettext-tools/tests/format-librep-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:45 +02:00
Bruno Haible
ccd07974b0 xgettext: JavaScript: Improve heuristic for format strings.
* gettext-tools/src/format-javascript.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_javascript): Use it.
* gettext-tools/tests/format-javascript-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:42 +02:00
Bruno Haible
417ca6acd5 xgettext: Go: Improve heuristic for format strings.
* gettext-tools/src/format-go.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_go): Use it.
* gettext-tools/tests/format-go-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:40 +02:00
Bruno Haible
4d561233cb xgettext: Emacs Lisp: Improve heuristic for format strings.
* gettext-tools/src/format-elisp.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_elisp): Use it.
* gettext-tools/tests/format-elisp-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:37 +02:00
Bruno Haible
99529c200d xgettext: D: Improve heuristic for format strings.
* gettext-tools/src/format-d.c (struct spec): Add field
'likely_intentional_directives'.
(parse_upto): Increment it for each directive that don't contain a space.
(format_parse): Initialize it.
(format_is_unlikely_intentional): New function.
(formatstring_d): Use it.
* gettext-tools/tests/format-d-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:22:17 +02:00
Bruno Haible
796875721a xgettext: C++: Improve heuristic for Boost format strings.
* gettext-tools/src/format-boost.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_boost): Use it.
* gettext-tools/tests/format-boost-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:21:15 +02:00
Bruno Haible
cdc6870c77 xgettext: C: Improve heuristic for format strings.
* gettext-tools/src/format-c-parse.h (struct spec): Add field
'likely_intentional_directives'.
(format_parse_entrails): Set it to the number of directives that don't contain
a space.
* gettext-tools/src/format-c.c (format_is_unlikely_intentional): Also test the
'likely_intentional_directives' field.
* gettext-tools/tests/format-c-6: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:21:06 +02:00
Bruno Haible
b330ce7804 xgettext: awk: Improve heuristic for format strings.
* gettext-tools/src/format-awk.c (struct spec): Add field
'likely_intentional_directives'.
(format_parse): Set it to the number of directives that don't contain a space.
(format_is_unlikely_intentional): New function.
(formatstring_awk): Use it.
* gettext-tools/tests/format-awk-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
2025-06-02 02:21:01 +02:00
Bruno Haible
a7c6eeefd6 D: Fix handling of %% directive in format string parser.
* gettext-tools/src/format-d.c (parse_upto): Add matching FMTDIR_END also for
the %% directive.
2025-06-02 02:19:23 +02:00
Bruno Haible
0ec47cb58f Avoid warnings from "gcc -Wextra".
Reported by Collin Funk in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00280.html>.

* gnulib-local/lib/gettext.h (gettext, dgettext, dcgettext): Silence
-Wbuiltin-declaration-mismatch warning.
2025-06-01 12:26:40 +02:00
Bruno Haible
1054fd3dac Fix compilation error on Solaris 11 (regr. 2025-05-28).
* gnulib-local/lib/gettext.h (gettext, dgettext, dcgettext): On Solaris, use
'char *' as return type.
2025-06-01 01:17:42 +02:00
Bruno Haible
d1050df577 build: Fix some crashes when building with --enable-shared on MSVC.
Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00087.html>.

* gnulib-local/lib/gl_carray_list.h.diff: New file.
* gnulib-local/lib/gl_hash_map.h.diff: New file.
* gnulib-local/lib/gl_hash_set.h.diff: New file.
* gnulib-local/lib/gl_linked_list.h.diff: New file.
* gnulib-local/Makefile.am (EXTRA_DIST): Add them.
2025-05-31 17:34:38 +02:00
Bruno Haible
f744352a02 build: Mark automake 1.18 as supported.
* autogen.sh: Update comment.
* m4/fixautomake.m4 (FIX_MAKEFILE_DISTRIB): Likewise.
2025-05-31 15:24:26 +02:00
Bruno Haible
0e5230554b doc: For MSVC, recommend to avoid the preinstalled libunistring.
This fixes an "initializer is not a constant" error upon use of uninorm_nfc.
Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00076.html>.

* INSTALL.windows: For MSVC, recommend --with-included-libunistring.
2025-05-31 13:32:03 +02:00
Bruno Haible
8d8ad10907 build: Tweak option for MSVC.
Suggested by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00071.html>.

* gettext-tools/src/Makefile.am (xgettext_LDFLAGS): Use an MSVC option with '-'
instead of '/', for resilience against the (unsupported) MSYS2.
2025-05-31 13:04:16 +02:00
Bruno Haible
087018bf48 Avoid gcc -Wformat-security warnings with --disable-nls.
Reported by Holger Hoffstätte <holger@applied-asynchrony.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00225.html>.

* gnulib-local/lib/gettext.h (gettext, dgettext, dcgettext): With gcc in C mode,
define these as inline functions.
2025-05-28 16:50:19 +02:00
Bruno Haible
2fb3d868b2 xgettext: JavaScript: Parse RegExp literals according to ECMA-262 15th edition.
Reported by Christian Wasserthal <aperion@fsfe.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-05/msg00038.html>.

* gettext-tools/src/x-javascript.c (phase5_scan_regexp): Report an error when
end-of-line is reached. Parse character classes. Recognize more modifier flags.
* gettext-tools/tests/xgettext-javascript-2: Add two more test cases.
* NEWS: Mention the change.
2025-05-20 19:36:55 +02:00
Bruno Haible
7f9ef13e48 doc: Update, now that autopull.sh does more than a gnulib checkout.
* autogen.sh: Update comments.
* HACKING: Improve formatting.
2025-05-16 11:31:00 +02:00
Bruno Haible
f09ee6c69d Refactor: Fix a compiler warning.
* gettext-tools/src/x-perl.c: Remove a stray ';'.
2025-05-11 03:27:45 +02:00
Bruno Haible
3eba2cddb0 Refactor: Fix typo in function name.
* gettext-tools/src/x-d.c (extract_from_template_instantiation): Renamed from
extract_from_template_instantation.
2025-05-11 03:25:42 +02:00
Bruno Haible
5760f91681 Update after gnulib changed.
* gettext-tools/src/msgl-iconv.h (convert_string_desc_directly): Change result
type to rw_string_desc_t.
* gettext-tools/src/msgl-iconv.c (convert_string_desc_directly): Likewise.
* gettext-tools/src/its.c (_its_is_valid_simple_gen_xml): Omit casts to
'char *'. Don't use sd_c_casecmp, sd_cmp as function pointers.
* gettext-tools/src/xg-encoding.h (string_desc_from_current_source_encoding):
Change result type to rw_string_desc_t.
* gettext-tools/src/xg-encoding.c (from_current_source_encoding): Return
converted result directly, without a cast.
(string_desc_from_current_source_encoding): Change result type to
rw_string_desc_t. Return converted result directly, without a cast. Invoke
sd_readwrite.
* gettext-tools/src/x-perl.c (get_here_document): Add benign cast.
(extract_quotelike_pass1, extract_quotelike_pass1_utf8): Change result type to
rw_string_desc_t.
(extract_quotelike, extract_triple_quotelike): Update.
(extract_quotelike_pass3): Add benign casts.
(interpolate_keywords): Don't call sd_set_char_at on a string_desc_t.
* gettext-tools/src/x-d.c (handle_comments, is_string_literal,
string_literal_accumulate_pieces, extract_from_function_call,
extract_from_function_call_without_args, extract_from_template_instantation,
extract_from_node): Omit casts to 'char *'.
* gettext-tools/src/x-go.c (string_literal_accumulate_pieces,
string_literal_value, scan_import_spec, get_type_from_type_identifier_node,
get_type_from_type_node, store_type_declaration, get_mvtypes_of_expression,
store_var_spec, store_const_spec, store_function_declaration,
augment_for_type_declaration, augment_for_parameter_list, augment_for_var_spec,
augment_for_const_spec, augment_for_short_variable_declaration, handle_comments,
extract_from_function_call, extract_from_node): Omit casts to 'char *'.
* gettext-tools/src/x-rust.c (handle_comments, string_literal_value): Omit casts
to 'char *'. Add benign casts.
(extract_from_function_call, extract_from_function_call_like,
extract_from_node): Omit casts to 'char *'.
* gettext-tools/src/x-typescript-impl.h (handle_comments,
sbru_prepend_lone_surrogate): Omit casts to 'char *'.
(sbru_xprepend_unicode): Add benign casts.
(string_literal_accumulate_pieces, string_literal_value,
extract_from_function_call, extract_from_node): Omit casts to 'char *'.
2025-05-11 03:24:02 +02:00
Bruno Haible
d5aa8447c1 Update to the newest gnulib. 2025-05-11 03:23:47 +02:00
940 changed files with 101786 additions and 120122 deletions

174
.gitignore vendored
View File

@ -15,7 +15,7 @@
/gettext-runtime/doc/Admin/jdom-1.0.jar
/gettext-runtime/doc/Admin/Matrix*.class
/gettext-runtime/doc/Admin/matrix.xml
/gettext-tools/misc/archive.dir.tar
/gettext-tools/machine-translation/prototype/OllamaSpit.class
# Files brought in by autopull.sh:
/gettext-tools/tree-sitter-*
@ -69,7 +69,6 @@
/gettext-tools/libgettextpo/uniwidth/
/gettext-tools/libgettextpo/Makefile.gnulib
/gettext-tools/libgettextpo/_Noreturn.h
/gettext-tools/libgettextpo/alignof.h
/gettext-tools/libgettextpo/alloca.in.h
/gettext-tools/libgettextpo/arg-nonnull.h
/gettext-tools/libgettextpo/asnprintf.c
@ -105,15 +104,13 @@
/gettext-tools/libgettextpo/c32tolower.c
/gettext-tools/libgettextpo/c32width.c
/gettext-tools/libgettextpo/calloc.c
/gettext-tools/libgettextpo/cdefs.h
/gettext-tools/libgettextpo/cloexec.c
/gettext-tools/libgettextpo/cloexec.h
/gettext-tools/libgettextpo/close.c
/gettext-tools/libgettextpo/concat-filename.c
/gettext-tools/libgettextpo/concat-filename.h
/gettext-tools/libgettextpo/diffseq.h
/gettext-tools/libgettextpo/dirname-lgpl.c
/gettext-tools/libgettextpo/dirname.h
/gettext-tools/libgettextpo/dosname.h
/gettext-tools/libgettextpo/dup2.c
/gettext-tools/libgettextpo/errno.in.h
/gettext-tools/libgettextpo/error.c
@ -126,6 +123,7 @@
/gettext-tools/libgettextpo/fd-hook.h
/gettext-tools/libgettextpo/fdopen.c
/gettext-tools/libgettextpo/filename.h
/gettext-tools/libgettextpo/flexmember.h
/gettext-tools/libgettextpo/float+.h
/gettext-tools/libgettextpo/float.c
/gettext-tools/libgettextpo/float.in.h
@ -134,6 +132,8 @@
/gettext-tools/libgettextpo/free.c
/gettext-tools/libgettextpo/frexp.c
/gettext-tools/libgettextpo/frexpl.c
/gettext-tools/libgettextpo/fseterr.c
/gettext-tools/libgettextpo/fseterr.h
/gettext-tools/libgettextpo/fstat.c
/gettext-tools/libgettextpo/fstrcmp.c
/gettext-tools/libgettextpo/fstrcmp.h
@ -191,12 +191,14 @@
/gettext-tools/libgettextpo/itold.c
/gettext-tools/libgettextpo/lc-charset-dispatch.c
/gettext-tools/libgettextpo/lc-charset-dispatch.h
/gettext-tools/libgettextpo/libc-config.h
/gettext-tools/libgettextpo/libunistring.valgrind
/gettext-tools/libgettextpo/limits.in.h
/gettext-tools/libgettextpo/localcharset.c
/gettext-tools/libgettextpo/localcharset.h
/gettext-tools/libgettextpo/locale.in.h
/gettext-tools/libgettextpo/localeconv.c
/gettext-tools/libgettextpo/lstat.c
/gettext-tools/libgettextpo/malloc.c
/gettext-tools/libgettextpo/malloca.c
/gettext-tools/libgettextpo/malloca.h
@ -214,8 +216,6 @@
/gettext-tools/libgettextpo/mbrtowc-impl-utf8.h
/gettext-tools/libgettextpo/mbsinit.c
/gettext-tools/libgettextpo/mbsnlen.c
/gettext-tools/libgettextpo/mbswidth.c
/gettext-tools/libgettextpo/mbswidth.h
/gettext-tools/libgettextpo/mbszero.c
/gettext-tools/libgettextpo/mbtowc-lock.c
/gettext-tools/libgettextpo/mbtowc-lock.h
@ -277,6 +277,8 @@
/gettext-tools/libgettextpo/stdckdint.in.h
/gettext-tools/libgettextpo/stddef.in.h
/gettext-tools/libgettextpo/stdint.in.h
/gettext-tools/libgettextpo/stdio-consolesafe.c
/gettext-tools/libgettextpo/stdio-impl.h
/gettext-tools/libgettextpo/stdio-read.c
/gettext-tools/libgettextpo/stdio-write.c
/gettext-tools/libgettextpo/stdio.in.h
@ -302,6 +304,7 @@
/gettext-tools/libgettextpo/string-desc-contains.c
/gettext-tools/libgettextpo/string-desc.c
/gettext-tools/libgettextpo/string-desc.h
/gettext-tools/libgettextpo/string.c
/gettext-tools/libgettextpo/string.in.h
/gettext-tools/libgettextpo/strnlen.c
/gettext-tools/libgettextpo/strstr.c
@ -360,65 +363,9 @@
/gettext-tools/libgettextpo/xstriconv.h
/gettext-tools/libgettextpo/xvasprintf.c
/gettext-tools/libgettextpo/xvasprintf.h
/gettext-tools/libgrep/glthread/
/gettext-tools/libgrep/gnulib-m4/
/gettext-tools/libgrep/malloc/
/gettext-tools/libgrep/Makefile.gnulib
/gettext-tools/libgrep/_Noreturn.h
/gettext-tools/libgrep/arg-nonnull.h
/gettext-tools/libgrep/attribute.h
/gettext-tools/libgrep/btowc.c
/gettext-tools/libgrep/c++defs.h
/gettext-tools/libgrep/cdefs.h
/gettext-tools/libgrep/dynarray.h
/gettext-tools/libgrep/fcntl.in.h
/gettext-tools/libgrep/intprops-internal.h
/gettext-tools/libgrep/intprops.h
/gettext-tools/libgrep/inttypes.in.h
/gettext-tools/libgrep/iswblank.c
/gettext-tools/libgrep/iswctype-impl.h
/gettext-tools/libgrep/iswctype.c
/gettext-tools/libgrep/iswdigit.c
/gettext-tools/libgrep/iswpunct.c
/gettext-tools/libgrep/iswxdigit.c
/gettext-tools/libgrep/langinfo.in.h
/gettext-tools/libgrep/libc-config.h
/gettext-tools/libgrep/limits.in.h
/gettext-tools/libgrep/locale.in.h
/gettext-tools/libgrep/localeconv.c
/gettext-tools/libgrep/malloc.c
/gettext-tools/libgrep/mbrlen.c
/gettext-tools/libgrep/mbszero.c
/gettext-tools/libgrep/mbtowc-impl.h
/gettext-tools/libgrep/mbtowc.c
/gettext-tools/libgrep/nl_langinfo.c
/gettext-tools/libgrep/nl_langinfo-lock.c
/gettext-tools/libgrep/pthread.in.h
/gettext-tools/libgrep/pthread-once.c
/gettext-tools/libgrep/regcomp.c
/gettext-tools/libgrep/regex.c
/gettext-tools/libgrep/regex.h
/gettext-tools/libgrep/regex_internal.c
/gettext-tools/libgrep/regex_internal.h
/gettext-tools/libgrep/regexec.c
/gettext-tools/libgrep/sched.in.h
/gettext-tools/libgrep/stdckdint.in.h
/gettext-tools/libgrep/stddef.in.h
/gettext-tools/libgrep/stdint.in.h
/gettext-tools/libgrep/stdlib.c
/gettext-tools/libgrep/stdlib.in.h
/gettext-tools/libgrep/sys_types.in.h
/gettext-tools/libgrep/time.in.h
/gettext-tools/libgrep/unistd.c
/gettext-tools/libgrep/unistd.in.h
/gettext-tools/libgrep/warn-on-use.h
/gettext-tools/libgrep/wchar.in.h
/gettext-tools/libgrep/wcrtomb.c
/gettext-tools/libgrep/wctype-h.c
/gettext-tools/libgrep/wctype-impl.h
/gettext-tools/libgrep/wctype.c
/gettext-tools/libgrep/wctype.in.h
/gettext-tools/libgrep/windows-initguard.h
/gettext-tools/libgrep/gnulib-lib/
!/gettext-tools/libgrep/gnulib-lib/Makefile.am
/gettext-tools/man/x-to-1.in
/gettext-tools/tests/gnulib-m4/
/gettext-tools/tests/gnulib-lib/
@ -446,7 +393,15 @@
/gettext-runtime/libasprintf/ChangeLog
/gettext-tools/ChangeLog
/gettext-tools/examples/ChangeLog
# Files copied from gettext-runtime:
# Files copied:
/gettext-runtime/po/Makefile.in.in
/gettext-runtime/po/Rules-quot
/gettext-runtime/po/boldquot.sed
/gettext-runtime/po/en@boldquot.header
/gettext-runtime/po/en@quot.header
/gettext-runtime/po/insert-header.sed
/gettext-runtime/po/quot.sed
/gettext-runtime/po/remove-potcdate.sed
/gettext-tools/ABOUT-NLS
/gettext-tools/po/Makefile.in.in
/gettext-tools/po/Rules-quot
@ -456,6 +411,7 @@
/gettext-tools/po/insert-header.sed
/gettext-tools/po/quot.sed
/gettext-tools/po/remove-potcdate.sed
/gettext-tools/examples/po/remove-potcdate.sed
# Files generated by the autotools:
/aclocal.m4
@ -482,10 +438,12 @@
/gettext-runtime/man/Makefile.in
/gettext-runtime/src/Makefile.in
/gettext-runtime/tests/Makefile.in
/gettext-runtime/install-tests/Makefile.in
/gettext-tools/aclocal.m4
/gettext-tools/configure
/gettext-tools/config.h.in
/gettext-tools/Makefile.in
/gettext-tools/autotools/Makefile.in
/gettext-tools/doc/Makefile.in
/gettext-tools/emacs/Makefile.in
/gettext-tools/examples/aclocal.m4
@ -503,6 +461,8 @@
/gettext-tools/styles/Makefile.in
/gettext-tools/system-tests/Makefile.in
/gettext-tools/tests/Makefile.in
/gettext-tools/wizard/Makefile.in
/gettext-tools/install-tests/Makefile.in
/gnulib-local/Makefile.in
# Files generated by "make" and even kept by "make maintainer-clean":
@ -529,6 +489,10 @@
/gettext-runtime/man/gettext.1.html.in
/gettext-runtime/man/ngettext.1.in
/gettext-runtime/man/ngettext.1.html.in
/gettext-runtime/man/printf_gettext.1.in
/gettext-runtime/man/printf_gettext.1.html.in
/gettext-runtime/man/printf_ngettext.1.in
/gettext-runtime/man/printf_ngettext.1.html.in
/gettext-runtime/man/bind_textdomain_codeset.3
/gettext-runtime/man/bind_textdomain_codeset.3.html
/gettext-runtime/man/bindtextdomain.3
@ -541,6 +505,7 @@
/gettext-runtime/man/textdomain.3.html
/gettext-runtime/po/gettext-runtime.pot
/gettext-runtime/po/stamp-po
/gettext-tools/autotools/archive.*.tar.*
/gettext-tools/doc/version.texi
/gettext-tools/doc/stamp-vti
/gettext-tools/doc/gettext.info
@ -580,15 +545,20 @@
/gettext-tools/man/msginit.1.html
/gettext-tools/man/msgmerge.1
/gettext-tools/man/msgmerge.1.html
/gettext-tools/man/msgpre.1
/gettext-tools/man/msgpre.1.html
/gettext-tools/man/msgunfmt.1
/gettext-tools/man/msgunfmt.1.html
/gettext-tools/man/msguniq.1
/gettext-tools/man/msguniq.1.html
/gettext-tools/man/po-fetch.1
/gettext-tools/man/po-fetch.1.html
/gettext-tools/man/recode-sr-latin.1
/gettext-tools/man/recode-sr-latin.1.html
/gettext-tools/man/spit.1
/gettext-tools/man/spit.1.html
/gettext-tools/man/xgettext.1
/gettext-tools/man/xgettext.1.html
/gettext-tools/misc/archive.*.tar.*
/gettext-tools/po/gettext-tools.pot
/gettext-tools/po/stamp-po
# Files generated by "make", using gperf:
@ -682,6 +652,7 @@ autom4te.cache/
# (see DISTCLEANFILES in Makefile.am):
/gettext-runtime/src/gettext.sh
/gettext-runtime/tests/Makefile
/gettext-runtime/install-tests/Makefile
/gettext-tools/Makefile
/gettext-tools/config.h
/gettext-tools/csharpcomp.sh
@ -692,6 +663,10 @@ autom4te.cache/
/gettext-tools/javaexec.sh
/gettext-tools/libtool
/gettext-tools/stamp-h1
/gettext-tools/autotools/Makefile
# (see DISTCLEANFILES in Makefile.am):
/gettext-tools/autotools/autopoint
/gettext-tools/autotools/convert-archive
/gettext-tools/build-aux/xml-validate-10
/gettext-tools/build-aux/xml-validate-11
/gettext-tools/doc/Makefile
@ -707,19 +682,20 @@ autom4te.cache/
/gettext-tools/man/Makefile
/gettext-tools/man/x-to-1
/gettext-tools/misc/Makefile
# (see DISTCLEANFILES in Makefile.am):
/gettext-tools/misc/autopoint
/gettext-tools/misc/convert-archive
/gettext-tools/misc/gettextize
/gettext-tools/misc/po-fetch
/gettext-tools/po/Makefile.in
/gettext-tools/po/Makefile
/gettext-tools/projects/Makefile
/gettext-tools/src/Makefile
/gettext-tools/src/spit.py
/gettext-tools/src/user-email
/gettext-tools/styles/Makefile
/gettext-tools/system-tests/Makefile
/gettext-tools/tests/Makefile
/gettext-tools/tests/init-env
/gettext-tools/wizard/Makefile
/gettext-tools/wizard/gettextize
/gettext-tools/install-tests/Makefile
/gnulib-local/Makefile
# Directories generated by "make" and not distributed
@ -755,16 +731,30 @@ autom4te.cache/
/gettext-runtime/man/gettext.1.html
/gettext-runtime/man/ngettext.1
/gettext-runtime/man/ngettext.1.html
/gettext-runtime/man/printf_gettext.1
/gettext-runtime/man/printf_gettext.1.html
/gettext-runtime/man/printf_ngettext.1
/gettext-runtime/man/printf_ngettext.1.html
/gettext-runtime/src/libgrtsrc.a
/gettext-tools/libgrep/libgrep.a
/gettext-tools/src/**/*.class
/gettext-tools/src/gettext.jar
/gettext-tools/src/libgettextsrc.la
/gettext-tools/src/libxgettextts1.a
/gettext-tools/src/libxgettextts2.a
/gettext-tools/src/libxgettextts3.a
/gettext-tools/src/libxgettextts4.a
/gettext-tools/src/libxgettextts5.a
/gettext-tools/src/libxgettextx.a
/gettext-tools/src/msgfmt.net.exe
/gettext-tools/src/msgfmt.net.exe.mdb
/gettext-tools/src/msgfmt.net.pdb
/gettext-tools/src/msgunfmt.net.exe
/gettext-tools/src/msgunfmt.net.exe.mdb
/gettext-tools/src/msgunfmt.net.pdb
/gettext-tools/libgettextpo/gettext-po.h
/gettext-tools/libgettextpo/libgnu.la
/gettext-tools/libgettextpo/libgettextpo.la
# Executables generated by "make":
/gettext-runtime/src/envsubst
/gettext-runtime/src/envsubst.exe
@ -772,11 +762,10 @@ autom4te.cache/
/gettext-runtime/src/gettext.exe
/gettext-runtime/src/ngettext
/gettext-runtime/src/ngettext.exe
/gettext-runtime/tests/test-lock
/gettext-runtime/tests/test-lock.exe
/gettext-tools/libgettextpo/gettext-po.h
/gettext-tools/libgettextpo/libgnu.la
/gettext-tools/libgettextpo/libgettextpo.la
/gettext-runtime/src/printf_gettext
/gettext-runtime/src/printf_gettext.exe
/gettext-runtime/src/printf_ngettext
/gettext-runtime/src/printf_ngettext.exe
/gettext-tools/src/cldr-plurals
/gettext-tools/src/cldr-plurals.exe
/gettext-tools/src/hostname
@ -805,12 +794,16 @@ autom4te.cache/
/gettext-tools/src/msginit.exe
/gettext-tools/src/msgmerge
/gettext-tools/src/msgmerge.exe
/gettext-tools/src/msgpre
/gettext-tools/src/msgpre.exe
/gettext-tools/src/msgunfmt
/gettext-tools/src/msgunfmt.exe
/gettext-tools/src/msguniq
/gettext-tools/src/msguniq.exe
/gettext-tools/src/recode-sr-latin
/gettext-tools/src/recode-sr-latin.exe
/gettext-tools/src/spit
/gettext-tools/src/spit.exe
/gettext-tools/src/urlget
/gettext-tools/src/urlget.exe
/gettext-tools/src/xgettext
@ -909,7 +902,6 @@ core
/gettext-tools/tests/*.trs
# Other.
/gettext-runtime/intl/libgnuintl.h
/gettext-runtime/intl/localename-table.h
/gettext-runtime/libasprintf/autosprintf.h
/gettext-runtime/po/??@*.insert-header
/gettext-runtime/src/gettext.res
@ -933,6 +925,7 @@ core
/gettext-tools/doc/gettext.pgs
/gettext-tools/doc/gettext.vr
/gettext-tools/doc/gettext.vrs
/gettext-tools/examples/po/*.gpo
/gettext-tools/libgettextpo/config.h
/gettext-tools/libgettextpo/alloca.h
/gettext-tools/libgettextpo/assert.h
@ -950,7 +943,6 @@ core
/gettext-tools/libgettextpo/sched.h
/gettext-tools/libgettextpo/signal.h
/gettext-tools/libgettextpo/stdarg.h
/gettext-tools/libgettextpo/stdbool.h
/gettext-tools/libgettextpo/stdckdint.h
/gettext-tools/libgettextpo/stddef.h
/gettext-tools/libgettextpo/stdint.h
@ -958,46 +950,24 @@ core
/gettext-tools/libgettextpo/stdlib.h
/gettext-tools/libgettextpo/string.h
/gettext-tools/libgettextpo/sys/stat.h
/gettext-tools/libgettextpo/sys/time.h
/gettext-tools/libgettextpo/sys/types.h
/gettext-tools/libgettextpo/textstyle.h
/gettext-tools/libgettextpo/time.h
/gettext-tools/libgettextpo/uchar.h
/gettext-tools/libgettextpo/unicase.h
/gettext-tools/libgettextpo/uniconv.h
/gettext-tools/libgettextpo/unictype.h
/gettext-tools/libgettextpo/unilbrk.h
/gettext-tools/libgettextpo/uninorm.h
/gettext-tools/libgettextpo/unistd.h
/gettext-tools/libgettextpo/unistr.h
/gettext-tools/libgettextpo/unitypes.h
/gettext-tools/libgettextpo/uniwidth.h
/gettext-tools/libgettextpo/wchar.h
/gettext-tools/libgettextpo/wctype.h
/gettext-tools/libgrep/fcntl.h
/gettext-tools/libgrep/inttypes.h
/gettext-tools/libgrep/langinfo.h
/gettext-tools/libgrep/limits.h
/gettext-tools/libgrep/locale.h
/gettext-tools/libgrep/pthread.h
/gettext-tools/libgrep/sched.h
/gettext-tools/libgrep/stdbool.h
/gettext-tools/libgrep/stdckdint.h
/gettext-tools/libgrep/stddef.h
/gettext-tools/libgrep/stdint.h
/gettext-tools/libgrep/stdlib.h
/gettext-tools/libgrep/time.h
/gettext-tools/libgrep/unistd.h
/gettext-tools/libgrep/wchar.h
/gettext-tools/libgrep/wctype.h
/gettext-tools/libgrep/sys/types.h
/gettext-tools/po/??@*.insert-header
/gettext-tools/src/gettext.res
/gettext-tools/src/libxgettextts1.a
/gettext-tools/src/libxgettextts2.a
/gettext-tools/src/libxgettextts3.a
/gettext-tools/src/libxgettextts4.a
/gettext-tools/src/libxgettextx.a
/gettext-tools/src/textstyle.h
/gettext-tools/src/textstyle/stdbool.h
/gettext-tools/src/textstyle/version.h
/gettext-tools/src/textstyle/woe32dll.h

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "gnulib"]
path = gnulib
url = git://git.sv.gnu.org/gnulib.git
url = git://git.savannah.gnu.org/gnulib.git

View File

@ -91,3 +91,6 @@ Assigns past and future changes.
GETTEXT John Darrington
Assigns past and future changes.
(No contributions so far.)
GETTEXT Michele Locati
Assigns past and future changes.

View File

@ -121,9 +121,11 @@ We assume that the following environment variables are set:
gettext-runtime/src/gettext.c
gettext-runtime/src/gettext.sh.in
gettext-runtime/src/ngettext.c
gettext-tools/misc/autopoint.in
gettext-tools/misc/convert-archive.in
gettext-tools/misc/gettextize.in
gettext-runtime/src/printf_gettext.c
gettext-runtime/src/printf_ngettext.c
gettext-tools/wizard/gettextize.in
gettext-tools/autotools/autopoint.in
gettext-tools/autotools/convert-archive.in
gettext-tools/src/cldr-plurals.c
gettext-tools/src/hostname.c
gettext-tools/src/msgattrib.c
@ -138,9 +140,12 @@ We assume that the following environment variables are set:
gettext-tools/src/msggrep.c
gettext-tools/src/msginit.c
gettext-tools/src/msgmerge.c
gettext-tools/src/msgpre.c
gettext-tools/src/msgunfmt.c
gettext-tools/src/msguniq.c
gettext-tools/src/recode-sr-latin.c
gettext-tools/src/spit.c
gettext-tools/src/spit.py.in
gettext-tools/src/urlget.c
gettext-tools/src/xgettext.c
@ -159,44 +164,17 @@ We assume that the following environment variables are set:
Update ARCHIVE_VERSION.
- gettext-tools/misc/autopoint.in
- gettext-tools/autotools/autopoint.in
Update the 'case' statement around line 395 to include the latest release.
** If you got any translation updates, update translations:
wget --mirror --level=1 -nd -nv -A.po -P gettext-runtime/po/new \
https://translationproject.org/latest/gettext-runtime/
Optionally merge:
cd gettext-runtime/po
make update-po
cd new
for f in *.po; do msgmerge --update --lang=${f%.po} --previous --width=80 $f ../gettext-runtime.pot; done
mv *.po ../
cd ..; rm -rf new
(cd gettext-runtime/po && ./fetch-po)
(cd gettext-tools/po && ./fetch-po)
(cd gettext-tools/examples/po && ./fetch-po)
wget --mirror --level=1 -nd -nv -A.po -P gettext-tools/po/new \
https://translationproject.org/latest/gettext-tools/
Optionally merge:
cd gettext-tools/po
make update-po
cd new
for f in *.po; do msgmerge --update --lang=${f%.po} --previous --width=80 $f ../gettext-tools.pot; done
mv *.po ../
cd ..; rm -rf new
wget --mirror --level=1 -nd -nv -A.po -P gettext-tools/examples/po/new \
https://translationproject.org/latest/gettext-examples/
Optionally merge:
cd gettext-tools/examples/po
make update-po
cd new
for f in *.po; do msgmerge --update --lang=${f%.po} --previous --width=80 $f ../gettext-examples.pot; done
mv *.po ../
cd ..; rm -rf new
Adjust LINGUAS files if any of the languages has been added or
removed since the last release. Commit the changes.
Commit the changes.
** Create a release:
@ -217,7 +195,7 @@ We assume that the following environment variables are set:
Make 'autopoint' work in the new release:
(cd gettext-tools/misc
(cd gettext-tools/autotools
./add-to-archive ../../gettext-$CURRENT_VERSION.tar.gz)
Update the examples:
@ -256,6 +234,8 @@ We assume that the following environment variables are set:
Then check the build infrastructure of the examples by running
$ cd gettext-tools/examples
$ ./check-examples
(This currently does not work with GCC 15 for the hello-go* examples,
due to <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119098>.)
Finally really make the release tarball:
@ -276,16 +256,6 @@ We assume that the following environment variables are set:
gnulib/build-aux/gnupload --to ftp.gnu.org:gettext \
gettext-$CURRENT_VERSION.tar.{gz,xz,lz}
** Upload autopoint archive to alpha.gnu.org:
This is needed to compile git master after the release (as
autopull.sh fetches the archive).
xz -c -e < gettext-tools/misc/archive.dir.tar > archive.dir-$CURRENT_VERSION.tar.xz
gnulib/build-aux/gnupload \
--to alpha.gnu.org:gettext \
--symlink-regex archive.dir-$CURRENT_VERSION.tar.xz
** Finally:
rm -f .tarball-version

View File

@ -37,15 +37,14 @@ The following packages should be installed before GNU gettext is installed
* libxml2
+ Recommended.
Needed for 'xgettext' and 'msgfmt', so that it can parse XML
files. Also needed for the --color option of the various
programs.
Needed for 'xgettext' and 'msgfmt', so that it can parse XML files.
Also needed for the --color option of the various programs.
If not present, a subset of libxml2 (included in this package) will be
compiled into libgettextlib.
+ Homepage:
http://xmlsoft.org/
https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home
+ Download:
ftp://xmlsoft.org/libxml2/
https://download.gnome.org/sources/libxml2/
+ Pre-built package name:
- On Debian and Debian-based systems: libxml2-dev,
- On Red Hat distributions: libxml2-devel.
@ -53,6 +52,36 @@ The following packages should be installed before GNU gettext is installed
+ If it is installed in a nonstandard directory, pass the option
--with-libxml2-prefix=DIR to 'configure'.
* libjson-c 0.13 or newer
+ Recommended.
Needed for machine translation.
If not present, 'spit' will be a Python script instead of an executable.
+ Homepage:
https://github.com/json-c/json-c/wiki
+ Download:
https://s3.amazonaws.com/json-c_releases/releases/index.html
+ Pre-built package name:
- On Debian and Debian-based systems: libjson-c-dev,
- On Red Hat distributions: json-c-devel.
- Other: https://repology.org/project/json-c/versions
+ When building with the MS Visual C/C++ tool chain, version 0.19 or newer
is required.
* libcurl
+ Recommended.
Needed for machine translation.
If not present, 'spit' will be a Python script instead of an executable.
+ Homepage:
https://curl.se/libcurl/
+ Download:
https://curl.se/download.html
+ Pre-built package name:
- On Debian and Debian-based systems: libcurl4-gnutls-dev or libcurl4-openssl-dev,
- On Red Hat distributions: libcurl-devel.
- Other: https://repology.org/project/curl/versions
+ When building against a static libcurl on Windows, you need to include
"-DCURL_STATICLIB" in the CPPFLAGS.
* libacl
+ Recommended on Linux systems.
Needed so that the creation of backup files respects the access control
@ -66,18 +95,18 @@ The following packages should be installed before GNU gettext is installed
- On Red Hat distributions: acl, libacl-devel.
- Other: https://repology.org/project/acl/versions
* libattr
+ Recommended on Linux systems.
Needed so that the creation of backup files respects the access control
lists (ACLs) set on the original files, with fewer system calls.
+ Homepage:
https://savannah.nongnu.org/projects/attr/
+ Download:
https://download.savannah.nongnu.org/releases/attr/
+ Pre-built package name:
- On Debian and Debian-based systems: libattr1-dev,
- On Red Hat distributions: libattr-devel.
- Other: https://repology.org/project/attr/versions
* libattr
+ Recommended on Linux systems.
Needed so that the creation of backup files respects the access control
lists (ACLs) set on the original files, with fewer system calls.
+ Homepage:
https://savannah.nongnu.org/projects/attr/
+ Download:
https://download.savannah.nongnu.org/releases/attr/
+ Pre-built package name:
- On Debian and Debian-based systems: libattr1-dev,
- On Red Hat distributions: libattr-devel.
- Other: https://repology.org/project/attr/versions
* A Java runtime and compiler (e.g. OpenJDK, AdoptOpenJDK, or kaffe).
+ Recommended.
@ -266,6 +295,29 @@ The following packages should be installed when GNU gettext is installed
+ Download:
https://ftp.gnu.org/gnu/gnulib/gnulib-l10n-*
* Python 3.7 or newer.
+ Recommended if GNU Gettext was built without libjson-c or without libcurl.
Needed for machine translation.
+ Homepage:
https://www.python.org/
+ Download:
https://www.python.org/downloads/
+ Pre-built package name:
- On Debian and Debian-based systems: python3,
- On Red Hat distributions: python3.
- Other: https://repology.org/project/python/versions
* The Python module 'requests'.
+ Recommended if GNU Gettext was built without libjson-c or without libcurl.
Needed for machine translation.
+ Homepage:
https://pypi.org/project/requests/
+ Download:
https://pypi.org/project/requests/#files
+ Pre-built package name:
- On Debian and Debian-based systems: python3-requests,
- On Red Hat distributions: python-requests.
- Other: https://repology.org/project/python%3Arequests/versions
The following should be installed when GNU gettext is built, but are not
needed later, once it is installed (build dependencies, but not runtime

80
HACKING
View File

@ -163,6 +163,12 @@ are skipped. To this effect, you need to install also:
- On Debian and Debian-based systems: gobjc,
- On Red Hat distributions: gcc-objc.
- Other: https://repology.org/project/gcc/versions
* The Boost C++ library
+ Homepage: https://www.boost.org/
+ Pre-built package name:
- On Debian and Debian-based systems: libboost1.83-dev,
- On Red Hat distributions: boost.
- Other: https://repology.org/project/boost/versions
* Python
+ Homepage: https://www.python.org/
@ -310,6 +316,19 @@ are skipped. To this effect, you need to install also:
- On Red Hat distributions: --.
- Other: https://repology.org/project/fpc/versions
* OCaml
+ Homepage: https://ocaml.org/
+ Pre-built package name:
- On Debian and Debian-based systems: ocaml,
- On Red Hat distributions: ocaml.
- Other: https://repology.org/project/ocaml/versions
* The OCaml package manager
+ Homepage: https://opam.ocaml.org/
+ Pre-built package name:
- On Debian and Debian-based systems: opam,
- On Red Hat distributions: --.
- Other: https://repology.org/project/opam/versions
* GNU smalltalk
+ Homepage: http://smalltalk.gnu.org/
+ Pre-built package name:
@ -442,6 +461,63 @@ build results here:
https://gitlab.com/gnu-gettext/ci-distcheck/-/jobs?scope=finished
Coding Style
============
For C source code:
* Follow the portability guidelines
https://www.gnu.org/software/gnulib/manual/html_node/Portability-guidelines.html
* Use mixed declarations and statements, as appropriate. (This is supported
since C99.)
* Note: You can't put a label before a declaration, such as in
retry:
int foo = ...;
This is supported only in C23 or newer. Instead, add an empty statement:
retry: ;
int foo = ...;
Similarly, you can't put a declaration immediately after a case label, such
as in
case 1:
int foo = ...;
...
break;
Again, this is supported only in C23 or newer. Instead, use a sub-block:
case 1:
{
int foo = ...;
...
}
break;
* In function definitions and blocks, the pre-C99 style "declare all variables
upfront" is discouraged.
Instead, the following style elements are encouraged (for local non-static
variables):
- Move the declaration of a variable to its initialization.
- Reduce the scope of variables:
. If a variable is only used in a sub-block, declare it in that sub-block.
. If a variable is only used in several sub-blocks and has a separate
initialization in each of the sub-blocks, declare it in each of these
sub-blocks. It's actually several independent variables.
. If a variable is only used in a small part of a function definition or
block (say, 1/3 of it or less), you may surround that part (including
the variable's initialization) with braces, so that it becomes clear
that the variable is not used in the rest of the function / block.
- Usually, try to declare and initialize variables right when they are
needed for the first time, not several computation steps before.
The rationale is:
- It follows the general principle "Put related things close together."
- A function with 3 blocks that each has 4 variables is easier to
understand than a function that has 12 variables, and where the
reader has to find out which variable is used where.
- Variables may represent state, and it is the state and the control flow
that contribute to the complexity of a function.
Only static variables are better kept declared upfront in a function or block.
Submitting patches
==================
@ -450,8 +526,8 @@ list. You can subscribe to the mailing list, or see the list
archives, by following links from
https://savannah.gnu.org/mail/?group=gettext .
To email a patch you can use a shell command like 'git format-patch
-1' to create a file, and then attach the file to your email.
To email a patch you can use a shell command like 'git format-patch -1'
to create a file, and then attach the file to your email.
GNU gettext development no longer stores descriptions of new changes
in ChangeLog files. Instead, a single ChangeLog file is generated

View File

@ -26,7 +26,7 @@ Here, you can give as arguments to 'configure'
described in the INSTALL.generic file.
If you are in a 64-bit multilib system with support for building 32-bit
binaries, you can build a 32-bit poke configuring like this:
binaries, you can build 32-bit binaries by configuring like this:
$ ../configure CC="gcc -m32"

View File

@ -78,10 +78,6 @@ There are three ways to create binaries of this package for Microsoft Windows:
(api-ms-win*.dll) through the Windows Update mechanism, see
https://support.microsoft.com/en-us/kb/2999226 .
Another constraint is that shared libraries built as part of this package
may not work (at least with MSVC 14.0). Therefore, you will need to pass
the configure option '--disable-shared' when building this package.
This recipe requires MS Visual C/C++ 9.0 or newer.
You don't need the Visual Studio IDE, just the C/C++ tool chain.
As of 2016, you can install the MS Visual C/C++ 14.0 tool chain from
@ -176,6 +172,7 @@ There are three ways to create binaries of this package for Microsoft Windows:
win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0
./configure --host=i686-w64-mingw32 --prefix=/usr/local/msvc32 \
--with-included-libunistring \
CC="$HOME/msvc/compile cl -nologo" \
CFLAGS="-MD" \
CXX="$HOME/msvc/compile cl -nologo" \
@ -202,6 +199,7 @@ There are three ways to create binaries of this package for Microsoft Windows:
win32_target=_WIN32_WINNT_WIN8 # possibly for MSVC >= 10.0
./configure --host=x86_64-w64-mingw32 --prefix=/usr/local/msvc64 \
--with-included-libunistring \
CC="$HOME/msvc/compile cl -nologo" \
CFLAGS="-MD" \
CXX="$HOME/msvc/compile cl -nologo" \

View File

@ -66,15 +66,23 @@ $(srcdir)/configure: $(srcdir)/gettext-runtime/configure.ac $(srcdir)/gettext-to
distcheck-hook:
# Verify that some files are the same.
cmp -s $(srcdir)/gettext-runtime/po/Makefile.in.in $(srcdir)/gettext-tools/po/Makefile.in.in
cmp -s $(srcdir)/gettext-runtime/po/Rules-quot $(srcdir)/gettext-tools/po/Rules-quot
cmp -s $(srcdir)/gettext-runtime/po/boldquot.sed $(srcdir)/gettext-tools/po/boldquot.sed
cmp -s $(srcdir)/gettext-runtime/po/quot.sed $(srcdir)/gettext-tools/po/quot.sed
cmp -s $(srcdir)/gettext-runtime/po/en@quot.header $(srcdir)/gettext-tools/po/en@quot.header
cmp -s $(srcdir)/gettext-runtime/po/en@boldquot.header $(srcdir)/gettext-tools/po/en@boldquot.header
cmp -s $(srcdir)/gettext-runtime/po/insert-header.sed $(srcdir)/gettext-tools/po/insert-header.sed
cmp -s $(srcdir)/gettext-runtime/po/remove-potcdate.sed $(srcdir)/gettext-tools/po/remove-potcdate.sed
cmp -s $(srcdir)/gettext-runtime/po/remove-potcdate.sed $(srcdir)/gettext-tools/examples/po/remove-potcdate.sed
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/Makefile.in.in $(srcdir)/gettext-runtime/po/Makefile.in.in
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/Rules-quot $(srcdir)/gettext-runtime/po/Rules-quot
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/boldquot.sed $(srcdir)/gettext-runtime/po/boldquot.sed
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/quot.sed $(srcdir)/gettext-runtime/po/quot.sed
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/en@quot.header $(srcdir)/gettext-runtime/po/en@quot.header
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/en@boldquot.header $(srcdir)/gettext-runtime/po/en@boldquot.header
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/insert-header.sed $(srcdir)/gettext-runtime/po/insert-header.sed
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/remove-potcdate.sed $(srcdir)/gettext-runtime/po/remove-potcdate.sed
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/Makefile.in.in $(srcdir)/gettext-tools/po/Makefile.in.in
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/Rules-quot $(srcdir)/gettext-tools/po/Rules-quot
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/boldquot.sed $(srcdir)/gettext-tools/po/boldquot.sed
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/quot.sed $(srcdir)/gettext-tools/po/quot.sed
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/en@quot.header $(srcdir)/gettext-tools/po/en@quot.header
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/en@boldquot.header $(srcdir)/gettext-tools/po/en@boldquot.header
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/insert-header.sed $(srcdir)/gettext-tools/po/insert-header.sed
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/remove-potcdate.sed $(srcdir)/gettext-tools/po/remove-potcdate.sed
cmp -s $(srcdir)/gettext-tools/wizard/po-templates/traditional/remove-potcdate.sed $(srcdir)/gettext-tools/examples/po/remove-potcdate.sed
cmp -s $(srcdir)/gettext-runtime/m4/build-to-host.m4 $(srcdir)/gettext-tools/gnulib-m4/build-to-host.m4
cmp -s $(srcdir)/gettext-runtime/m4/gettext.m4 $(srcdir)/gettext-tools/gnulib-m4/gettext.m4
cmp -s $(srcdir)/gettext-runtime/man/help2man $(srcdir)/gettext-tools/man/help2man

142
NEWS
View File

@ -1,3 +1,141 @@
Version 1.0 - January 2026
# Improvements for maintainers and distributors:
* In a po/ directory, the PO files are now exactly those that the
translators submitted or committed in version control, or a
translation project's daemon committed on behalf of the translators.
They are no longer regularly updated with respect to the POT file
in the same directory.
The advantage for maintainers is that the maintainer may commit the
PO files in version control, without getting
- lots of modified files shown by "git status",
- frequent merge conflicts when merging between branches,
- a voluminous version control history.
The advantage for distributors is that the role of files in a
release tarball are clearer: The PO files are source code, whereas
the POT file and the *.gmo files are generated files.
ATTENTION translators!
Translators who work directly on a package's source code (without
going through a translation project) now need to run "msginit"
before starting work on a PO file.
* A new program 'po-fetch' is provided, that fetches the translated
PO files from a translation project's site on the internet, and
updates the LINGUAS file accordingly.
* In a po/ directory, a new script 'fetch-po' is now added by 'gettextize'.
It provides the standard interface for fetching the translated PO files.
It typically either invokes the 'po-fetch' program or does nothing.
# Improvements for translators:
* msginit:
- When the PO file already exists, 'msginit' now updates it w.r.t. the
POT file, like 'msgmerge' would do. Previously, 'msginit' failed with
an error message in this situation.
* Pretranslation:
- Two new programs, 'msgpre' and 'spit', are provided, that implement
machine translation through a locally installed Large Language Model
(LLM). 'msgpre' applies to an entire PO file, 'spit' to a single
message.
- The documentation has a new chapter "Pretranslation".
# Improvements for maintainers:
* xgettext:
- The refactoring suggestion when a translatable string contains an URL
or email address can now be inhibited through a command-line option
'--no-check=url' or '--no-check=email', or through a comment in the
source code of the form
/* xgettext: no-url-check */
or
/* xgettext: no-email-check */
# Programming languages support:
* OCaml:
- xgettext now supports OCaml.
- 'msgfmt -c' now verifies the syntax of translations of OCaml format
strings.
- A new example 'hello-ocaml' has been added.
* Rust:
- xgettext now recognizes 'gettextrs::gettext' invocations, like 'gettext'
invocations.
# libgettextpo library:
* The function 'po_message_get_format' now supports distinguishing whether
a negative format string mark, such as 'no-c-format', is set or not.
* The new functions
po_message_has_workflow_flag
po_message_set_workflow_flag
po_message_workflow_flags_iterator, po_flag_next, po_flag_iterator_free
can be used to manipulate or inspect the workflow flags of a message.
* The new functions
po_message_has_sticky_flag
po_message_set_sticky_flag
po_message_sticky_flags_iterator, po_flag_next, po_flag_iterator_free
can be used to manipulate or inspect the sticky flags of a messsage.
# Emacs PO mode:
Restore syntax highlighting in Emacs version 30 or newer.
Version 0.26 - July 2025
# Programming languages support:
* JavaScript:
- xgettext now parses regular expressions with character classes
correctly.
* C, C++, Python, JavaScript, EmacsLisp, librep, Go, Ruby, awk, D, Tcl,
Perl, PHP:
- xgettext's heuristic recognition of format strings has been improved:
strings like "100% complete" (with a space flag in a format directive)
are no longer flagged as format strings by default, unless they occur
in a context that requires a format string. You can override this
heuristic by using a comment of the form /* xgettext: c-format */.
* Shell:
- The documentation now mentions two other approaches for
internationalizing messages with parameters in shell scripts.
- xgettext now recognizes format strings in the 'printf' command syntax.
They are marked as 'sh-printf-format' in POT and PO files.
- Two new programs 'printf_gettext' and 'printf_ngettext' are provided,
that do formatted output with a localized format string in a more
efficient way (without spawning a subshell).
- xgettext now recognizes the \c, \u, and \U escape sequences in dollar-
single-quoted strings $'...'.
# Improvements for maintainers:
* xgettext:
- When extracting a message with plural that is some format string,
xgettext now verifies that the msgid and msgid_plural are compatible
as format strings. For most format string types, this still allows
omitting from msgid a placeholder that is used in msgid_plural. But
when a placeholder is used in both msgid and msgid_plural, its type
must be the same in both.
- xgettext now suggests a refactoring when a translatable string
contains an URL or email address.
# Improvements for translators:
* msggrep:
- msggrep accepts two new options -W/--workflow-flags and -S/--sticky-flags
that allow to select only messages that have a specified flag.
# Bug fixes:
- The AM_GNU_GETTEXT macro now rejects the dysfunctional gettext() function
in libc of Solaris 11.[0-3], Solaris OpenIndiana, and Solaris OmniOS.
- The AM_GNU_GETTEXT macro now recognizes, on MSVC, the GNU libintl built
as a shared library.
Version 0.25.1 - July 2025
# Bug fixes:
- autopoint no longer fails if configure.ac contains no
AM_GNU_GETTEXT_VERSION or AM_GNU_GETTEXT_REQUIRE_VERSION invocation.
- nls.m4 is installed again under $PREFIX/share/aclocal/.
# Portability:
- Building on native Windows with MSVC and --enable-shared is now supported.
Version 0.25 - May 2025
# Programming languages support:
@ -676,7 +814,7 @@ Version 0.18.3 - July 2013
set of formatting methods nor translation functions, the
implementation supports only a limited set of formatting methods
and translation functions commonly used in Gjs and other popular
JavaScript implemenations and libraries.
JavaScript implementations and libraries.
- Lua:
xgettext now supports Lua, using Ľubomír Remák's lua-gettext.
@ -792,7 +930,7 @@ Version 0.18 - May 2010
version 0.12.
* msgfilter now sets environment variables during the invocation of the
filter, indicating the msgid and location of the messge being processed.
filter, indicating the msgid and location of the message being processed.
* xgettext now can extract plural forms from Qt 4 programs. The recommended
xgettext command-line options for this case are:

View File

@ -76,13 +76,19 @@ the following file list.
$prefix/bin/gettext
$prefix/bin/ngettext
$prefix/bin/printf_gettext
$prefix/bin/printf_ngettext
$prefix/bin/envsubst
$prefix/bin/gettext.sh
$prefix/share/man/man1/gettext.1
$prefix/share/man/man1/ngettext.1
$prefix/share/man/man1/printf_gettext.1
$prefix/share/man/man1/printf_ngettext.1
$prefix/share/man/man1/envsubst.1
$prefix/share/doc/gettext/gettext.1.html
$prefix/share/doc/gettext/ngettext.1.html
$prefix/share/doc/gettext/printf_gettext.1.html
$prefix/share/doc/gettext/printf_ngettext.1.html
$prefix/share/doc/gettext/envsubst.1.html
$prefix/share/locale/*/LC_MESSAGES/gettext-runtime.mo
@ -131,17 +137,23 @@ the following file list.
$prefix/bin/xgettext
$prefix/bin/gettextize
$prefix/bin/autopoint
$prefix/bin/po-fetch
$prefix/bin/recode*
$prefix/bin/spit
$prefix/share/man/man1/msg*.1
$prefix/share/man/man1/xgettext.1
$prefix/share/man/man1/gettextize.1
$prefix/share/man/man1/autopoint.1
$prefix/share/man/man1/po-fetch.1
$prefix/share/man/man1/recode*.1
$prefix/share/man/man1/spit.1
$prefix/share/doc/gettext/msg*.1.html
$prefix/share/doc/gettext/xgettext.1.html
$prefix/share/doc/gettext/gettextize.1.html
$prefix/share/doc/gettext/autopoint.1.html
$prefix/share/doc/gettext/po-fetch.1.html
$prefix/share/doc/gettext/recode*.1.html
$prefix/share/doc/gettext/spit.1.html
$prefix/share/doc/gettext/gettext_*.html
$prefix/share/doc/gettext/FAQ.html
$prefix/share/doc/gettext/tutorial.html
@ -181,6 +193,7 @@ the following file list.
$prefix/share/gettext/archive.cvs.tar.* (only installed if --with-cvs specified)
$prefix/share/gettext/disclaim-translations.txt
$prefix/share/gettext-$VERSION/its/*
$prefix/share/aclocal/nls.m4
$prefix/share/emacs/site-lisp/po-compat.el
$prefix/share/emacs/site-lisp/po-compat.elc
$prefix/share/emacs/site-lisp/po-mode.el

View File

@ -4,7 +4,7 @@
# also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
# with new versions of autoconf or automake.
#
# This script requires autoconf-2.64..2.72 and automake-1.13..1.17 in the PATH.
# This script requires autoconf-2.64..2.72 and automake-1.13..1.18 in the PATH.
# Copyright (C) 2003-2025 Free Software Foundation, Inc.
#
@ -21,9 +21,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Prerequisite (if not used from a released tarball): either
# - the GNULIB_SRCDIR environment variable pointing to a gnulib checkout, or
# - a preceding invocation of './autopull.sh'.
# Prerequisite (if not used from a released tarball):
# - A preceding invocation of './autopull.sh'.
# - If the GNULIB_SRCDIR environment variable was set during the
# './autopull.sh' invocation, pointing to a gnulib checkout, it should
# still be set now, during the './autogen.sh' invocation.
#
# Usage: ./autogen.sh [--skip-gnulib]
#
@ -99,25 +101,36 @@ if ! $skip_gnulib; then
basename-lgpl
binary-io
bool
c-ctype
c-strtold
closeout
error
getopt-gnu
fzprintf-posix
gettext-h
havelib
mbrtoc32
mbszero
memmove
noreturn
options
progname
propername
quote
relocatable-prog
setlocale
sigpipe
stdint-h
stdio-h
stdlib-h
strtoimax
strtold
strtoul
strtoumax
unistd-h
unlocked-io
xalloc
xstring-buffer
xstrtold
'
GNULIB_MODULES_RUNTIME_OTHER='
gettext-runtime-misc
@ -205,7 +218,6 @@ if ! $skip_gnulib; then
gcd
getaddrinfo
getline
getopt-gnu
getrusage
gettext-h
gocomp-script
@ -234,6 +246,7 @@ if ! $skip_gnulib; then
open
opendir
openmp-init
options
pipe-filter-ii
progname
propername
@ -313,34 +326,118 @@ if ! $skip_gnulib; then
'
# Common dependencies of GNULIB_MODULES_TOOLS_FOR_SRC and GNULIB_MODULES_TOOLS_FOR_LIBGREP.
GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES='
absolute-header
alignasof
alloca-opt
assert-h
attribute
basename-lgpl
bool
btowc
builtin-expect
c99
calloc-gnu
calloc-posix
cloexec
close
double-slash-root
dup2
errno-h
error
error-h
exitfail
extensions
extensions-aix
extern-inline
fcntl
fcntl-h
fd-hook
filename
flexmember
fstat
gen-header
getdtablesize
getprogname
gettext-h
gnulib-i18n
hard-locale
ialloc
idx
include_next
locale-h
intprops
inttypes-h-incomplete
iswblank
iswctype
iswdigit
iswpunct
iswxdigit
largefile
libc-config
limits-h
localcharset
localeconv
locale-h
lock
lstat
malloca
malloc-gnu
malloc-posix
mbrtowc
mbsinit
mbszero
mbtowc
memchr
memcmp
memmove
minmax
msvc-inval
msvc-nothrow
multiarch
obstack
once
open
pathmax
pthread-h
pthread-once
reallocarray
realloc-posix
sched-h
setlocale-null
setlocale-null-unlocked
snippet/arg-nonnull
snippet/c++defs
snippet/_Noreturn
snippet/warn-on-use
ssize_t
stat
stat-time
stdckdint-h
stddef-h
std-gnu11
stdint-h
stdio-h
stdlib-h
streq
strerror
strerror-override
string-h
sys_stat-h
sys_types-h
threadlib
time-h
unistd-h
vararrays
verify
wchar-h
wctype
wctype-h
windows-mutex
windows-once
windows-recmutex
windows-rwlock
xalloc
xalloc-die
xalloc-oversized
'
GNULIB_MODULES_TOOLS_OTHER='
gettext-tools-misc
@ -368,18 +465,21 @@ if ! $skip_gnulib; then
GNULIB_MODULES_LIBGETTEXTLIB="$GNULIB_MODULES_TOOLS_FOR_SRC $GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES $GNULIB_MODULES_TOOLS_OTHER"
$GNULIB_TOOL --dir=gettext-tools --lib=libgettextlib --source-base=gnulib-lib --m4-base=gnulib-m4 --tests-base=gnulib-tests --makefile-name=Makefile.gnulib --libtool --with-tests --local-dir=gnulib-local --local-symlink \
--import \
--avoid=float-h-tests \
--avoid=hashcode-string1 \
--avoid=fdutimensat-tests --avoid=futimens-tests --avoid=utime-tests --avoid=utimens-tests --avoid=utimensat-tests \
--avoid=array-list-tests --avoid=linked-list-tests --avoid=linkedhash-list-tests \
--avoid=array-list-tests --avoid=array-map-tests --avoid=array-oset-tests --avoid=carray-list-tests --avoid=linked-list-tests --avoid=linkedhash-list-tests \
--avoid=uninorm/decomposing-form-tests \
`for m in $GNULIB_MODULES_TOOLS_LIBUNISTRING_TESTS; do echo --avoid=$m; done` \
$GNULIB_MODULES_LIBGETTEXTLIB || exit $?
$GNULIB_TOOL --copy-file m4/libtextstyle.m4 gettext-tools/gnulib-m4/libtextstyle.m4 || exit $?
# In gettext-tools/libgrep:
GNULIB_MODULES_TOOLS_FOR_LIBGREP='
kwset
mbrlen
regex
'
$GNULIB_TOOL --dir=gettext-tools --macro-prefix=grgl --lib=libgrep --source-base=libgrep --m4-base=libgrep/gnulib-m4 --witness-c-macro=IN_GETTEXT_TOOLS_LIBGREP --makefile-name=Makefile.gnulib --local-dir=gnulib-local --local-symlink \
$GNULIB_TOOL --dir=gettext-tools --macro-prefix=grgl --source-base=libgrep/gnulib-lib --m4-base=libgrep/gnulib-m4 --makefile-name=Makefile.gnulib --witness-c-macro=IN_GETTEXT_TOOLS_LIBGREP --local-dir=gnulib-local --local-symlink \
--import \
`for m in $GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES; do \
if test \`$GNULIB_TOOL --extract-applicability $m\` != all; then \
@ -512,7 +612,7 @@ if ! $skip_gnulib; then
done
# Fetch INSTALL.generic.
$GNULIB_TOOL --copy-file doc/INSTALL.UTF-8 INSTALL.generic
$GNULIB_TOOL --copy-file doc/INSTALL.UTF-8 INSTALL.generic || exit $?
fi
# Make sure we get new versions of files brought in by automake.
@ -546,6 +646,16 @@ aclocal -I ../../m4 -I ../m4 -I gnulib-m4 \
|| exit $?
cd "$dir0"
echo "$0: copying common files to gettext-runtime..."
cp -p gettext-tools/wizard/po-templates/traditional/Makefile.in.in gettext-runtime/po/Makefile.in.in
cp -p gettext-tools/wizard/po-templates/traditional/Rules-quot gettext-runtime/po/Rules-quot
cp -p gettext-tools/wizard/po-templates/traditional/boldquot.sed gettext-runtime/po/boldquot.sed
cp -p gettext-tools/wizard/po-templates/traditional/quot.sed gettext-runtime/po/quot.sed
cp -p gettext-tools/wizard/po-templates/traditional/en@quot.header gettext-runtime/po/en@quot.header
cp -p gettext-tools/wizard/po-templates/traditional/en@boldquot.header gettext-runtime/po/en@boldquot.header
cp -p gettext-tools/wizard/po-templates/traditional/insert-header.sed gettext-runtime/po/insert-header.sed
cp -p gettext-tools/wizard/po-templates/traditional/remove-potcdate.sed gettext-runtime/po/remove-potcdate.sed
echo "$0: generating configure in gettext-runtime..."
cd gettext-runtime
aclocal -I m4 -I ../m4 -I gnulib-m4 \
@ -574,16 +684,17 @@ aclocal -I ../../gettext-runtime/m4 -I ../../m4 \
|| exit $?
cd "$dir0"
echo "$0: copying common files from gettext-runtime to gettext-tools..."
echo "$0: copying common files to gettext-tools..."
cp -p gettext-runtime/ABOUT-NLS gettext-tools/ABOUT-NLS
cp -p gettext-runtime/po/Makefile.in.in gettext-tools/po/Makefile.in.in
cp -p gettext-runtime/po/Rules-quot gettext-tools/po/Rules-quot
cp -p gettext-runtime/po/boldquot.sed gettext-tools/po/boldquot.sed
cp -p gettext-runtime/po/quot.sed gettext-tools/po/quot.sed
cp -p gettext-runtime/po/en@quot.header gettext-tools/po/en@quot.header
cp -p gettext-runtime/po/en@boldquot.header gettext-tools/po/en@boldquot.header
cp -p gettext-runtime/po/insert-header.sed gettext-tools/po/insert-header.sed
cp -p gettext-runtime/po/remove-potcdate.sed gettext-tools/po/remove-potcdate.sed
cp -p gettext-tools/wizard/po-templates/traditional/Makefile.in.in gettext-tools/po/Makefile.in.in
cp -p gettext-tools/wizard/po-templates/traditional/Rules-quot gettext-tools/po/Rules-quot
cp -p gettext-tools/wizard/po-templates/traditional/boldquot.sed gettext-tools/po/boldquot.sed
cp -p gettext-tools/wizard/po-templates/traditional/quot.sed gettext-tools/po/quot.sed
cp -p gettext-tools/wizard/po-templates/traditional/en@quot.header gettext-tools/po/en@quot.header
cp -p gettext-tools/wizard/po-templates/traditional/en@boldquot.header gettext-tools/po/en@boldquot.header
cp -p gettext-tools/wizard/po-templates/traditional/insert-header.sed gettext-tools/po/insert-header.sed
cp -p gettext-tools/wizard/po-templates/traditional/remove-potcdate.sed gettext-tools/po/remove-potcdate.sed
cp -p gettext-tools/wizard/po-templates/traditional/remove-potcdate.sed gettext-tools/examples/po/remove-potcdate.sed
echo "$0: generating configure in gettext-tools..."
cd gettext-tools

View File

@ -20,10 +20,6 @@
# This script requires:
# - Wget
# - XZ Utils
#
# In addition, it fetches the archive.dir.tar.gz file, which contains
# data files used by the autopoint program. If you already have the
# file, place it under gettext-tools/misc, before running this script.
# Usage: ./autopull.sh
@ -32,23 +28,6 @@
./gitsub.sh pull || exit 1
# Fetch gettext-tools/misc/archive.dir.tar.
if ! test -f gettext-tools/misc/archive.dir.tar; then
if ! test -f gettext-tools/misc/archive.dir.tar.xz; then
echo "$0: getting gettext-tools/misc/archive.dir.tar..."
wget -q --timeout=5 -O gettext-tools/misc/archive.dir.tar.xz-t "https://alpha.gnu.org/gnu/gettext/archive.dir-latest.tar.xz" \
&& mv gettext-tools/misc/archive.dir.tar.xz-t gettext-tools/misc/archive.dir.tar.xz
retval=$?
rm -f gettext-tools/misc/archive.dir.tar.xz-t
test $retval -eq 0 || exit $retval
fi
xz -d -c < gettext-tools/misc/archive.dir.tar.xz > gettext-tools/misc/archive.dir.tar-t \
&& mv gettext-tools/misc/archive.dir.tar-t gettext-tools/misc/archive.dir.tar
retval=$?
rm -f gettext-tools/misc/archive.dir.tar-t
test $retval -eq 0 || exit $retval
fi
# func_git_clone_shallow SUBDIR URL REVISION
func_git_clone_shallow ()
{
@ -89,6 +68,7 @@ TREE_SITTER_VERSION=0.23.2
TREE_SITTER_GO_VERSION=0.23.4
TREE_SITTER_RUST_VERSION=0.23.2
TREE_SITTER_TYPESCRIPT_VERSION=0.23.2
TREE_SITTER_OCAML_VERSION=0.23.2
TREE_SITTER_D_VERSION=0.8.2
# Cache the relevant source code. Erase the rest of the tree-sitter projects.
test -d gettext-tools/tree-sitter-$TREE_SITTER_VERSION || {
@ -135,6 +115,20 @@ test -d gettext-tools/tree-sitter-typescript-$TREE_SITTER_TYPESCRIPT_VERSION ||
mv gettext-tools/tree-sitter-typescript-$TREE_SITTER_TYPESCRIPT_VERSION/tsx/src/scanner.c gettext-tools/tree-sitter-typescript-$TREE_SITTER_TYPESCRIPT_VERSION/tsx/src/tsx-scanner.c
rm -rf tree-sitter-typescript
}
test -d gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION || {
func_git_clone_shallow tree-sitter-ocaml https://github.com/tree-sitter/tree-sitter-ocaml.git v$TREE_SITTER_OCAML_VERSION
(cd tree-sitter-ocaml && patch -p1) < gettext-tools/build-aux/tree-sitter-ocaml-portability.diff
mkdir gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION
mkdir gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/common
mkdir gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/grammars
mkdir gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/grammars/ocaml
mv tree-sitter-ocaml/LICENSE gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/LICENSE
mv tree-sitter-ocaml/common/scanner.h gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/common/scanner.h
mv tree-sitter-ocaml/grammars/ocaml/src gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/grammars/ocaml/src
mv gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/grammars/ocaml/src/parser.c gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/grammars/ocaml/src/ocaml-parser.c
mv gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/grammars/ocaml/src/scanner.c gettext-tools/tree-sitter-ocaml-$TREE_SITTER_OCAML_VERSION/grammars/ocaml/src/ocaml-scanner.c
rm -rf tree-sitter-ocaml
}
test -d gettext-tools/tree-sitter-d-$TREE_SITTER_D_VERSION || {
func_git_clone_shallow tree-sitter-d https://github.com/gdamore/tree-sitter-d.git v$TREE_SITTER_D_VERSION
(cd tree-sitter-d && patch -p1) < gettext-tools/build-aux/tree-sitter-d-portability.diff
@ -151,6 +145,7 @@ TREE_SITTER_VERSION=$TREE_SITTER_VERSION
TREE_SITTER_GO_VERSION=$TREE_SITTER_GO_VERSION
TREE_SITTER_RUST_VERSION=$TREE_SITTER_RUST_VERSION
TREE_SITTER_TYPESCRIPT_VERSION=$TREE_SITTER_TYPESCRIPT_VERSION
TREE_SITTER_OCAML_VERSION=$TREE_SITTER_OCAML_VERSION
TREE_SITTER_D_VERSION=$TREE_SITTER_D_VERSION
EOF

View File

@ -1,5 +1,5 @@
# Sed script for post-processing the trace output of subordinate configures.
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
# Copyright (C) 2003-2026 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -13,6 +13,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Written by Bruno Haible.
# Replace invocations of some libtool macros.
s|.AC_ENABLE_SHARED_DEFAULT.|yes|g

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Creating a Java archive (.jar).
# Copyright (C) 2024 Free Software Foundation, Inc.
# Copyright (C) 2024-2026 Free Software Foundation, Inc.
#
# This file is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Bruno Haible <bruno@clisp.org>, 2024.
# Written by Bruno Haible.
# func_usage
# outputs to stdout the --help usage message.
@ -40,7 +40,7 @@ Send patches and bug reports to <bug-gettext@gnu.org>."
func_version ()
{
echo "jar-cf (GNU gettext)"
echo "Copyright (C) 2024 Free Software Foundation, Inc.
echo "Copyright (C) 2026 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
@ -94,13 +94,16 @@ top_srcdir="$2"
shift
shift
# Unset CDPATH. Otherwise, output from 'cd dir' can surprise callers.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
if $jar_program --help 2>&1 | grep '\--date=' >/dev/null; then
# The JAR_PROGRAM supports the --date option. Its effect is to set the given
# date as time stamp on all the ELEMENTs and also the META-INF/MANIFEST.MF.
# Use it, for reproducibility (cf. <https://reproducible-builds.org/>).
if test -d "$top_srcdir/.git"; then
# We are in a git checkout. Use the date of the latest commit.
date=`git log -n 1 --date=iso --format=fuller | sed -n -e 's/^CommitDate: //p' | sed -e 's/ /T/' -e 's/ \(...\)\(..\)$/\1:\2/'`
date=`cd "$top_srcdir" && git log -n 1 --date=iso --format=fuller | sed -n -e 's/^CommitDate: //p' | sed -e 's/ /T/' -e 's/ \(...\)\(..\)$/\1:\2/'`
else
# We are building from a tarball.
# Use the date of the first entry of the ChangeLog file.

View File

@ -2,11 +2,11 @@
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
## by inline-source v2019-02-19.15
# libtool (GNU libtool) 2.5.4
# libtool (GNU libtool) 2.6.0
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc.
# Copyright (C) 1996-2019, 2021-2025 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@ -31,8 +31,8 @@
PROGRAM=libtool
PACKAGE=libtool
VERSION=2.5.4
package_revision=2.5.4
VERSION=2.6.0
package_revision=2.6.0
## ------ ##
@ -2215,7 +2215,7 @@ func_version ()
# End:
# Set a version string.
scriptversion='(GNU libtool) 2.5.4'
scriptversion='(GNU libtool) 2.6.0'
# func_version
# ------------
@ -2299,6 +2299,22 @@ func_help ()
func_usage_message
$ECHO "$long_help_message
If a TAG is supplied, it must use one of the tag names below:
Tag Name Language Name
CC C
CXX C++
OBJC Objective-C
OBJCXX Objective-C++
GCJ Java
F77 Fortran 77
FC Fortran
GO Go
RC Windows Resource
If you do not see a tag name associated with your programming language, then
you are using a compiler that $progname does not support.
MODE must be one of the following:
clean remove files from the build directory
@ -2326,7 +2342,7 @@ include the following information:
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Report bugs to <bug-libtool@gnu.org>.
GNU libtool home page: <https://www.gnu.org/software/libtool/>.
GNU libtool home page: <https://www.gnu.org/s/libtool/>.
General help using GNU software: <https://www.gnu.org/gethelp/>."
exit 0
}
@ -2723,7 +2739,7 @@ libtool_validate_options ()
case $host_os in
# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*)
cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2* | *linux*)
# don't eliminate duplications in $postdeps and $predeps
opt_duplicate_compiler_generated_deps=:
;;
@ -2999,8 +3015,9 @@ func_infer_tag ()
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
func_echo "unable to infer tagged configuration"
func_fatal_error "specify a tag with '--tag'"
func_echo "unable to infer tagged configuration with compiler."
func_echo "Possible use of unsupported compiler."
func_fatal_error "specify a tag with '--tag'. For more information, try '$progname --help'."
# else
# func_verbose "using $tagname tagged configuration"
fi
@ -3162,13 +3179,41 @@ func_convert_core_msys_to_w32 ()
{
$debug_cmd
# awkward: cmd appends spaces to result
# Compatibility for original MSYS
if test "Xone" = "X$lt_cv_cmd_slashes"; then
func_convert_core_msys_to_w32_result=`( cmd /c echo "$1" ) 2>/dev/null |
$SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
else # Assume 'lt_cv_cmd_slashes = "two"'
func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
$SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
fi
if test "$?" -ne 0; then
# on failure, ensure result is empty
func_convert_core_msys_to_w32_result=
fi
}
#end: func_convert_core_msys_to_w32
# func_convert_core_msys_to_w32_with_cygpath ARG
# Convert file name or path ARG with cygpath from MSYS format to w32
# format. Return result in func_convert_core_msys_to_w32_with_cygpath_result.
func_convert_core_msys_to_w32_with_cygpath ()
{
$debug_cmd
# Since MSYS2 is packaged with cygpath, call cygpath in $PATH; no need
# to use LT_CYGPATH in this case.
func_convert_core_msys_to_w32_result=`cygpath "$@" 2>/dev/null |
$SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
if test "$?" -ne 0; then
# on failure, ensure result is empty
func_convert_core_msys_to_w32_result=
fi
}
#end: func_convert_core_msys_to_w32_with_cygpath
# func_convert_file_check ARG1 ARG2
# Verify that ARG1 (a file name in $build format) was converted to $host
# format in ARG2. Otherwise, emit an error message, but continue (resetting
@ -3303,8 +3348,13 @@ func_convert_file_msys_to_w32 ()
func_to_host_file_result=$1
if test -n "$1"; then
func_convert_core_msys_to_w32 "$1"
func_to_host_file_result=$func_convert_core_msys_to_w32_result
if test "Xyes" = "X$cygpath_installed"; then
func_convert_core_msys_to_w32_with_cygpath -w "$1"
func_to_host_file_result=$func_convert_core_msys_to_w32_with_cygpath_result
else
func_convert_core_msys_to_w32 "$1"
func_to_host_file_result=$func_convert_core_msys_to_w32_result
fi
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
@ -3355,8 +3405,13 @@ func_convert_file_msys_to_cygwin ()
func_to_host_file_result=$1
if test -n "$1"; then
func_convert_core_msys_to_w32 "$1"
func_cygpath -u "$func_convert_core_msys_to_w32_result"
if test "Xyes" = "X$cygpath_installed"; then
func_convert_core_msys_to_w32_with_cygpath -w "$1"
func_cygpath -u "$func_convert_core_msys_to_w32_with_cygpath_result"
else
func_convert_core_msys_to_w32 "$1"
func_cygpath -u "$func_convert_core_msys_to_w32_result"
fi
func_to_host_file_result=$func_cygpath_result
fi
func_convert_file_check "$1" "$func_to_host_file_result"
@ -3457,8 +3512,13 @@ func_convert_path_msys_to_w32 ()
# and winepath ignores them completely.
func_stripname : : "$1"
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
func_to_host_path_result=$func_convert_core_msys_to_w32_result
if test "Xyes" = "X$cygpath_installed"; then
func_convert_core_msys_to_w32_with_cygpath -w -p "$func_to_host_path_tmp1"
func_to_host_path_result=$func_convert_core_msys_to_w32_with_cygpath_result
else
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
func_to_host_path_result=$func_convert_core_msys_to_w32_result
fi
func_convert_path_check : ";" \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@ -3522,8 +3582,13 @@ func_convert_path_msys_to_cygwin ()
# See func_convert_path_msys_to_w32:
func_stripname : : "$1"
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
if test "Xyes" = "X$cygpath_installed"; then
func_convert_core_msys_to_w32_with_cygpath -w -p "$func_to_host_path_tmp1"
func_cygpath -u -p "$func_convert_core_msys_to_w32_with_cygpath_result"
else
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
fi
func_to_host_path_result=$func_cygpath_result
func_convert_path_check : : \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
@ -4455,6 +4520,14 @@ func_mode_finish ()
fi
echo
echo "After a 'make install' for many GNU/Linux systems, 'ldconfig LIBDIR'"
echo "may need to be executed to help locate newly installed libraries,"
echo "but you should consult with a system administrator before updating"
echo "the shared library cache as this should be done with great care"
echo "and consideration. (See the 'Platform-specific configuration notes'"
echo "section of the documentation for more information.)"
echo
echo "See any operating system documentation about shared libraries for"
case $host in
solaris2.[6789]|solaris2.1[0-9])
@ -4529,7 +4602,7 @@ func_mode_install ()
prev=$arg
fi
;;
-g | -m | -o)
-g | -m | -o | -S | -t)
prev=$arg
;;
-s)
@ -5045,7 +5118,7 @@ extern \"C\" {
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
export_symbols=$output_objdir/$outputname.exp
export_symbols=$output_objdir/$outputname.expsym
$opt_dry_run || {
$RM $export_symbols
eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
@ -5058,8 +5131,8 @@ extern \"C\" {
}
else
$opt_dry_run || {
eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.expsym"'
eval '$GREP -f "$output_objdir/$outputname.expsym" < "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
case $host in
*cygwin* | *mingw* | *windows* | *cegcc* )
@ -5979,6 +6052,7 @@ int setenv (const char *, const char *, int);
# define getcwd _getcwd
# define putenv _putenv
# define S_IXUSR _S_IEXEC
# define MSVC_ISDIR(m)(((m) & S_IFMT) == S_IFDIR)
#elif defined __MINGW32__
# define setmode _setmode
# define stat _stat
@ -6374,8 +6448,13 @@ check_executable (const char *path)
if ((!path) || (!*path))
return 0;
if ((stat (path, &st) >= 0)
#ifdef _MSC_VER
if ((stat (path, &st) >= 0) && !MSVC_ISDIR (st.st_mode)
&& (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
#else
if ((stat (path, &st) >= 0) && !S_ISDIR (st.st_mode)
&& (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
#endif
return 1;
else
return 0;
@ -7280,8 +7359,13 @@ func_mode_link ()
continue
;;
xlinker)
func_append linker_flags " $qarg"
func_append compiler_flags " $wl$qarg"
func_append linker_flags "$qarg,"
# Args in the var 'compiler_flags' causes warnings in MSVC
func_cc_basename "$CC"
case $func_cc_basename_result in
cl|cl.exe) ;;
*) func_append compiler_flags " $wl$qarg" ;;
esac
prev=
func_append compile_command " $wl$qarg"
func_append finalize_command " $wl$qarg"
@ -7525,8 +7609,6 @@ func_mode_link ()
*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
# The PATH hackery in wrapper scripts is required on Windows
# and Darwin in order for the loader to find any dlls it needs.
func_warning "'-no-install' is ignored for $host"
func_warning "assuming '-no-fast-install' instead"
fast_install=no
;;
*) no_install=yes ;;
@ -7648,6 +7730,11 @@ func_mode_link ()
arg=$func_stripname_result
;;
-Wl,--as-needed|-Wl,--no-as-needed)
deplibs="$deplibs $arg"
continue
;;
-Wl,*)
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
@ -7657,8 +7744,13 @@ func_mode_link ()
IFS=$save_ifs
func_quote_arg pretty "$flag"
func_append arg " $wl$func_quote_arg_result"
func_append compiler_flags " $wl$func_quote_arg_result"
func_append linker_flags " $func_quote_arg_result"
# Args in the var 'compiler_flags' causes warnings in MSVC
func_cc_basename "$CC"
case $func_cc_basename_result in
cl|cl.exe) ;;
*) func_append compiler_flags " $wl$func_quote_arg_result" ;;
esac
func_append linker_flags "$func_quote_arg_result,"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
@ -7704,6 +7796,7 @@ func_mode_link ()
# @file GCC response files
# -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support
# --target=* for target architecture support
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
@ -7721,15 +7814,15 @@ func_mode_link ()
# --unwindlib=* select unwinder library with clang
# -f{file|debug|macro|profile}-prefix-map=* needed for lto linking
# -Wa,* Pass flags directly to the assembler
# -Werror, -Werror=* Report (specified) warnings as errors
# -W* Warnings, needed for lto
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*|--target=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \
-stdlib=*|-rtlib=*|--unwindlib=*| \
-specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
-ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \
-fdiagnostics-color*|-frecord-gcc-switches| \
-fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*)
-fuse-ld=*|-static-*|-fcilkplus|-W*)
func_quote_arg pretty "$arg"
arg=$func_quote_arg_result
func_append compile_command " $arg"
@ -8070,6 +8163,15 @@ func_mode_link ()
lib=
found=false
case $deplib in
-Wl,--as-needed|-Wl,--no-as-needed)
if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
fi
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test prog,link = "$linkmode,$pass"; then
@ -8228,8 +8330,15 @@ func_mode_link ()
fi
case $linkmode in
lib)
# Linking convenience modules into shared libraries is allowed,
# but linking other static libraries is non-portable.
# Linking convenience modules and compiler provided static libraries
# into shared libraries is allowed, but linking other static
# libraries is non-portable.
case $deplib in
*/libgcc*.$libext | */libclang_rt*.$libext)
deplibs="$deplib $deplibs"
continue
;;
esac
case " $dlpreconveniencelibs " in
*" $deplib "*) ;;
*)
@ -9312,29 +9421,21 @@ func_mode_link ()
esac
# Check that each of the things are valid numbers.
case $current in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
func_error "CURRENT '$current' must be a nonnegative integer"
if echo "$current" | $EGREP -v '(^0$)|(^[1-9]$)|(^[1-9][0-9]{1,4}$)' > /dev/null; then
func_error "CURRENT '$current' must be a nonnegative integer and <= 5 digits"
func_fatal_error "'$vinfo' is not valid version information"
;;
esac
fi
case $revision in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
func_error "REVISION '$revision' must be a nonnegative integer"
# Currently limiting revision length by Unix epoch time in nanoseconds.
if echo "$revision" | $EGREP -v '(^0$)|(^[1-9]$)|(^[1-9][0-9]{1,18}$)' > /dev/null; then
func_error "REVISION '$revision' must be a nonnegative integer and <= 19 digits"
func_fatal_error "'$vinfo' is not valid version information"
;;
esac
fi
case $age in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
func_error "AGE '$age' must be a nonnegative integer"
if echo "$age" | $EGREP -v '(^0$)|(^[1-9]$)|(^[1-9][0-9]{1,4}$)' > /dev/null; then
func_error "AGE '$age' must be a nonnegative integer and <= 5 digits"
func_fatal_error "'$vinfo' is not valid version information"
;;
esac
fi
if test "$age" -gt "$current"; then
func_error "AGE '$age' is greater than the current interface number '$current'"
@ -10022,7 +10123,7 @@ func_mode_link ()
if test -z "$export_symbols"; then
if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
func_verbose "generating symbol list for '$libname.la'"
export_symbols=$output_objdir/$libname.exp
export_symbols=$output_objdir/$libname.expsym
$opt_dry_run || $RM $export_symbols
cmds=$export_symbols_cmds
save_ifs=$IFS; IFS='~'
@ -10288,7 +10389,7 @@ func_mode_link ()
${skipped_export-false} && {
func_verbose "generating symbol list for '$libname.la'"
export_symbols=$output_objdir/$libname.exp
export_symbols=$output_objdir/$libname.expsym
$opt_dry_run || $RM $export_symbols
libobjs=$output
# Append the command to create the export file.

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2019-2025 Free Software Foundation, Inc.
# Copyright (C) 2019-2026 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Written by Bruno Haible.
# This script checks whether the files in the GNU gettext package
# have the required copyright headers resp. license notices.
@ -111,6 +112,11 @@ func_check_file ()
# These are a mostly data. They don't have much programmer expression.
return 0 ;;
*/LINGUAS )
# These are generated files that contain only data.
# They don't have any programmer expression.
return 0 ;;
*/ChangeLog* )
# ChangeLog files are convenience information, not worth sueing for.
return 0 ;;
@ -161,7 +167,7 @@ func_check_file ()
# This is a form, used for communication with the FSF.
return 0 ;;
/gettext-tools/misc/archive.dir.tar )
/gettext-tools/autotools/archive.dir.tar )
# This is an archive of files that were part of earlier gettext releases.
# As a binary file, it cannot have a copyright header.
return 0 ;;

View File

@ -1,2 +1,3 @@
Ulrich Drepper wrote the intl subdirectory.
Bruno Haible added the intl-java and libasprintf subdirectories.
Bruno Haible added the intl-java, intl-csharp, intl-d, intl-modula2, and
libasprintf subdirectories.

View File

@ -26,7 +26,7 @@ SUBDIR_libasprintf = libasprintf
else
SUBDIR_libasprintf =
endif
SUBDIRS = doc intl intl-java intl-csharp intl-d intl-modula2 gnulib-lib $(SUBDIR_libasprintf) src po man m4 tests
SUBDIRS = doc intl intl-java intl-csharp intl-d intl-modula2 gnulib-lib $(SUBDIR_libasprintf) src po man m4 tests install-tests
EXTRA_DIST = BUGS
@ -52,15 +52,17 @@ EXTRA_DIST += INSTALL.windows
# Hidden from automake, but really activated. Works around an automake bug.
#distdir: distdir1
.PHONY: distdir1
distdir1: man/gettext.1 man/ngettext.1 man/envsubst.1
man/gettext.1 man/ngettext.1 man/envsubst.1: gen-man1
distdir1: man/gettext.1 man/ngettext.1 man/printf_gettext.1 man/printf_ngettext.1 man/envsubst.1
man/gettext.1 man/ngettext.1 man/printf_gettext.1 man/printf_ngettext.1 man/envsubst.1: gen-man1
.PHONY: gen-man1
gen-man1: src/gettext.c man/gettext.x \
src/ngettext.c man/ngettext.x \
src/printf_gettext.c man/printf_gettext.x \
src/printf_ngettext.c man/printf_ngettext.x \
src/envsubst.c man/envsubst.x
cd gnulib-lib && $(MAKE) $(AM_MAKEFLAGS)
cd src && $(MAKE) $(AM_MAKEFLAGS) gettext$(EXEEXT) ngettext$(EXEEXT) envsubst$(EXEEXT)
cd man && $(MAKE) $(AM_MAKEFLAGS) gettext.1 ngettext.1 envsubst.1
cd src && $(MAKE) $(AM_MAKEFLAGS) gettext$(EXEEXT) ngettext$(EXEEXT) printf_gettext$(EXEEXT) printf_ngettext$(EXEEXT) envsubst$(EXEEXT)
cd man && $(MAKE) $(AM_MAKEFLAGS) gettext.1 ngettext.1 printf_gettext.1 printf_ngettext.1 envsubst.1
maintainer-update-po: $(top_builddir)/config.status

View File

@ -1,3 +1,9 @@
Version 0.26 - July 2025
* Two new programs 'printf_gettext' and 'printf_ngettext' are provided,
that do formatted output with a localized format string in a more
efficient way (without spawning a subshell).
Version 0.25 - April 2025
* New library: libintl_d.a contains the runtime for using GNU gettext

View File

@ -1,5 +1,5 @@
dnl Configuration for the gettext-runtime directory of GNU gettext
dnl Copyright (C) 1995-2025 Free Software Foundation, Inc.
dnl Copyright (C) 1995-2026 Free Software Foundation, Inc.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@ -149,6 +149,10 @@ else
is_woe32dll=no
fi
AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
if test $is_woe32dll = yes; then
AC_DEFINE([WOE32DLL], [1],
[Define when --enable-shared is used on Windows.])
fi
dnl Put some default definitions into config.h.
AH_BOTTOM([
@ -158,11 +162,9 @@ AH_BOTTOM([
the C macro DLL_EXPORT (together with PIC) when compiling for a shared
library (called DLL under Windows) and does not define it when compiling
an object file meant to be linked statically into some executable. */
#if (defined _WIN32 || defined __CYGWIN__) && defined DLL_EXPORT && !defined IN_RELOCWRAPPER
# define DLL_VARIABLE __declspec (dllimport)
#else
# define DLL_VARIABLE
#endif
/* But in the scope of this configure file (gettext-runtime/ without intl and
libasprintf), there is no shared library. So it's simple. */
#define DLL_VARIABLE
/* Extra OS/2 (emx+gcc) defines. */
#if defined __EMX__ && !defined __KLIBC__
@ -218,17 +220,6 @@ AC_SUBST([CROSS_COMPILING])
dnl Checks for optional programs for the tests/lang-* tests.
gl_PROG_ANSI_CXX([CXX], [ANSICXX])
dnl Checks for special libraries for the tests/test-lock test.
dnl On some systems, sched_yield is in librt, rather than in libpthread.
LIBSCHED=
if test $gl_threads_api = posix; then
dnl Solaris has sched_yield in librt, not in libpthread or libc.
AC_CHECK_LIB([rt], [sched_yield], [LIBSCHED=-lrt],
[dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
AC_CHECK_LIB([posix4], [sched_yield], [LIBSCHED=-lposix4])])
fi
AC_SUBST([LIBSCHED])
dnl Determine whether to build libasprintf.
AC_ARG_ENABLE([libasprintf],
[ --disable-libasprintf do not build libasprintf],
@ -247,6 +238,26 @@ dnl Determine variables used by uninstalled-config.sh.
ENABLE_SHARED="$enable_shared"
AC_SUBST([ENABLE_SHARED])
dnl Test for features used in install-tests.
dnl shlibpath_var and PATH_SEPARATOR are set by LT_INIT.
if test $USE_INCLUDED_LIBINTL = yes; then
INSTALLED_LIBINTL="-lintl $LIBICONV $INTL_MACOSX_LIBS $INTL_WINDOWS_LIBS"
else
INSTALLED_LIBINTL=
fi
AC_SUBST([INSTALLED_LIBINTL])
AC_SUBST([PATH_SEPARATOR])
if test -n "${shlibpath_var}"; then
if test "${shlibpath_var}" = PATH; then
AUGMENT_SHLIBPATH="PATH='\$(bindir)'${PATH_SEPARATOR}\"\$\$PATH\";"
else
AUGMENT_SHLIBPATH="${shlibpath_var}='\$(libdir)':\"\$\$${shlibpath_var}\"; export ${shlibpath_var};"
fi
else
AUGMENT_SHLIBPATH=
fi
AC_SUBST([AUGMENT_SHLIBPATH])
AC_CONFIG_SUBDIRS([intl])
AC_CONFIG_SUBDIRS([libasprintf])
@ -280,4 +291,6 @@ AC_CONFIG_FILES([m4/Makefile])
AC_CONFIG_FILES([tests/Makefile])
AC_CONFIG_FILES([install-tests/Makefile])
AC_OUTPUT

View File

@ -1,5 +1,5 @@
## Makefile for the gettext-runtime/doc subdirectory of GNU gettext
## Copyright (C) 1995-1997, 2001-2003, 2006 Free Software Foundation, Inc.
## Copyright (C) 1995-2025 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@ -21,4 +21,9 @@ EXTRA_DIST =
EXTRA_DIST += nls.texi matrix.texi
EXTRA_DIST += rt-gettext.texi rt-ngettext.texi rt-envsubst.texi
EXTRA_DIST += \
rt-gettext.texi \
rt-ngettext.texi \
rt-printf_gettext.texi \
rt-printf_ngettext.texi \
rt-envsubst.texi

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ as a file named @code{ABOUT-NLS}.
@strong{ NOTE: } This documentation section is outdated. It it included
here for historical purposes only.
@set STATUS May 2025
@set STATUS July 2025
Free software is going international! The Free Translation Project is
a way to get maintainers of free software, translators, and users all

View File

@ -1,5 +1,5 @@
@c This file is part of the GNU gettext manual.
@c Copyright (C) 1995-2019 Free Software Foundation, Inc.
@c Copyright (C) 1995-2025 Free Software Foundation, Inc.
@c See the file gettext.texi for copying conditions.
@pindex gettext
@ -13,7 +13,7 @@ gettext [@var{option}] -s [@var{msgid}]...
The @code{gettext} program displays the native language translation of a
textual message.
@noindent @strong{Arguments}
@noindent @strong{Options and arguments}
@table @samp
@item -c @var{context}
@ -43,26 +43,31 @@ interpreted like the System V @samp{echo} program did.
This option is only for compatibility with the @samp{echo} program or shell
built-in. It has no effect.
@item -n
@opindex -n@r{, @code{gettext} option}
This option has only an effect if the @code{-s} option is given. It
suppresses the additional newline at the end.
@item [@var{textdomain}] @var{msgid}
Retrieve translated message corresponding to @var{msgid} from @var{textdomain}.
@end table
@noindent @strong{Informative output}
@table @samp
@item -h
@itemx --help
@opindex -h@r{, @code{gettext} option}
@opindex --help@r{, @code{gettext} option}
Display this help and exit.
@item -n
@opindex -n@r{, @code{gettext} option}
This option has only an effect if the @code{-s} option is given. It
suppresses the additional newline at the end.
@item -V
@itemx --version
@opindex -V@r{, @code{gettext} option}
@opindex --version@r{, @code{gettext} option}
Output version information and exit.
@item [@var{textdomain}] @var{msgid}
Retrieve translated message corresponding to @var{msgid} from @var{textdomain}.
@end table
If the @var{textdomain} parameter is not given, the domain is determined from

View File

@ -1,5 +1,5 @@
@c This file is part of the GNU gettext manual.
@c Copyright (C) 1995-2019 Free Software Foundation, Inc.
@c Copyright (C) 1995-2025 Free Software Foundation, Inc.
@c See the file gettext.texi for copying conditions.
@pindex ngettext
@ -12,7 +12,7 @@ ngettext [@var{option}] [@var{textdomain}] @var{msgid} @var{msgid-plural} @var{c
The @code{ngettext} program displays the native language translation of a
textual message whose grammatical form depends on a number.
@noindent @strong{Arguments}
@noindent @strong{Options and arguments}
@table @samp
@item -c @var{context}
@ -42,6 +42,20 @@ interpreted like the System V @samp{echo} program did.
This option is only for compatibility with the @samp{gettext} program. It has
no effect.
@item @var{textdomain}
Retrieve translated message from @var{textdomain}.
@item @var{msgid} @var{msgid-plural}
Translate @var{msgid} (English singular) / @var{msgid-plural} (English plural).
@item @var{count}
Choose singular/plural form based on this value.
@end table
@noindent @strong{Informative output}
@table @samp
@item -h
@itemx --help
@opindex -h@r{, @code{ngettext} option}
@ -54,15 +68,6 @@ Display this help and exit.
@opindex --version@r{, @code{ngettext} option}
Output version information and exit.
@item @var{textdomain}
Retrieve translated message from @var{textdomain}.
@item @var{msgid} @var{msgid-plural}
Translate @var{msgid} (English singular) / @var{msgid-plural} (English plural).
@item @var{count}
Choose singular/plural form based on this value.
@end table
If the @var{textdomain} parameter is not given, the domain is determined from

View File

@ -0,0 +1,141 @@
@c This file is part of the GNU gettext manual.
@c Copyright (C) 2025 Free Software Foundation, Inc.
@c See the file gettext.texi for copying conditions.
@pindex printf_gettext
@cindex @code{printf_gettext} program, usage
@example
printf_gettext [@var{option}] @var{format} [@var{argument}]...
@end example
@cindex lookup format string translation
@cindex formatted output in Shell
The @code{printf_gettext} program produces formatted output,
applying the native language translation of @var{format}
to the @var{argument}s.
@noindent @strong{Options and arguments}
@table @samp
@item -c @var{context}
@itemx --context=@var{context}
@opindex -c@r{, @code{printf_gettext} option}
@opindex --context@r{, @code{printf_gettext} option}
Specify the context for the format string to be translated.
See @ref{Contexts} for details.
@item @var{format}
The format string.
@item @var{argument}
A string or numeric argument.
@end table
@noindent @strong{Informative output}
@table @samp
@item -h
@itemx --help
@opindex -h@r{, @code{printf_gettext} option}
@opindex --help@r{, @code{printf_gettext} option}
Display this help and exit.
@item -V
@itemx --version
@opindex -V@r{, @code{printf_gettext} option}
@opindex --version@r{, @code{printf_gettext} option}
Output version information and exit.
@end table
The format string consists of
@itemize @bullet
@item
plain text,
@item
directives, that start with @samp{%},
@item
escape sequences, that start with a backslash.
@end itemize
A directive that consumes an argument
@itemize @bullet
@item
starts with @samp{%} or @samp{%@var{m}$} where @var{m} is a positive integer,
@item
is optionally followed by any of the characters
@samp{#}, @samp{0}, @samp{-}, @samp{ }, @samp{+},
each of which acts as a flag,
@item
is optionally followed by a width specification (a nonnegative integer),
@item
is optionally followed by @samp{.} and a precision specification
(an optional nonnegative integer),
@item
is finished by a specifier
@itemize @bullet
@item
@samp{c}, that prints a character,
@item
@samp{s}, that prints a string,
@item
@samp{i}, @samp{d}, that print an integer,
@item
@samp{u}, @samp{o}, @samp{x}, @samp{X},
that print an unsigned (nonnegative) integer,
@item
@samp{e}, @samp{E}, that print a floating-point number in scientific notation,
@item
@samp{f}, @samp{F}, that print a floating-point number without an exponent,
@item
@samp{g}, @samp{G}, that print a floating-point number in general notation,
@item
@samp{a}, @samp{A}, that print a floating-point number in hexadecimal notation.
@end itemize
@end itemize
Some flag+specifier combinations are invalid:
@itemize @bullet
@item
The @samp{#} flag with the specifiers
@samp{c}, @samp{s}, @samp{i}, @samp{d}, @samp{u}.
@item
The @samp{0} flag with the specifiers
@samp{c}, @samp{s}.
@end itemize
Additionally there is the directive @samp{%%}, that prints a single @code{%}.
If a directive specifies the argument by its number (@samp{%@var{m}$} notation),
all directives that consume an argument must do so.
The escape sequences are:
@table @code
@item \\
backslash
@item \a
alert (BEL)
@item \b
backspace (BS)
@item \f
form feed (FF)
@item \n
new line (LF)
@item \r
carriage return (CR)
@item \t
horizontal tab (HT)
@item \v
vertical tab (VT)
@item \@var{nnn}
octal number with 1 to 3 octal digits
@end table
@noindent @strong{Environment Variables}
The translation of the format string is looked up in the translation domain
given by the environment variable @code{TEXTDOMAIN}.
It is looked up in the catalogs directory given by the environment variable
@code{TEXTDOMAINDIR} or, if not present, in the default catalogs directory.

View File

@ -0,0 +1,149 @@
@c This file is part of the GNU gettext manual.
@c Copyright (C) 2025 Free Software Foundation, Inc.
@c See the file gettext.texi for copying conditions.
@pindex printf_ngettext
@cindex @code{printf_ngettext} program, usage
@example
printf_ngettext [@var{option}] @var{format} @var{format-plural} @var{count} [@var{argument}]...
@end example
@cindex lookup format string translation with plural
@cindex formatted output in Shell
The @code{printf_ngettext} program produces formatted output,
applying the native language translation of
@var{format} and @var{format-plural}, depending on @var{count},
to the @var{argument}s.
@noindent @strong{Options and arguments}
@table @samp
@item -c @var{context}
@itemx --context=@var{context}
@opindex -c@r{, @code{printf_ngettext} option}
@opindex --context@r{, @code{printf_ngettext} option}
Specify the context for the format string to be translated.
See @ref{Contexts} for details.
@item @var{format}
English singular form of format string.
@item @var{format-plural}
English plural form of format string.
@item @var{count}
A cardinal number.
The singular/plural form is chosen based on this value.
@item @var{argument}
A string or numeric argument.
@end table
@noindent @strong{Informative output}
@table @samp
@item -h
@itemx --help
@opindex -h@r{, @code{printf_ngettext} option}
@opindex --help@r{, @code{printf_ngettext} option}
Display this help and exit.
@item -V
@itemx --version
@opindex -V@r{, @code{printf_ngettext} option}
@opindex --version@r{, @code{printf_ngettext} option}
Output version information and exit.
@end table
Each format string consists of
@itemize @bullet
@item
plain text,
@item
directives, that start with @samp{%},
@item
escape sequences, that start with a backslash.
@end itemize
A directive that consumes an argument
@itemize @bullet
@item
starts with @samp{%} or @samp{%@var{m}$} where @var{m} is a positive integer,
@item
is optionally followed by any of the characters
@samp{#}, @samp{0}, @samp{-}, @samp{ }, @samp{+},
each of which acts as a flag,
@item
is optionally followed by a width specification (a nonnegative integer),
@item
is optionally followed by @samp{.} and a precision specification
(an optional nonnegative integer),
@item
is finished by a specifier
@itemize @bullet
@item
@samp{c}, that prints a character,
@item
@samp{s}, that prints a string,
@item
@samp{i}, @samp{d}, that print an integer,
@item
@samp{u}, @samp{o}, @samp{x}, @samp{X},
that print an unsigned (nonnegative) integer,
@item
@samp{e}, @samp{E}, that print a floating-point number in scientific notation,
@item
@samp{f}, @samp{F}, that print a floating-point number without an exponent,
@item
@samp{g}, @samp{G}, that print a floating-point number in general notation,
@item
@samp{a}, @samp{A}, that print a floating-point number in hexadecimal notation.
@end itemize
@end itemize
Some flag+specifier combinations are invalid:
@itemize @bullet
@item
The @samp{#} flag with the specifiers
@samp{c}, @samp{s}, @samp{i}, @samp{d}, @samp{u}.
@item
The @samp{0} flag with the specifiers
@samp{c}, @samp{s}.
@end itemize
Additionally there is the directive @samp{%%}, that prints a single @code{%}.
If a directive specifies the argument by its number (@samp{%@var{m}$} notation),
all directives that consume an argument must do so.
The escape sequences are:
@table @code
@item \\
backslash
@item \a
alert (BEL)
@item \b
backspace (BS)
@item \f
form feed (FF)
@item \n
new line (LF)
@item \r
carriage return (CR)
@item \t
horizontal tab (HT)
@item \v
vertical tab (VT)
@item \@var{nnn}
octal number with 1 to 3 octal digits
@end table
@noindent @strong{Environment Variables}
The translation of the format string is looked up in the translation domain
given by the environment variable @code{TEXTDOMAIN}.
It is looked up in the catalogs directory given by the environment variable
@code{TEXTDOMAINDIR} or, if not present, in the default catalogs directory.

View File

@ -0,0 +1,40 @@
## Makefile for gettext-runtime/install-tests.
## Copyright (C) 2025 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
## Process this file with automake to produce Makefile.in.
installcheck-local:
$(CC) -I$(includedir) -L$(libdir) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o test-version $(srcdir)/test-version.c $(INSTALLED_LIBINTL)
@AUGMENT_SHLIBPATH@ ./test-version
rm -rf test-version test-version$(EXEEXT)
$(CC) -I$(includedir) -L$(libdir) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-DSRCDIR=\"$(srcdir)/\" \
$(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o test-api $(srcdir)/test-api.c $(INSTALLED_LIBINTL)
@AUGMENT_SHLIBPATH@ ./test-api
rm -rf test-api test-api$(EXEEXT)
PATH='$(bindir)'@PATH_SEPARATOR@"$$PATH"; gettext --version | grep 'GNU gettext' > /dev/null
EXTRA_DIST = \
test-version.c \
test-api.c itest.pot locale/en_US/LC_MESSAGES/itest.mo
CLEANFILES = \
test-version test-version$(EXEEXT) \
test-api test-api$(EXEEXT)

View File

@ -0,0 +1,22 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the GNU gettext package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: GNU gettext 0.25\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-06-18 20:12+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: test-api.c:68
msgid "She is the doppelganger of my fiancee."
msgstr ""

View File

@ -0,0 +1,78 @@
/* Test parts of the API.
Copyright (C) 2025-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#include <libintl.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined _WIN32 && !defined __CYGWIN__
# define ENGLISH "English_United States"
# define ENCODING ".1252"
# define LOCALE1 ENGLISH ENCODING
#else
# define LOCALE1 "en_US.UTF-8"
#endif
int
main ()
{
/* Clean up environment. */
#if defined _WIN32 && !defined __CYGWIN__
_putenv ("LANGUAGE=");
_putenv ("OUTPUT_CHARSET=");
#else
unsetenv ("LANGUAGE");
unsetenv ("OUTPUT_CHARSET");
#endif
textdomain ("itest");
#if defined _WIN32 && !defined __CYGWIN__
_putenv ("LC_ALL=" LOCALE1);
#else
setenv ("LC_ALL", LOCALE1, 1);
#endif
if (setlocale (LC_ALL, "") == NULL)
{
fprintf (stderr, "Skipping test: Locale %s is not installed.\n", LOCALE1);
return 0;
}
bindtextdomain ("itest", SRCDIR "locale");
bind_textdomain_codeset ("itest", "UTF-8");
const char *s = gettext ("She is the doppelganger of my fiancee.");
const char *expected = "She is the doppelgänger of my fiancée.";
if (strcmp (s, expected) != 0)
{
fprintf (stderr, "gettext() => %s\n", s);
fprintf (stderr, "Expected: %s\n", expected);
return 1;
}
return 0;
}

View File

@ -0,0 +1,36 @@
/* Test the version information.
Copyright (C) 2025-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#include <libintl.h>
#include <stdio.h>
int
main ()
{
#if defined LIBINTL_VERSION /* GNU libintl, not GNU libc */
if (!(libintl_version == LIBINTL_VERSION))
{
fprintf (stderr, "Installation problem: include file says version 0x%x, whereas library says version 0x%x\n",
LIBINTL_VERSION, libintl_version);
return 1;
}
#endif
return 0;
}

View File

@ -1,6 +1,5 @@
/* GNU gettext for C#
* Copyright (C) 2003-2024 Free Software Foundation, Inc.
* Written by Bruno Haible <bruno@clisp.org>, 2003.
* Copyright (C) 2003-2026 Free Software Foundation, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@ -16,6 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/* Written by Bruno Haible. */
/*
* Using the GNU gettext approach, compiled message catalogs are assemblies
* containing just one class, a subclass of GettextResourceSet. They are thus

View File

@ -1,5 +1,5 @@
/+ D bindings to the GNU gettext runtime library.
Copyright © 2025 Free Software Foundation, Inc.
Copyright © 2025-2026 Free Software Foundation, Inc.
Boost Software License - Version 1.0 - August 17th, 2003
@ -26,7 +26,7 @@
DEALINGS IN THE SOFTWARE.
+/
/* Written by Bruno Haible <bruno@clisp.org>, 2025. */
/* Written by Bruno Haible. */
module gnu.libintl.internal.low;

View File

@ -1,5 +1,5 @@
/+ D bindings to the GNU gettext runtime library.
Copyright © 2025 Free Software Foundation, Inc.
Copyright © 2025-2026 Free Software Foundation, Inc.
Boost Software License - Version 1.0 - August 17th, 2003
@ -26,7 +26,7 @@
DEALINGS IN THE SOFTWARE.
+/
/* Written by Bruno Haible <bruno@clisp.org>, 2025. */
/* Written by Bruno Haible. */
module gnu.libintl.libintl;

View File

@ -1,5 +1,5 @@
/+ D bindings to the GNU gettext runtime library.
Copyright © 2025 Free Software Foundation, Inc.
Copyright © 2025-2026 Free Software Foundation, Inc.
Boost Software License - Version 1.0 - August 17th, 2003
@ -26,7 +26,7 @@
DEALINGS IN THE SOFTWARE.
+/
/* Written by Bruno Haible <bruno@clisp.org>, 2025. */
/* Written by Bruno Haible. */
module gnu.libintl;

View File

@ -1,5 +1,5 @@
/* GNU gettext for Java
* Copyright (C) 2001-2024 Free Software Foundation, Inc.
* Copyright (C) 2001-2025 Free Software Foundation, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@ -99,7 +99,6 @@ public abstract class GettextResource extends ResourceBundle {
// is that we want the generated ResourceBundles to be completely
// standalone, so that migration from the Sun approach to the GNU gettext
// approach (without use of plurals) is as straightforward as possible.
ResourceBundle origCatalog = catalog;
do {
// Try catalog itself.
if (verbose)

View File

@ -1,5 +1,5 @@
(* High-level Modula-2 binding to the GNU libintl library.
Copyright (C) 2025 Free Software Foundation, Inc.
Copyright (C) 2025-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. *)
(* Written by Bruno Haible <bruno@clisp.org>, 2025. *)
(* Written by Bruno Haible. *)
DEFINITION MODULE Libintl;

View File

@ -1,5 +1,5 @@
(* High-level Modula-2 binding to the GNU libintl library.
Copyright (C) 2025 Free Software Foundation, Inc.
Copyright (C) 2025-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. *)
(* Written by Bruno Haible <bruno@clisp.org>, 2025. *)
(* Written by Bruno Haible. *)
IMPLEMENTATION MODULE Libintl;

View File

@ -1,5 +1,5 @@
(* Low-level Modula-2 binding to the GNU libintl library.
Copyright (C) 2025 Free Software Foundation, Inc.
Copyright (C) 2025-2026 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. *)
(* Written by Bruno Haible <bruno@clisp.org>, 2025. *)
(* Written by Bruno Haible. *)
DEFINITION MODULE FOR "C" LibintlFromC;

View File

@ -250,7 +250,13 @@ libintl.h: $(srcdir)/libgnuintl.in.h
-e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
-e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \
-e 's,@''ENHANCE_LOCALE_FUNCS''@,@ENHANCE_LOCALE_FUNCS@,g' \
< $(srcdir)/libgnuintl.in.h > libintl.h
< $(srcdir)/libgnuintl.in.h \
| if test '@WOE32DLL@' = 1; then \
sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \
else \
cat; \
fi \
| cat > libintl.h
MOSTLYCLEANFILES += libintl.h
# The Automake generated .y.c rule is broken: When executed in a VPATH build,
@ -441,7 +447,7 @@ endif
# Before making a gettext release, you must change this according to the
# libtool documentation, section "Library interface versions".
LTV_CURRENT=12
LTV_REVISION=4
LTV_REVISION=5
LTV_AGE=4
# How to build libintl.la and libgnuintl.la.
@ -464,7 +470,7 @@ install-exec-local: install-exec-libintl
install-exec-libintl: libintl.la
$(mkdir_p) $(DESTDIR)$(libdir)
$(LIBTOOL) --mode=install \
$(INSTALL_DATA) libintl.la $(DESTDIR)$(libdir)/libintl.la; \
$(INSTALL) libintl.la $(DESTDIR)$(libdir)/libintl.la; \
if test "@RELOCATABLE@" = yes; then \
dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
if test -n "$$dependencies"; then \

View File

@ -1,5 +1,5 @@
/* Implementation of the bindtextdomain(3) function
Copyright (C) 1995-2024 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* Symbols for backward compatibility.
Copyright (C) 2023 Free Software Foundation, Inc.
Copyright (C) 2023-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#include <config.h>
/* Specification. */

View File

@ -1,5 +1,5 @@
/* Implementation of the dcgettext(3) function.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* Implementation of the internal dcigettext function.
Copyright (C) 1995-2025 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
/* Tell glibc's <string.h> to provide a prototype for mempcpy().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */

View File

@ -1,5 +1,5 @@
/* Implementation of the dcngettext(3) function.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* Implementation of the dgettext(3) function.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* Implementation of the dngettext(3) function.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* Plural expression evaluation.
Copyright (C) 2000-2023 Free Software Foundation, Inc.
Copyright (C) 2000-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifndef STATIC
#define STATIC static
#endif

View File

@ -1,5 +1,4 @@
/* Copyright (C) 1995-2016, 2020 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
/* Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +13,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* Control of exported symbols from libintl.
Copyright (C) 2005-2023 Free Software Foundation, Inc.
Copyright (C) 2005-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#if @HAVE_VISIBILITY@ && BUILDING_LIBINTL
# define LIBINTL_SHLIB_EXPORTED __attribute__((__visibility__("default")))
#elif (defined _WIN32 && !defined __CYGWIN__) && @WOE32DLL@ && BUILDING_LIBINTL

View File

@ -1,6 +1,5 @@
/* Handle list of needed message catalogs
Copyright (C) 1995-2024 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.org>, 1995.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* Implementation of gettext(3) function.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,6 +1,5 @@
/* Header describing internals of libintl library.
Copyright (C) 1995-2024 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifndef _GETTEXTP_H
#define _GETTEXTP_H

View File

@ -1,5 +1,5 @@
/* Description of GNU message catalog format: general file layout.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifndef _GETTEXT_H
#define _GETTEXT_H 1

View File

@ -1,5 +1,5 @@
/* Implements a string hashing function.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -16,6 +16,8 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* Description of GNU message catalog format: string hashing function.
Copyright (C) 1995-2023 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
/* @@ end of prolog @@ */
#ifndef attribute_hidden

View File

@ -1,5 +1,5 @@
/* Redirections from public function names to GNU libintl functions.
Copyright (C) 1995, 2000-2003, 2005, 2023 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,6 +1,5 @@
/* List of exported symbols of libintl on Cygwin.
Copyright (C) 2006, 2012-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
Copyright (C) 2006-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
/* IMP(x) is a symbol that contains the address of x. */
#if defined _WIN64 || defined _LP64
# define IMP(x) __imp_##x

View File

@ -1,5 +1,4 @@
/* Copyright (C) 1995-2023 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
/* Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +13,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
/* Tell glibc's <string.h> to provide a prototype for stpcpy().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */

View File

@ -1,5 +1,5 @@
/* Determine the user's language preferences.
Copyright (C) 2004-2007, 2018-2024 Free Software Foundation, Inc.
Copyright (C) 2004-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,8 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>.
Win32 code originally by Michele Cicciotti <hackbunny@reactos.com>. */
/* Written by Bruno Haible.
Win32 code originally by Michele Cicciotti. */
#ifdef HAVE_CONFIG_H
# include <config.h>

View File

@ -1,5 +1,5 @@
/* Message catalogs for internationalization.
Copyright (C) 1995-2025 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifndef _LIBINTL_H
#define _LIBINTL_H 1
@ -54,7 +56,7 @@ extern "C" {
/* Version number: (major<<16) + (minor<<8) + subminor */
#define LIBINTL_VERSION 0x001900
#define LIBINTL_VERSION 0x001A00
extern int libintl_version;
@ -120,7 +122,7 @@ extern int libintl_version;
/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
If he doesn't, we choose the method. */
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
# if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
# if ((defined __GNUC__ && __GNUC__ >= 2) || defined __clang__) && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
# define _INTL_REDIRECT_ASM
# else
# if defined __cplusplus && defined _INTL_HAS_FORCE_INLINE

View File

@ -1,5 +1,5 @@
/* Message catalogs for internationalization.
Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is derived from the file libgettext.h in the GNU gettext package.
@ -17,6 +17,8 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper. */
#ifndef _LIBINTL_H
#define _LIBINTL_H 1

View File

@ -1,6 +1,5 @@
/* Copyright (C) 1996-2023 Free Software Foundation, Inc.
/* Copyright (C) 1996-2026 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifndef _LOADINFO_H
#define _LOADINFO_H 1

View File

@ -1,5 +1,5 @@
/* Load needed message catalogs.
Copyright (C) 1995-2024 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
/* Tell glibc's <string.h> to provide a prototype for mempcpy().
This must come before <config.h> because <config.h> may include
<features.h>, and once <features.h> has been included, it's too late. */
@ -1018,7 +1020,10 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
/* Allocate additional memory. */
mem = (char *) malloc (memneed);
if (mem == NULL)
goto invalid;
{
free (sysdep_segment_values);
goto invalid;
}
domain->malloced = mem;
inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem;

View File

@ -1,5 +1,5 @@
/* Handle aliases for locale names.
Copyright (C) 1995-2024 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
/* Locale aliases can be specified in the file $(localedir)/locale.alias.
It consists of lines of the form
<alias> <real-locale-name>

View File

@ -1,5 +1,5 @@
/* Log file output.
Copyright (C) 2003-2023 Free Software Foundation, Inc.
Copyright (C) 2003-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>. */
/* Written by Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>

View File

@ -1,5 +1,5 @@
/* Implementation of ngettext(3) function.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* OS/2 compatibility functions.
Copyright (C) 2001-2002 Free Software Foundation, Inc.
Copyright (C) 2001-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#define OS2_AWARE
#ifdef HAVE_CONFIG_H
#include <config.h>

View File

@ -1,6 +1,6 @@
/* OS/2 compatibility defines.
This file is intended to be included from config.h
Copyright (C) 2001-2002 Free Software Foundation, Inc.
Copyright (C) 2001-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +15,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
/* When included from os2compat.h we need all the original definitions */
#ifndef OS2_AWARE

View File

@ -1,5 +1,5 @@
/* OS dependent parts of libintl.
Copyright (C) 2001-2002, 2006, 2012, 2015 Free Software Foundation, Inc.
Copyright (C) 2001-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#if defined __CYGWIN__ || defined __MINGW32__
# include "intl-exports.c"
#elif defined __EMX__ && !defined __KLIBC__

View File

@ -1,6 +1,5 @@
/* Expression parsing for plural form selection.
Copyright (C) 2000-2023 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
Copyright (C) 2000-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,6 +1,5 @@
/* Expression parsing and evaluation for plural form selection.
Copyright (C) 2000-2024 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
Copyright (C) 2000-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper, Bruno Haible, and Daiki Ueno. */
#ifndef _PLURAL_EXP_H
#define _PLURAL_EXP_H

View File

@ -1,7 +1,6 @@
%{
/* Expression parsing for plural form selection.
Copyright (C) 2000-2023 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
Copyright (C) 2000-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -16,6 +15,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper, Bruno Haible, and Daiki Ueno. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,6 +1,5 @@
/* Formatted output to strings, using POSIX/XSI format strings with positions.
Copyright (C) 2003, 2006-2007, 2009-2011, 2018, 2020-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
Copyright (C) 2003-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,6 +1,5 @@
/* setlocale() function that respects the locale chosen by the user.
Copyright (C) 2009, 2011-2025 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
Copyright (C) 2009-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* Implementation of the textdomain(3) function.
Copyright (C) 1995-2024 Free Software Foundation, Inc.
Copyright (C) 1995-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Ulrich Drepper and Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
/* libintl library version.
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 2005-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@ -1,5 +1,5 @@
## Makefile for the gettext-runtime/libasprintf subdirectory of GNU gettext
## Copyright (C) 2002-2024 Free Software Foundation, Inc.
## Copyright (C) 2002-2025 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Public License as published by
@ -24,6 +24,7 @@ SUBDIRS = gnulib-lib
EXTRA_DIST =
BUILT_SOURCES =
MOSTLYCLEANFILES =
MAINTAINERCLEANFILES =
RM = rm -f
@ -225,6 +226,7 @@ uninstall-html:
$(RM) $(DESTDIR)$(htmldir)/autosprintf.html
EXTRA_DIST += autosprintf_all.html
MAINTAINERCLEANFILES += autosprintf_all.html
# Windows support.

View File

@ -1,5 +1,5 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
Copyright (C) 1999-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#include <config.h>
/* Specification. */

View File

@ -1,5 +1,5 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
Copyright (C) 1999-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#include <config.h>
/* Specification. */

View File

@ -1,6 +1,5 @@
/* Class autosprintf - formatted output to an ostream.
Copyright (C) 2002, 2013, 2015, 2018, 2021 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
Copyright (C) 2002-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#include <config.h>
/* Specification. */

View File

@ -1,5 +1,5 @@
/* Class autosprintf - formatted output to an ostream.
Copyright (C) 2002, 2012-2016 Free Software Foundation, Inc.
Copyright (C) 2002, 2012-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,16 +14,18 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#ifndef _AUTOSPRINTF_H
#define _AUTOSPRINTF_H
/* This feature is available in gcc versions 2.5 and later. */
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
/* This feature is available in gcc versions 2.5 and later and in clang. */
#if !((__GNUC__ >= 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || defined __clang__) && !__STRICT_ANSI__)
# define _AUTOSPRINTF_ATTRIBUTE_FORMAT() /* empty */
#else
/* The __-protected variants of 'format' and 'printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
/* The __-protected variants of 'format' and 'printf' attributes are
accepted by gcc versions 2.6.4 (effectively 2.7) and later and in clang. */
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__
# define _AUTOSPRINTF_ATTRIBUTE_FORMAT() \
__attribute__ ((__format__ (__printf__, 2, 3)))
# else

View File

@ -36,7 +36,7 @@
This file provides documentation for GNU @code{autosprintf} library.
@copying
Copyright (C) 2002-2003, 2006-2007, 2018-2019 Free Software Foundation, Inc.
Copyright (C) 2002-2003, 2006-2007, 2018-2019, 2025 Free Software Foundation, Inc.
This manual is free documentation. It is dually licensed under the
GNU FDL and the GNU GPL. This means that you can redistribute this
@ -172,21 +172,46 @@ given @code{ostream}.
@node Using autosprintf
@chapter Using @code{autosprintf} in own programs
To use the @code{autosprintf} class in your programs, you need to add
To use the @code{autosprintf} class in your programs, you need to make
changes in the source code and in the build system.
@node Source code changes
@section Source code changes
In source code files that shall use @code{autosprintf}, add
@smallexample
#include "autosprintf.h"
using gnu::autosprintf;
@end smallexample
@noindent
to your source code.
The include file defines the class @code{autosprintf}, in a namespace called
@code{gnu}. The @samp{using} statement makes it possible to use the class
without the (otherwise natural) @code{gnu::} prefix.
@node Build system changes
@section Build system changes
When compiling your program with @code{g++}, use the warning option @code{-Wall}.
@c g++ does not warn by default,
@c see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867
This is needed so that you get a compiler warning when attempting to pass
an @code{std::string} as argument.
For example, if you accidentally write
@smallexample
std::string s = ...;
cout << autosprintf ("Look at %s\n", s);
@end smallexample
@noindent
you want to get a compiler warning about passing an @code{std::string} through
a variadic argument list, so that you can correct your code to
@smallexample
std::string s = ...;
cout << autosprintf ("Look at %s\n", s.c_str ());
@end smallexample
When linking your program, you need to link with @code{libasprintf}, because
that's where the class is defined. In projects using GNU @code{autoconf},
that's where the class is defined. In projects that use GNU @code{autoconf},
this means adding @samp{AC_LIB_LINKFLAGS([asprintf])} to @code{configure.in}
or @code{configure.ac}, and using the @@LIBASPRINTF@@ Makefile variable that
it provides.

View File

@ -1,6 +1,5 @@
/* Library functions for class autosprintf.
Copyright (C) 2002-2003, 2006, 2018-2019, 2021 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
Copyright (C) 2002-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#include <config.h>
#if !(HAVE_VASPRINTF && HAVE_POSIX_PRINTF)

View File

@ -1,6 +1,5 @@
/* Library functions for class autosprintf.
Copyright (C) 2002-2003, 2018 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
Copyright (C) 2002-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -15,9 +14,9 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/* Written by Bruno Haible. */
#include <config.h>
#if HAVE_VASPRINTF && HAVE_POSIX_PRINTF

View File

@ -1,5 +1,5 @@
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
Copyright (C) 1999-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#include <config.h>
/* Specification. */

View File

@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
Copyright (C) 2002-2003, 2012 Free Software Foundation, Inc.
Copyright (C) 2002-2003, 2012-2026 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@ -14,6 +14,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible. */
#ifndef _VASPRINTF_H
#define _VASPRINTF_H
@ -21,13 +23,13 @@
#include <stdarg.h>
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
/* This feature is available in gcc versions 2.5 and later and in clang. */
# if !((__GNUC__ >= 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || defined __clang__) && !__STRICT_ANSI__)
# define __attribute__(Spec) /* empty */
# endif
/* The __-protected variants of 'format' and 'printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
/* The __-protected variants of 'format' and 'printf' attributes are
accepted by gcc versions 2.6.4 (effectively 2.7) and later and in clang. */
# if !(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__)
# define __format__ format
# define __printf__ printf
# endif

View File

@ -1,6 +1,6 @@
# gettext.m4
# serial 81 (gettext-0.24)
dnl Copyright (C) 1995-2025 Free Software Foundation, Inc.
# serial 86 (gettext-1.0)
dnl Copyright (C) 1995-2026 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -15,9 +15,7 @@ dnl by the GNU Lesser General Public License, and the rest of the GNU
dnl gettext package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <bruno@clisp.org>, 2000-2024.
dnl From Ulrich Drepper, Bruno Haible, Daiku Ueno.
dnl Macro to add for using GNU gettext.
@ -93,9 +91,18 @@ AC_DEFUN([AM_GNU_GETTEXT],
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
])
dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
dnl On Mac OS X, libintl requires linking with CoreFoundation.
gt_INTL_MACOSX
dnl On native Windows, libintl requires linking with advapi32,
dnl because langprefs.c (_nl_language_preferences_win32_95) uses functions
dnl from advapi32.dll.
AC_REQUIRE([AC_CANONICAL_HOST])
INTL_WINDOWS_LIBS=
case "$host_os" in
mingw* | windows*) INTL_WINDOWS_LIBS='-ladvapi32' ;;
esac
dnl Set USE_NLS.
AC_REQUIRE([AM_NLS])
@ -119,15 +126,15 @@ AC_DEFUN([AM_GNU_GETTEXT],
if test "$USE_NLS" = "yes"; then
gt_use_preinstalled_gnugettext=no
m4_if(gt_building_libintl_in_same_build_tree, yes, [
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH([included-gettext],
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
AC_MSG_CHECKING([whether included libintl is requested])
AC_ARG_WITH([included-libintl],
[ --with-included-libintl use the GNU libintl library included here],
gt_cv_force_use_gnu_libintl=$withval,
gt_cv_force_use_gnu_libintl=no)
AC_MSG_RESULT([$gt_cv_force_use_gnu_libintl])
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
gt_cv_use_gnu_libintl="$gt_cv_force_use_gnu_libintl"
if test "$gt_cv_force_use_gnu_libintl" != "yes"; then
])
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If GNU gettext is available we use this. Else we have
@ -151,13 +158,37 @@ changequote([,])dnl
gt_expression_test_code=
fi
dnl In the test code below:
dnl * We test for the presence of _nl_msg_cat_cntr because GNU libc and
dnl libintl define this variable, whereas Solaris 10 libc/libintl
dnl (which we don't want to use, as it does not support GNU .mo files)
dnl does not define it.
dnl * We don't test for _nl_msg_cat_cntr on MSVC, because the use of a
dnl variable under MSVC depends on whether it is exported by a shared
dnl library or a static library: If libintl is a shared library, we
dnl would have to declare it with __declspec(dllimport), whereas if it
dnl is a static library, we would have to declare it without such a
dnl __declspec. But libintl comes with just one header file,
dnl <libintl.h>, that does not declare _nl_msg_cat_cntr and that does
dnl not tell us whether the library was built shared or static.
dnl * We test for the presence of _nl_domain_bindings because GNU libc
dnl defines this variable, whereas NetBSD libc (which we don't want to
dnl use, as it was broken at least in 2002) does not define it.
dnl * We test for the presence of _nl_expand_alias because GNU libintl
dnl defines this function, whereas NetBSD libintl (which we don't want
dnl to use, as it was broken at least in 2002) does not define it.
AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <libintl.h>
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#if defined _MSC_VER
#define _nl_msg_cat_cntr 0
#else
extern int _nl_msg_cat_cntr;
#endif
extern int *_nl_domain_bindings;
#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
#else
@ -169,7 +200,28 @@ $gt_revision_test_code
bindtextdomain ("", "");
return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
]])],
[eval "$gt_func_gnugettext_libc=yes"],
[dnl Solaris 11.[0-3] doesn't strip the CODESET part from the locale name,
dnl when looking for a message catalog. E.g. when the locale is fr_FR.UTF-8,
dnl on Solaris 11.[0-3] it looks for
dnl <LOCALEDIR>/fr_FR.UTF-8/LC_MESSAGES/<domain>.mo
dnl <LOCALEDIR>/fr.UTF-8/LC_MESSAGES/<domain>.mo
dnl Similarly, on Solaris 11 OpenIndiana and Solaris 11 OmniOS it looks only for
dnl <LOCALEDIR>/fr_FR.UTF-8/LC_MESSAGES/<domain>.mo
dnl Reported at <https://www.illumos.org/issues/13423>.
dnl On Solaris 11.4 this is fixed: it looks for
dnl <LOCALEDIR>/fr_FR.UTF-8/LC_MESSAGES/<domain>.mo
dnl <LOCALEDIR>/fr.UTF-8/LC_MESSAGES/<domain>.mo
dnl <LOCALEDIR>/fr_FR/LC_MESSAGES/<domain>.mo
dnl <LOCALEDIR>/fr/LC_MESSAGES/<domain>.mo
if test "`uname -sr`" = 'SunOS 5.11'; then
case `uname -v` in
11.4 | 11.4.*) eval "$gt_func_gnugettext_libc=yes" ;;
*) eval "$gt_func_gnugettext_libc=no" ;;
esac
else
eval "$gt_func_gnugettext_libc=yes"
fi
],
[eval "$gt_func_gnugettext_libc=no"])])
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
@ -194,7 +246,11 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
[[
#include <libintl.h>
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#if defined _MSC_VER
#define _nl_msg_cat_cntr 0
#else
extern int _nl_msg_cat_cntr;
#endif
extern
#ifdef __cplusplus
"C"
@ -213,11 +269,13 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
[eval "$gt_func_gnugettext_libintl=yes"],
[eval "$gt_func_gnugettext_libintl=no"])
dnl Now see whether libintl exists and depends on libiconv or other
dnl OS dependent libraries, specifically on macOS and AIX.
gt_LIBINTL_EXTRA="$INTL_MACOSX_LIBS"
AC_REQUIRE([AC_CANONICAL_HOST])
dnl OS dependent libraries, specifically on macOS, AIX, and native
dnl Windows.
gt_LIBINTL_EXTRA=
case "$host_os" in
aix*) gt_LIBINTL_EXTRA="-lpthread" ;;
darwin*) gt_LIBINTL_EXTRA="$INTL_MACOSX_LIBS" ;;
aix*) gt_LIBINTL_EXTRA="-lpthread" ;;
mingw* | windows*) gt_LIBINTL_EXTRA="$INTL_WINDOWS_LIBS" ;;
esac
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } \
&& { test -n "$LIBICONV" || test -n "$gt_LIBINTL_EXTRA"; }; then
@ -227,7 +285,11 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
[[
#include <libintl.h>
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#if defined _MSC_VER
#define _nl_msg_cat_cntr 0
#else
extern int _nl_msg_cat_cntr;
#endif
extern
#ifdef __cplusplus
"C"
@ -273,11 +335,15 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
dnl GNU gettext is not found in the C library.
dnl Fall back on included GNU gettext library.
nls_cv_use_gnu_gettext=yes
gt_cv_use_gnu_libintl=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
AC_REQUIRE([AC_CANONICAL_HOST])
if test "$gt_cv_use_gnu_libintl" = "yes" \
|| case "$host_os" in cygwin*) true;; *) false;; esac; then
dnl GNU gettext is not found in the C library or is,
dnl like on Cygwin, a component of the C library.
dnl Mark actions used to generate GNU NLS library.
USE_INCLUDED_LIBINTL=yes
LIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
@ -287,7 +353,7 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
CATOBJEXT=
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
|| test "$gt_cv_use_gnu_libintl" = "yes"; then
dnl Mark actions to use GNU gettext tools.
CATOBJEXT=.gmo
fi
@ -295,15 +361,24 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
if test -n "$INTL_MACOSX_LIBS"; then
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Some extra flags are needed during linking.
|| test "$gt_cv_use_gnu_libintl" = "yes"; then
dnl Some extra options are needed during linking.
LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
fi
fi
if test -n "$INTL_WINDOWS_LIBS"; then
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$gt_cv_use_gnu_libintl" = "yes"; then
dnl Some extra options are needed during linking.
LIBINTL="$LIBINTL $INTL_WINDOWS_LIBS"
LTLIBINTL="$LTLIBINTL $INTL_WINDOWS_LIBS"
fi
fi
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
|| test "$gt_cv_use_gnu_libintl" = "yes"; then
AC_DEFINE([ENABLE_NLS], [1],
[Define to 1 if translation of program messages to the user's native language
is requested.])

View File

@ -1,14 +1,14 @@
# glibc2.m4
# serial 3
dnl Copyright (C) 2000-2024 Free Software Foundation, Inc.
# serial 4
dnl Copyright (C) 2000-2026 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This file is offered as-is, without any warranty.
# Test for the GNU C Library, version 2.0 or newer.
# From Bruno Haible.
dnl From Bruno Haible.
dnl Test for the GNU C Library, version 2.0 or newer.
AC_DEFUN([gt_GLIBC2],
[
AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer],

View File

@ -1,6 +1,6 @@
# nls.m4
# serial 6 (gettext-0.24)
dnl Copyright (C) 1995-2025 Free Software Foundation, Inc.
# serial 7 (gettext-1.0)
dnl Copyright (C) 1995-2026 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -15,9 +15,7 @@ dnl by the GNU Lesser General Public License, and the rest of the GNU
dnl gettext package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
dnl From Ulrich Drepper, Bruno Haible.
AC_PREREQ([2.50])

View File

@ -1,6 +1,6 @@
# po.m4
# serial 34 (gettext-0.24)
dnl Copyright (C) 1995-2024 Free Software Foundation, Inc.
# serial 35 (gettext-1.0)
dnl Copyright (C) 1995-2026 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -15,9 +15,7 @@ dnl by the GNU Lesser General Public License, and the rest of the GNU
dnl gettext package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <bruno@clisp.org>, 2000-2024.
dnl From Ulrich Drepper, Bruno Haible.
AC_PREREQ([2.60])

View File

@ -1,6 +1,6 @@
# progtest.m4
# serial 10 (gettext-0.24)
dnl Copyright (C) 1996-2025 Free Software Foundation, Inc.
# serial 12 (gettext-1.0)
dnl Copyright (C) 1996-2026 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -15,8 +15,7 @@ dnl by the GNU Lesser General Public License, and the rest of the GNU
dnl gettext package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
dnl From Ulrich Drepper, Bruno Haible.
AC_PREREQ([2.53])
@ -68,7 +67,7 @@ AC_CACHE_VAL([ac_cv_path_$1],
test -z "$ac_dir" && ac_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
echo "$as_me:${as_lineno-$LINENO}: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
break 2

View File

@ -1,6 +1,5 @@
## Makefile for the gettext-runtime/man subdirectory of GNU gettext
## Copyright (C) 2001-2003, 2006, 2009, 2013-2014, 2018-2019 Free Software Foundation,
## Inc.
## Copyright (C) 2001-2025 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@ -24,12 +23,12 @@ EXTRA_DIST =
# A manual page for each of the bin_PROGRAMS in src/Makefile.am.
man_aux = gettext.x ngettext.x envsubst.x
man_aux = gettext.x ngettext.x printf_gettext.x printf_ngettext.x envsubst.x
# Likewise, plus additional manual pages for the libintl functions.
man_MAN1GEN = gettext.1 ngettext.1
man_MAN1IN = gettext.1.in ngettext.1.in
man_MAN1GEN = gettext.1 ngettext.1 printf_gettext.1 printf_ngettext.1
man_MAN1IN = gettext.1.in ngettext.1.in printf_gettext.1.in printf_ngettext.1.in
man_MAN1OTHER = envsubst.1
man_MAN1 = $(man_MAN1GEN) $(man_MAN1OTHER)
man_MAN3 = gettext.3 ngettext.3 \
@ -40,8 +39,8 @@ man_MAN3LINK = dgettext.3 dcgettext.3 dngettext.3 dcngettext.3
man_MANS = $(man_MAN1)
notrans_man_MANS = $(man_MAN3) $(man_MAN3LINK)
man_HTML1GEN = gettext.1.html ngettext.1.html
man_HTML1IN = gettext.1.html.in ngettext.1.html.in
man_HTML1GEN = gettext.1.html ngettext.1.html printf_gettext.1.html printf_ngettext.1.html
man_HTML1IN = gettext.1.html.in ngettext.1.html.in printf_gettext.1.html.in printf_ngettext.1.html.in
man_HTML1OTHER = envsubst.1.html
man_HTML1 = $(man_HTML1GEN) $(man_HTML1OTHER)
man_HTML3 = gettext.3.html ngettext.3.html \
@ -108,6 +107,8 @@ $(man_MAN1GEN): Makefile
gettext.1: gettext.1.in
ngettext.1: ngettext.1.in
printf_gettext.1: printf_gettext.1.in
printf_ngettext.1: printf_ngettext.1.in
$(man_MAN1IN) $(man_MAN1OTHER): help2man $(top_srcdir)/../.version
progname=`echo $@ | sed -e 's/\.in$$//' -e 's/\.1$$//'`; \
@ -116,6 +117,8 @@ $(man_MAN1IN) $(man_MAN1OTHER): help2man $(top_srcdir)/../.version
gettext.1.in: gettext.x ../src/gettext.c
ngettext.1.in: ngettext.x ../src/ngettext.c
printf_gettext.1.in: printf_gettext.x ../src/printf_gettext.c
printf_ngettext.1.in: printf_ngettext.x ../src/printf_ngettext.c
envsubst.1: envsubst.x ../src/envsubst.c
$(man_MAN3): $(top_srcdir)/../.version
@ -143,6 +146,8 @@ $(man_HTML1GEN): Makefile
gettext.1.html: gettext.1.html.in
ngettext.1.html: ngettext.1.html.in
printf_gettext.1.html: printf_gettext.1.html.in
printf_ngettext.1.html: printf_ngettext.1.html.in
$(man_HTML1IN):
srcdir=''; \
@ -153,6 +158,8 @@ $(man_HTML1IN):
gettext.1.html.in: gettext.1.in
ngettext.1.html.in: ngettext.1.in
printf_gettext.1.html.in: printf_gettext.1.in
printf_ngettext.1.html.in: printf_ngettext.1.in
$(man_HTML1OTHER):
srcdir=''; \

View File

@ -1,4 +1,4 @@
.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
.\" Copyright (c) Bruno Haible <bruno@clisp.org>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as

View File

@ -1,4 +1,4 @@
.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
.\" Copyright (c) Bruno Haible <bruno@clisp.org>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as

View File

@ -1,3 +1,12 @@
.\" Copyright (c) Free Software Foundation, Inc.
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" Written by Bruno Haible.
.\"
[NAME]
envsubst \- substitutes environment variables in shell format strings
[DESCRIPTION]

View File

@ -1,4 +1,4 @@
.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
.\" Copyright (c) Bruno Haible <bruno@clisp.org>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as

View File

@ -1,3 +1,12 @@
.\" Copyright (c) Free Software Foundation, Inc.
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" Written by Bruno Haible.
.\"
[NAME]
gettext \- translate message
[DESCRIPTION]

Some files were not shown because too many files have changed in this diff Show More