Bruno Haible [Wed, 23 Apr 2025 17:50:04 +0000 (19:50 +0200)]
xgettext: D: Allow comments between the parts of concatenated string literals.
* gettext-tools/src/x-d.c (is_add_expression_with_tilde): New function.
(is_string_literal, string_literal_accumulate_pieces): Use it.
* gettext-tools/tests/xgettext-d-2: Add another test case regarding string
concatenation.
Bruno Haible [Wed, 2 Apr 2025 12:07:39 +0000 (14:07 +0200)]
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.
Bruno Haible [Tue, 1 Apr 2025 09:51:08 +0000 (11:51 +0200)]
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.
Bruno Haible [Tue, 1 Apr 2025 00:18:40 +0000 (02:18 +0200)]
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.
Bruno Haible [Tue, 25 Mar 2025 21:38:49 +0000 (22:38 +0100)]
doc: Small updates.
Reported by Michael Chirico <michaelchirico4@gmail.com>.
* gettext-tools/doc/gettext.texi (The LANGUAGE variable): Rephrase
recommendation for Norwegian users.
(Header Entry): Remove statement about old versions of Emacs.
Bruno Haible [Sat, 22 Mar 2025 12:20:36 +0000 (13:20 +0100)]
Update after gnulib changed.
* gettext-runtime/intl/setlocale.c: Include setlocale-fixes.h instead of
setlocale-messages.h.
(setlocale_unixlike) [__ANDROID__]: Use setlocale_fixed instead of setlocale.
(setlocale_improved): On Android, use setlocale_fixed_null instead of setlocale.
Bruno Haible [Fri, 21 Mar 2025 18:44:33 +0000 (19:44 +0100)]
Work around an strtoul() misfeature.
* gettext-runtime/src/ngettext.c: Include <ctype.h>.
(main): When parsing a nonnegative number, disallow leading whitespace and sign.
* gettext-tools/tests/tstngettext.c: Include <ctype.h>.
(worker_thread): When parsing a nonnegative number, disallow leading whitespace
and sign.
* gnulib-local/lib/markup.c (unescape_string_inplace): When parsing a numeric
character entity, disallow leading whitespace and sign, and report a too large
number as "non-permitted character" rather than "Numerical result out of range".
* gettext-tools/src/msgfmt.c (main): When parsing the '-a' argument, disallow
leading whitespace and sign and check whether the value is a power of 2.
* gettext-tools/src/read-stringtable.c: Include c-ctype.h.
(comment_line_end): When parsing a line number, disallow leading whitespace and
sign.
Bruno Haible [Tue, 11 Mar 2025 08:55:56 +0000 (09:55 +0100)]
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.
Bruno Haible [Fri, 7 Mar 2025 11:24:50 +0000 (12:24 +0100)]
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.
Bruno Haible [Sat, 1 Mar 2025 15:05:31 +0000 (16:05 +0100)]
build: Improve wording in './configure --help'.
Reported by Benno Schulenberg <bensberg@telfort.nl> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-03/msg00000.html>.
* configure.ac: Use a dummy version number named 'package', not 'dummy'.
* gettext-runtime/configure.ac: Likewise.
* gettext-runtime/intl/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.
* gettext-tools/examples/configure.ac: Likewise.
* libtextstyle/configure.ac: Likewise.
Bruno Haible [Tue, 25 Feb 2025 12:41:30 +0000 (13:41 +0100)]
examples: Use infrastructure from gettext version 0.24.
* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 0.24.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.
Bruno Haible [Wed, 12 Feb 2025 09:54:08 +0000 (10:54 +0100)]
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.
Bruno Haible [Thu, 13 Feb 2025 05:08:04 +0000 (06:08 +0100)]
intl: Update info about Galician and Tamil.
* gettext-runtime/intl/setlocale.c (locales_with_principal_territory): Galician
is mostly spoken in Spain, not Portugal. Tamil is mostly spoken in India, not
Sri Lanka.
Bruno Haible [Wed, 12 Feb 2025 09:39:35 +0000 (10:39 +0100)]
msginit: Update info about Galician and Tamil.
* gettext-tools/src/msginit.c (catalogname_for_locale): Galician is mostly
spoken in Spain, not Portugal. Tamil is mostly spoken in India, not Sri Lanka.
Bruno Haible [Tue, 11 Feb 2025 10:37:40 +0000 (11:37 +0100)]
xgettext: Rust: Support named format string arguments.
Reported by Kévin Commaille <zecakeh@tedomum.fr>
in <https://savannah.gnu.org/bugs/?56774>.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add unictype/property-xid-start,
unictype/property-xid-continue.
(GNULIB_MODULES_LIBGETTEXTPO): Likewise.
* gettext-tools/src/format-rust.c (struct named_arg): New type.
(struct spec): Add fields named_arg_count, named.
(named_arg_compare): New function.
(format_parse): Recognize named arguments.
(format_check): Search for differences also between the named arguments.
(format_print): Print also the named arguments.
* gettext-tools/tests/format-rust-1: Add test cases for named arguments.
* gettext-tools/tests/format-rust-2: Likewise.
* gettext-tools/doc/gettext.texi (rust-format): Describe rust-format in detail.
Bruno Haible [Tue, 11 Feb 2025 08:49:08 +0000 (09:49 +0100)]
Refactor.
* gettext-tools/src/format-ruby.c (format_parse): Use two different variables
named_allocated, numbered_allocated, instead of a single variable (assuming that
INVALID_MIXES_NAMED_UNNAMED is called when it should).
Bruno Haible [Sat, 8 Feb 2025 07:49:16 +0000 (08:49 +0100)]
xgettext: Handle out-of-memory situation.
* gettext-tools/src/x-perl.c: Include xstring-desc.h.
(extract_quotelike): Call xsd_c instead of sd_c.
* gettext-tools/src/x-rust.c: Include xstring-desc.h.
(string_literal_value): Call xsd_c instead of sd_c. Call sb_xappend_desc
instead of sb_append_desc.
Bruno Haible [Tue, 4 Feb 2025 00:03:53 +0000 (01:03 +0100)]
libtextstyle: Improve namespacing.
* gettext-tools/libgettextpo/Makefile.am (COMPILATION_UNITS): Fix reference to
LIBOBJS variable.
(config.h): Remove leading part of the elements of
$(lts_libtextstyle_LTLIBOBJS).
Bruno Haible [Sun, 2 Feb 2025 10:39:54 +0000 (11:39 +0100)]
Sort programming languages like in the documentation.
* gettext-tools/src/xgettext.c (usage): For the -L, -a, -k, --flag options, sort
the list of programming languages like in the documentation. Add Guile, Rust,
GSettings, that were forgotten earlier.
* gettext-tools/doc/xgettext.texi: Likewise.
* gettext-tools/examples/README: Sort the examples like the programming
languages in the documentation.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Likewise.
* 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): Likewise.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS, hello-*.pot,
SMALLPOFILES_FOR_lang, $(srcdir)/../hello-*/po/$(LL).po): Likewise.
Bruno Haible [Wed, 29 Jan 2025 11:30:02 +0000 (12:30 +0100)]
intl: Fix undefined behaviour.
Found using clang's undefined-behaviour sanitizer:
CC="clang -fsanitize=undefined -fno-sanitize-recover=undefined".
It reported errors
dcigettext.c:1219:25: runtime error: applying non-zero offset 8 to null pointer
because the code was computing
outbuf = freemem + sizeof (size_t);
where freemem == NULL.
* gettext-runtime/intl/dcigettext.c (_nl_find_msg): Initialize outbuf only after
having verified that freemem_size >= sizeof (size_t).
Bruno Haible [Tue, 28 Jan 2025 10:45:28 +0000 (11:45 +0100)]
Rust: Add lang-rust unit test.
* gettext-tools/tests/init.cfg (this_test_is_longrunning_): New function.
* gettext-tools/tests/lang-rust: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* HACKING: Reorder. Document prerequisites for Rust unit test.
Kévin Commaille [Tue, 28 Jan 2025 10:08:52 +0000 (11:08 +0100)]
Prepare for Rust support.
* gettext-tools/tests/xgettext-rust-1: New file, based on
gettext-tools/tests/xgettext-csharp-1.
* gettext-tools/tests/xgettext-rust-2: New file, based on
gettext-tools/tests/xgettext-csharp-2.
* gettext-tools/tests/xgettext-rust-3: New file, based on
gettext-tools/tests/xgettext-csharp-3.
* gettext-tools/tests/xgettext-rust-4: New file, based on
gettext-tools/tests/xgettext-csharp-4.
* gettext-tools/tests/xgettext-rust-5: New file, based on
gettext-tools/tests/xgettext-csharp-7.