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