370 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
a9583d31f7 Add a NEWS entry.
* NEWS: Mention the format string heuristic improvements.
2025-06-02 02:23:00 +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
a6cafd7ae4 xgettext: Allow ignoring specific files in the POT-Creation-Date computation.
Reported by Vaclav Slavik <vaclav@slavik.io>
at <https://savannah.gnu.org/users/vslavik>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add hashkey-string, set.
* gettext-tools/src/xgettext.c: Include gl_set.h, gl_xset.h, gl_hash_set.h,
hashkey-string.h.
(generated_files): New variables.
(long_options): New option '--generated'.
(main): Initialize generated_files. Handle the option '--generated'.
(usage): Document the option '--generated'.
(finalize_header): Filter out the generated_files from the file list.
* gettext-tools/doc/xgettext.texi: Document the option '--generated'.
* gettext-tools/tests/xgettext-git-1: Test the --generated option.
* NEWS: Mention the new option.
2025-05-04 18:44:22 +02:00
Bruno Haible
26c8529d0e xgettext: Add an option to opt-out of the use of git for the POT-Creation-Date.
Reported by Serhii Tereshchenko at <https://savannah.gnu.org/bugs/?66865>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add stat-time.
* gettext-tools/src/xgettext.c: Include stat-time.h.
(xgettext_no_git): New variable.
(long_options): Add option '--no-git'.
(main): Handle the option --no-git.
(usage): Document the option --no-git.
(struct accumulator): New type, copied from gnulib/lib/vc-mtime.c.
(accumulate): New function, copied from gnulib/lib/vc-mtime.c.
(max_mtime_without_git): New function, based on gnulib/lib/vc-mtime.c.
(finalize_header): Conditionally invoke max_mtime_without_git instead of
max_vc_mtime.
* gettext-tools/doc/xgettext.texi: Document the option --no-git.
* NEWS: Mention the change.
2025-05-02 16:06:45 +02:00
Bruno Haible
7e61dc102e xgettext: Speed up the computation of the POT-Creation-Date.
Reported by Serhii Tereshchenko, Arthur, Adam YS, Foucauld Degeorges
at <https://savannah.gnu.org/bugs/?66865>.

