8826 Commits

Author SHA1 Message Date
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