]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: JavaScript: Improve heuristic for format strings.
authorBruno Haible <bruno@clisp.org>
Sun, 1 Jun 2025 23:52:49 +0000 (01:52 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 2 Jun 2025 00:22:42 +0000 (02:22 +0200)
commitccd07974b09dbae94c691920fca4e6864dadedf5
tree6def8699254470351256ab68b913e1fb46236c92
parent417ca6acd579d18c16a0313e157cc08f3e6af271
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.
gettext-tools/src/format-javascript.c
gettext-tools/tests/Makefile.am
gettext-tools/tests/format-javascript-3 [new file with mode: 0755]