* gettext-tools/src/xgettext.c (has_some_mtimes, max_of_mtimes, some_mtimes_failed): Remove variables.
(files_for_vc_mtime): New variable.
(main): Initialize files_for_vc_mtime. Update files_for_vc_mtime instead of calling consider_vc_mtime.
(consider_vc_mtime): Remove function.
(read_exclusion_file, extract_from_file, extract_from_xml_file): Update files_for_vc_mtime instead of calling consider_vc_mtime.
(finalize_header): Call max_vc_mtime.
* NEWS: Mention the speedup.
2025-05-02 02:46:11 +02:00
Bruno Haible
e7650ab0fa examples: Add hello-modula2 example.
* gettext-tools/examples/hello-modula2/INSTALL: New file.
* gettext-tools/examples/hello-modula2/autogen.sh: New file.
* gettext-tools/examples/hello-modula2/autoclean.sh: New file.
* gettext-tools/examples/hello-modula2/hello.mod.in: New file.
* gettext-tools/examples/hello-modula2/Makefile.am: New file.
* gettext-tools/examples/hello-modula2/configure.ac: New file.
* gettext-tools/examples/hello-modula2/m4/Makefile.am: New file.
* gettext-tools/examples/hello-modula2/po/LINGUAS: New file.
* gettext-tools/examples/hello-modula2/po/Makefile.am: New file.
* gettext-tools/examples/installpaths.in: Define also libdir.
* gettext-tools/m4/Makefile.am (examplesbuildaux_DATA): Add modula2comp.m4.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-modula2.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-modula2.
(hello-modula2.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-modula2.
($(srcdir)/../hello-modula2/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-modula2 as well.
* gettext-tools/examples/README: Mention hello-modula2.
* gettext-tools/doc/lang-modula2.texi: Likewise.
* NEWS: Likewise.
2025-04-25 13:06:15 +02:00
Bruno Haible
09203499b4 Modula-2 support: Add Modula-2 support in the tools.
* gettext-tools/doc/lang-modula2.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (PO Files): Mention modula2-format.
(No string concatenation): Mention string concatenation in Modula-2.
(Translators for other Languages): New subsection "Modula-2 Format Strings".
(List of Programming Languages): Include lang-modula2.texi.
* gettext-tools/doc/xgettext.texi: Document the -L Modula-2 option.
* gettext-tools/src/message.h (format_modula2): New enum value.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_modula2.
* gettext-tools/src/format-modula2.c: New file.
* gettext-tools/src/format.h (formatstring_modula2): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add formatstring_modula2.
* gettext-tools/src/x-modula2.h: New file.
* gettext-tools/src/x-modula2.c: New file.
* gettext-tools/src/xgettext.c: Include x-modula2.h.
(flag_table_modula2): New variable.
(main): Invoke init_flag_table_modula2, x_modula2_extract_all,
x_modula2_keyword.
(usage): Document the -L Modula-2 option.
(xgettext_record_flag): Support format_modula2.
(language_to_extractor, extension_to_language): Support Modula-2.
* gettext-tools/src/FILES: Mention format-modula2.c, x-modula2.h, x-modula2.c.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add x-modula2.h.
(FORMAT_SOURCE): Add format-modula2.c.
(xgettext_SOURCES): Add x-modula2.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-modula2.c.
* gettext-tools/po/POTFILES.in: Add src/format-modula2.c, src/x-modula2.c.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export formatstring_modula2.
* gettext-tools/tests/format-modula2-1: New file.
* gettext-tools/tests/format-modula2-2: New file.
* gettext-tools/tests/xgettext-modula2-1: New file.
* gettext-tools/tests/xgettext-modula2-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
* NEWS: Mention the Modula-2 support.
2025-04-25 03:16:28 +02:00
Bruno Haible
de3fff8d99 Modula-2 support: Add the runtime library.
* gnulib-local/m4/modula2.m4: New file.
* gnulib-local/modules/modula2: New file.
* gnulib-local/Makefile.am (EXTRA_DIST): Add modula2.m4 and the 'modula2'
module.
* autogen.sh (GNULIB_MODULES_RUNTIME_OTHER): Add modula2, modula2comp-script.
* gettext-runtime/intl-modula2/Libintl.def.in: New file.
* gettext-runtime/intl-modula2/Libintl.mod: New file.
* gettext-runtime/intl-modula2/LibintlFromC.def: New file.
* gettext-runtime/intl-modula2/Makefile.am: New file.
* gettext-runtime/intl-modula2/HACKING: New file.
* gettext-runtime/configure.ac: Invoke gt_MODULA2_CHOICE, gt_MODULA2COMP.
Determine VALUE_OF_LC_* for each LC_* constant. Set the variable BUILDMODULA2
and the Automake conditional BUILD_MODULA2.
* gettext-runtime/Makefile.am (SUBDIRS): Add intl-modula2.
* NEWS: Mention libintl_m2.so.
* gettext-runtime/NEWS: Likewise.
* PACKAGING: Add the interface and binary for the libintl_m2 library.
* DEPENDENCIES: Mention the Modula-2 compiler and runtime.
2025-04-25 03:16:21 +02:00
Bruno Haible
3c3b58eee6 gettextize: Fix bad interactions between autoreconf and autopoint.
Reported by Sebastian Pipping <sebastian@pipping.org>
in <https://savannah.gnu.org/bugs/index.php?66968>.

* gettext-tools/m4/Makefile.am (aclocaldir): Remove variable.
(pkgdatadir, macrosdir): Add variables.
(macros_DATA): Renamed from aclocal_DATA.
(install-data-local, uninstall-local, uninstall-macros): New targets.
* gettext-tools/misc/gettextize.in: Copy the *.m4 files from
$datadir/gettext/m4, not from $datadir/aclocal.
* gettext-tools/doc/gettext.texi (aclocal): Don't recommend to add option
--install to ACLOCAL_MFLAGS. Instead, recommend one-time use of --system-acdir.
* PACKAGING: Expect *.m4 files in $prefix/share/gettext/m4, not in
$prefix/share/aclocal.
* NEWS: Mention the fix.
2025-04-02 14:08:11 +02:00
Bruno Haible
e91e04e0f3 examples: Add hello-d example.
* gettext-tools/examples/hello-d/INSTALL: New file.
* gettext-tools/examples/hello-d/autogen.sh: New file.
* gettext-tools/examples/hello-d/autoclean.sh: New file.
* gettext-tools/examples/hello-d/hello.d.in: New file.
* gettext-tools/examples/hello-d/Makefile.am: New file.
* gettext-tools/examples/hello-d/configure.ac: New file.
* gettext-tools/examples/hello-d/m4/Makefile.am: New file.
* gettext-tools/examples/hello-d/po/LINGUAS: New file.
* gettext-tools/examples/hello-d/po/Makefile.am: New file.
* gettext-tools/examples/installpaths.in: Define also includedir.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add hello-d.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for hello-d.
(hello-d.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-d.
($(srcdir)/../hello-d/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-d as well.
* gettext-tools/examples/README: Mention hello-d.
* gettext-tools/doc/lang-d.texi: Likewise.
* NEWS: Likewise.
2025-04-02 14:04:50 +02:00
Bruno Haible
eaf1a8b271 D support: Add D support in the tools.
* autopull.sh: Check out tree-sitter-d. Set TREE_SITTER_D_VERSION.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add unistr/u16-check,
unistr/u16-to-u8, unistr/u32-check, unistr/u32-to-u8.
* gettext-tools/build-aux/tree-sitter-d-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_D_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter-d source code and
patch.
* gettext-tools/doc/lang-d.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (PO Files): Mention d-format.
(No string concatenation): Mention string concatenation and string interpolation
in D.
(Translators for other Languages): New subsection "D Format Strings".
(List of Programming Languages): Include lang-d.texi.
* gettext-tools/doc/xgettext.texi: Document the -L D option.
* gettext-tools/src/message.h (format_d): New enum value.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_d.
* gettext-tools/src/format-d.c: New file, based on
gettext-tools/src/format-lisp.c.
* gettext-tools/src/format.h (formatstring_d): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add formatstring_d.
* gettext-tools/src/x-d.h: New file.
* gettext-tools/src/x-d.c: New file, based on gettext-tools/src/x-rust.c and
gettext-tools/src/x-go.c.
* gettext-tools/src/html5-entities.h: New file.
* gettext-tools/src/xgettext.c: Include x-d.h.
(flag_table_d): New variable.
(main): Invoke init_flag_table_d, x_d_extract_all, x_d_keyword.
(usage): Document the -L D option.
(xgettext_record_flag): Support format_d.
(language_to_extractor, extension_to_language): Support D.
* gettext-tools/src/xg-message.c (decide_is_format, remember_a_message_plural):
Add better heuristic for c-format and d-format.
* gettext-tools/src/FILES: Mention format-d.c, x-d.h, x-d.c, html5-entities.h.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add x-d.h, html5-entities.h.
(FORMAT_SOURCE): Add format-d.c.
(libxgettextts2_a_SOURCES): Add d-parser.c, d-scanner.c.
(xgettext_SOURCES): Add x-d.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-d.c.
* gettext-tools/po/POTFILES.in: Add src/format-d.c, src/x-d.c.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export formatstring_d.
* gettext-tools/tests/format-d-1: New file.
* gettext-tools/tests/format-d-2: New file.
* gettext-tools/tests/xgettext-d-1: New file.
* gettext-tools/tests/xgettext-d-2: New file.
* gettext-tools/tests/xgettext-d-3: New file.
* gettext-tools/tests/xgettext-d-4: New file.
* gettext-tools/tests/xgettext-d-5: New file, based on
gettext-tools/tests/xgettext-rust-5.
* gettext-tools/tests/xgettext-d-6: New file, based on
gettext-tools/tests/xgettext-rust-7.
* gettext-tools/tests/testdata/dprog.utf-8.d: New file.
* gettext-tools/tests/testdata/dprog.utf-8+bom.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/testdata/dprog.utf-16be.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/testdata/dprog.utf-16le.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/testdata/dprog.utf-32be.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/testdata/dprog.utf-32le.d: New file, based on
gettext-tools/tests/testdata/dprog.utf-8.d.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
(EXTRA_DIST): Add the new testdata files.
* NEWS: Mention the D support.
2025-04-01 13:01:05 +02:00
Bruno Haible
0bc6dfc727 D support: Add the runtime library.
* gnulib-local/m4/d.m4: New file.
* gnulib-local/modules/d: New file.
* gnulib-local/Makefile.am (EXTRA_DIST): Add d.m4 and the 'd' module.
* autogen.sh (GNULIB_MODULES_RUNTIME_OTHER): Add d, dcomp-script.
* gettext-runtime/intl-d/Makefile.am: New file.
* gettext-runtime/intl-d/gnu/libintl/package.d: New file.
* gettext-runtime/intl-d/gnu/libintl/libintl.d: New file.
* gettext-runtime/intl-d/gnu/libintl/internal/low.d: New file.
* gettext-runtime/configure.ac: Invoke gt_D_CHOICE, gt_DCOMP. Set the variable
BUILDD and the Automake conditional BUILD_D.
* gettext-runtime/Makefile.am (SUBDIRS): Add intl-d.
* NEWS: Mention libintl_d.a.
* gettext-runtime/NEWS: Likewise.
* PACKAGING: Add the sources and binary for the libintl_d library.
* DEPENDENCIES: Mention the D compiler and runtime.
2025-04-01 02:38:25 +02:00
Bruno Haible
4fa2cffa94 Add TypeScript support.
* autopull.sh: Check out tree-sitter-typescript. Set
TREE_SITTER_TYPESCRIPT_VERSION.
* gettext-tools/build-aux/tree-sitter-typescript-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_TYPESCRIPT_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter-typescript source
code and patch.
* gettext-tools/doc/lang-typescript.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (No string concatenation): Mention string
concatenation in TypeScript.
(List of Programming Languages): Include lang-typescript.texi.
* gettext-tools/doc/xgettext.texi: Document the -L TypeScript and -L TSX
options.
* gettext-tools/src/x-typescript-impl.h: New file.
* gettext-tools/src/x-typescript.h: New file.
* gettext-tools/src/x-typescript.c: New file.
* gettext-tools/src/x-typescriptx.h: New file.
* gettext-tools/src/x-typescriptx.c: New file.
* gettext-tools/src/xgettext.c: Include x-typescript.h, x-typescriptx.h.
(flag_table_typescript, flag_table_typescriptx): New variables.
(main): Invoke init_flag_table_typescript, init_flag_table_typescriptx,
x_typescript_extract_all, x_typescriptx_extract_all, x_typescript_keyword,
x_typescriptx_keyword.
(usage): Document the -L TypeScript and -L TSX options.
(xgettext_record_flag): Support format_javascript with TypeScript and TSX.
(language_to_extractor, extension_to_language): Support TypeScript and TSX.
* gettext-tools/src/FILES: Mention x-typescript.h, x-typescript.c,
x-typescriptx.h, x-typescriptx.c, x-typescript-impl.h.
* gettext-tools/src/Makefile.am (noinst_LIBRARIES): Reference LIBXGETTEXTTS.
(noinst_HEADERS): Add x-typescript.h, x-typescriptx.h, x-typescript-impl.h.
(LIBXGETTEXTTS): Add libxgettextts3.a, libxgettextts4.a.
(libxgettextts3_a_SOURCES, libxgettextts3_a_CPPFLAGS): New variables.
(libxgettextts4_a_SOURCES, libxgettextts4_a_CPPFLAGS): New variables.
(xgettext_SOURCES): Add x-typescript.c, x-typescriptx.c.
* gettext-tools/tests/xgettext-javascript-6: Improve comments.
* gettext-tools/tests/xgettext-typescript-1: New file, based on
gettext-tools/tests/xgettext-javascript-1.
* gettext-tools/tests/xgettext-typescript-2: New file, based on
gettext-tools/tests/xgettext-javascript-2.
* gettext-tools/tests/xgettext-typescript-3: New file, based on
gettext-tools/tests/xgettext-javascript-3.
* gettext-tools/tests/xgettext-typescript-4: New file, based on
gettext-tools/tests/xgettext-javascript-4.
* gettext-tools/tests/xgettext-typescript-5: New file, based on
gettext-tools/tests/xgettext-javascript-5.
* gettext-tools/tests/xgettext-typescript-6: New file, based on
gettext-tools/tests/xgettext-javascript-6.
* gettext-tools/tests/xgettext-typescript-7: New file, based on
gettext-tools/tests/xgettext-javascript-7.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
* NEWS: Mention the TypeScript support.
2025-03-11 11:55:02 +01:00
Bruno Haible
6c99917547 examples: Add hello-go-http example.
* gettext-tools/examples/hello-go-http/INSTALL: New file.
* gettext-tools/examples/hello-go-http/autogen.sh: New file.
* gettext-tools/examples/hello-go-http/autoclean.sh: New file.
* gettext-tools/examples/hello-go-http/example1/hello1ml.go.in: New file.
* gettext-tools/examples/hello-go-http/example1/go.mod.in: New file.
* gettext-tools/examples/hello-go-http/example1/Makefile.am: New file.
* gettext-tools/examples/hello-go-http/Makefile.am: New file.
* gettext-tools/examples/hello-go-http/configure.ac: New file.
* gettext-tools/examples/hello-go-http/m4/Makefile.am: New file.
* gettext-tools/examples/hello-go-http/po/LINGUAS: New file.
* gettext-tools/examples/hello-go-http/po/Makefile.am: New file.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-go-http.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-go-http.
(hello-go-http.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-go-http.
($(srcdir)/../hello-go-http/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-go-http as well.
* gettext-tools/examples/README: Mention hello-go-http.
* gettext-tools/doc/lang-go.texi: Likewise.
* NEWS: Likewise.
2025-03-08 13:35:38 +01:00
Bruno Haible
5ebaafda3a examples: Add hello-go example.
* gettext-tools/examples/hello-go/INSTALL: New file.
* gettext-tools/examples/hello-go/autogen.sh: New file.
* gettext-tools/examples/hello-go/autoclean.sh: New file.
* gettext-tools/examples/hello-go/example1/hello1sl.go.in: New file.
* gettext-tools/examples/hello-go/example1/hello1ml.go.in: New file.
* gettext-tools/examples/hello-go/example1/go.mod.in: New file.
* gettext-tools/examples/hello-go/example1/Makefile.am: New file.
* gettext-tools/examples/hello-go/example2/hello2sl.go.in: New file.
* gettext-tools/examples/hello-go/example2/go.mod.in: New file.
* gettext-tools/examples/hello-go/example2/Makefile.am: New file.
* gettext-tools/examples/hello-go/example3/hello3ml.go.in: New file.
* gettext-tools/examples/hello-go/example3/go.mod.in: New file.
* gettext-tools/examples/hello-go/example3/Makefile.am: New file.
* gettext-tools/examples/hello-go/Makefile.am: New file.
* gettext-tools/examples/hello-go/configure.ac: New file.
* gettext-tools/examples/hello-go/m4/Makefile.am: New file.
* gettext-tools/examples/hello-go/po/LINGUAS: New file.
* gettext-tools/examples/hello-go/po/Makefile.am: New file.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-go.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-go.
(hello-go.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-go.
($(srcdir)/../hello-go/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-go as well.
* gettext-tools/examples/README: Mention hello-go.
* gettext-tools/doc/lang-go.texi: Likewise.
* NEWS: Likewise.
2025-03-08 13:28:46 +01:00
Bruno Haible
893cde22c5 Add Go support.
* autopull.sh: Check out tree-sitter-go. Set TREE_SITTER_GO_VERSION.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add carray-list, hash-map,
hash-set, xlist, xmap, xset, xstring-buffer-reversed.
* gettext-tools/build-aux/tree-sitter-go-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_GO_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter-go source code and
patch.
* gettext-tools/doc/lang-go.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (PO Files): Mention go-format.
(No string concatenation): Mention string concatenation in Go.
(Translators for other Languages): New subsection "Go Format Strings".
(List of Programming Languages): Include lang-go.texi.
* gettext-tools/doc/xgettext.texi: Document the -L Go option.
* gettext-tools/src/message.h (format_go): New enum value.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_go.
* gettext-tools/src/format-go.c: New file.
* gettext-tools/src/format.h (formatstring_go): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add formatstring_go.
* gettext-tools/src/x-go.h: New file.
* gettext-tools/src/x-go.c: New file.
* gettext-tools/src/xgettext.c: Include x-go.h.
(flag_table_go): New variable.
(main): Invoke init_flag_table_go, x_go_extract_all, x_go_keyword.
(usage): Document the -L Go option.
(xgettext_record_flag): Support format_go.
(language_to_extractor, extension_to_language): Support Go.
* gettext-tools/src/FILES: Mention format-go.c, x-go.h, x-go.c.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add x-go.h.
(FORMAT_SOURCE): Add format-go.c.
(libxgettextts2_a_SOURCES): Add go-parser.c.
(xgettext_SOURCES): Add x-go.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-go.c.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export formatstring_go.
* gettext-tools/tests/format-go-1: New file.
* gettext-tools/tests/format-go-2: New file.
* gettext-tools/tests/xgettext-go-1: New file.
* gettext-tools/tests/xgettext-go-2: New file.
* gettext-tools/tests/xgettext-go-3: New file.
* gettext-tools/tests/xgettext-go-4: New file.
* gettext-tools/tests/xgettext-go-5: New file.
* gettext-tools/tests/xgettext-go-6: New file.
* gettext-tools/tests/xgettext-go-7: New file.
* gettext-tools/tests/xgettext-go-8: New file.
* gettext-tools/tests/xgettext-go-9: New file.
* gettext-tools/tests/xgettext-go-10: New file.
* gettext-tools/tests/xgettext-go-11: New file.
* gettext-tools/tests/xgettext-go-12: New file.
* gettext-tools/tests/xgettext-go-13: New file.
* gettext-tools/tests/xgettext-go-14: New file.
* gettext-tools/tests/xgettext-go-15: New file.
* gettext-tools/tests/xgettext-go-16: New file.
* gettext-tools/tests/xgettext-go-17: New file.
* gettext-tools/tests/xgettext-go-18: New file.
* gettext-tools/tests/xgettext-go-stackovfl-1: New file.
* gettext-tools/tests/xgettext-go-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
* NEWS: Mention the Go support.
2025-03-07 12:42:54 +01:00
Bruno Haible
0c099d29a1 Prepare for 0.24 release.
* gettext-runtime/doc/matrix.texi: Update from TP.
* gettext-runtime/doc/nls.texi (STATUS): Update.
* gettext-runtime/m4/gettext.m4: Update comments.
* gettext-runtime/m4/nls.m4: Likewise.
* gettext-runtime/m4/progtest.m4: Likewise.
* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* libtextstyle/version.sh: Update VERSION_NUMBER, RELEASE_DATE.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* gettext-runtime/intl/Makefile.am (LTV_*): Bump to 12:3:4.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 2:4:2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:13:5.
* gettext-runtime/src/envsubst.c (main): Update copyright year in --version
output.
* gettext-runtime/src/gettext.c (main): Likewise.
* gettext-runtime/src/gettext.sh.in (func_version): Likewise.
* gettext-runtime/src/ngettext.c (main): Likewise.
* gettext-tools/src/cldr-plurals.c (main): Likewise.
* gettext-tools/src/hostname.c (main): Likewise.
* gettext-tools/src/msgattrib.c (main): Likewise.
* gettext-tools/src/msgcat.c (main): Likewise.
* gettext-tools/src/msgcmp.c (main): Likewise.
* gettext-tools/src/msgcomm.c (main): Likewise.
* gettext-tools/src/msgconv.c (main): Likewise.
* gettext-tools/src/msgen.c (main): Likewise.
* gettext-tools/src/msgexec.c (main): Likewise.
* gettext-tools/src/msgfilter.c (main): Likewise.
* gettext-tools/src/msgfmt.c (main): Likewise.
* gettext-tools/src/msggrep.c (main): Likewise.
* gettext-tools/src/msginit.c (main): Likewise.
* gettext-tools/src/msgmerge.c (main): Likewise.
* gettext-tools/src/msgunfmt.c (main): Likewise.
* gettext-tools/src/msguniq.c (main): Likewise.
* gettext-tools/src/recode-sr-latin.c (main): Likewise.
* gettext-tools/src/urlget.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* gettext-tools/misc/convert-archive.in (func_version): Likewise.
* gettext-tools/misc/gettextize.in (func_version): Likewise.
* gettext-tools/misc/autopoint.in: Likewise. Accept version 0.24.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.24.
* NEWS: Update.
2025-02-25 11:04:01 +01:00
Bruno Haible
2406f51927 xgettext: Implement a "reproducible" POT-Creation-Date value.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add vc-mtime.
* gettext-tools/src/xgettext.c: Include vc-mtime.h, msgl-header.h.
(has_some_mtimes, max_of_mtimes, some_mtimes_failed): New variables.
(long_options): Add --reference option.
(main): Implement --reference option. Invoke consider_vc_mtime for the
--files-from option.
(usage): Document the --reference option.
(consider_vc_mtime): New function.
(read_exclusion_file, extract_from_file, extract_from_xml_file: Invoke
consider_vc_mtime.
(construct_header): Don't compute the value of POT-Creation-Date here.
(finalize_header): Compute it here.
* gettext-tools/doc/xgettext.texi: Document the --reference option.
* NEWS: Mention the change.
2025-02-24 20:44:30 +01:00
Bruno Haible
31554caccc examples: Add hello-c-http example.
* gettext-tools/examples/hello-c-http/INSTALL: New file.
* gettext-tools/examples/hello-c-http/autogen.sh: New file, based on
gettext-tools/examples/hello-c/autogen.sh.
* gettext-tools/examples/hello-c-http/autoclean.sh: New file, based on
gettext-tools/examples/hello-c/autoclean.sh.
* gettext-tools/examples/hello-c-http/hello-server.c: New file.
* gettext-tools/examples/hello-c-http/Makefile.am: New file, based on
gettext-tools/examples/hello-c/Makefile.am.
* gettext-tools/examples/hello-c-http/configure.ac: New file, based on
gettext-tools/examples/hello-c/configure.ac.
* gettext-tools/examples/hello-c-http/m4/Makefile.am: New file, copied from
gettext-tools/examples/hello-c/m4/Makefile.am.
* gettext-tools/examples/hello-c-http/po/POTFILES.in: New file.
* gettext-tools/examples/hello-c-http/po/Makevars: New file, copied from
gettext-tools/examples/hello-c/po/Makevars.
* gettext-tools/examples/hello-c-http/po/LINGUAS: New file, copied from
gettext-tools/examples/hello-c/po/LINGUAS.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-c-http.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-c-http.
(hello-c-http.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-c-http.
($(srcdir)/../hello-c-http/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-c-http as well.
* gettext-tools/examples/README: Mention hello-c-http.
* NEWS: Likewise.
2025-02-13 06:12:33 +01:00
Bruno Haible
e10853e06c examples: Add hello-rust example.
* gettext-tools/examples/hello-rust/INSTALL: New file.
* gettext-tools/examples/hello-rust/autogen.sh: New file.
* gettext-tools/examples/hello-rust/autoclean.sh: New file.
* gettext-tools/examples/hello-rust/Cargo.toml.in: New file.
* gettext-tools/examples/hello-rust/src/main.rs.in: New file.
* gettext-tools/examples/hello-rust/Makefile.am: New file.
* gettext-tools/examples/hello-rust/configure.ac: New file.
* gettext-tools/examples/hello-rust/m4/Makefile.am: New file.
* gettext-tools/examples/hello-rust/po/Makefile.am: New file.
* gettext-tools/examples/hello-rust/po/LINGUAS: New file.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add
hello-rust.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for
hello-rust.
(hello-rust.pot): New target.
(SMALLPOFILES_FOR_lang): Update for hello-rust.
($(srcdir)/../hello-rust/po/$(LL).po): New rule.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle hello-rust as well.
(func_check): Add a more useful body.
* gettext-tools/examples/README: Mention hello-rust.
* NEWS: Likewise.
2025-01-28 22:45:17 +01:00
Bruno Haible
e12c0558ad Add Rust support.
* autopull.sh (func_git_clone_shallow): New function, based on
gnulib/top/bootstrap-funclib.sh.
Check out tree-sitter and tree-sitter-rust.
Create gettext-tools/tree-sitter.cfg.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add strnlen,
unictype/property-white-space.
(GNULIB_MODULES_LIBGETTEXTPO): Likewise.
* gettext-tools/build-aux/tree-sitter-portability.diff: New file.
* gettext-tools/build-aux/tree-sitter-rust-portability.diff: New file.
* gettext-tools/configure.ac: Set TREE_SITTER_VERSION, TREE_SITTER_RUST_VERSION.
* gettext-tools/Makefile.am (EXTRA_DIST): Add the tree-sitter configuration,
source code, and patches.
* gettext-tools/doc/lang-rust.texi: New file.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add it.
* gettext-tools/doc/gettext.texi (PO Files): Mention rust-format.
(Translators for other Languages): New subsection "Rust Format Strings".
(List of Programming Languages): Include lang-rust.texi.
* gettext-tools/doc/xgettext.texi: Document the -L Rust option.
* gettext-tools/src/message.h (format_rust): New enum value.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add an
entry for format_rust.
* gettext-tools/src/format-rust.c: New file.
* gettext-tools/src/format.h (formatstring_rust): New declaration.
* gettext-tools/src/format.c (formatstring_parsers): Add formatstring_rust.
* gettext-tools/src/x-rust.h: New file.
* gettext-tools/src/x-rust.c: New file.
* gettext-tools/src/xgettext.c: Include x-rust.h.
(main): Invoke init_flag_table_rust, x_rust_extract_all, x_rust_keyword.
(usage): Document the -L Rust option.
(xgettext_record_flag): Support format_rust.
(language_to_extractor, extension_to_language): Support Rust.
* gettext-tools/src/FILES: Mention format-rust.c, x-rust.h, x-rust.c.
* gettext-tools/src/Makefile.am (noinst_LIBRARIES): New variable.
(noinst_HEADERS): Add x-rust.h.
(AM_CPPFLAGS): Add a -I option for tree-sitter.
(FORMAT_SOURCE): Add format-rust.c.
(LIBXGETTEXTTS): New variable.
(libxgettextts1_a_SOURCES, libxgettextts1_a_CPPFLAGS): New variables.
(libxgettextts2_a_SOURCES, libxgettextts2_a_CPPFLAGS): New variables.
(xgettext_SOURCES): Add x-rust.c.
(xgettext_LDADD, xgettext_DEPENDENCIES): Add $(LIBXGETTEXTTS).
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-rust.c.
* gettext-tools/woe32dll/gettextsrc-exports.c: Export formatstring_rust.
* gettext-tools/tests/format-rust-1: New file.
* gettext-tools/tests/format-rust-2: New file.
* gettext-tools/tests/xgettext-rust-1: Fix string literal concatenation test.
Fix -k options.
* gettext-tools/tests/xgettext-rust-2: Fix gettext invocations.
* gettext-tools/tests/xgettext-rust-3: Fix string literal concatenation test.
Test multiline strings.
* gettext-tools/tests/xgettext-rust-4: Tweak.
* gettext-tools/tests/xgettext-rust-5: Fix test identifier.
* gettext-tools/tests/xgettext-rust-6: New file.
* gettext-tools/tests/xgettext-rust-7: New file.
* gettext-tools/tests/xgettext-rust-stackovfl-1: New file.
* gettext-tools/tests/xgettext-rust-stackovfl-2: New file.
* gettext-tools/tests/xgettext-rust-stackovfl-3: New file.
* gettext-tools/tests/xgettext-rust-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add the new tests.
* check-copyright-headers (func_check_file): Ignore tree-sitter files.
* NEWS: Mention the Rust support.
2025-01-28 22:13:12 +01:00
Bruno Haible
49761ad08f Mention the GNU make requirement more prominently.
* NEWS: Mention the GNU make requirement.
2025-01-28 10:38:13 +01:00
Bruno Haible
c39e75be33 Temporarily revert "po: Rename Makefile.in.in to Makefile.in." 2025-01-24 00:12:57 +01:00
Bruno Haible
1605149adc xgettext: JavaScript: Parse recursive JSX expressions correctly.
Reported by <fiurgeist@gmail.com> at <https://savannah.gnu.org/bugs/?66643>.

* gettext-tools/src/x-javascript.c (phase5_get): Treat a '<' character in
level type level_embedded_js_in_xml like in the other level types.
* gettext-tools/tests/xgettext-javascript-6: Add another test case.
* NEWS: Mention the fix.
2025-01-08 15:15:41 +01:00