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