7 Commits

Author SHA1 Message Date
Bruno Haible
f1459a89e2 xgettext: Allow inhibiting the warnings about URLs and email addresses.
Reported at <https://savannah.gnu.org/bugs/?67672>.

* gettext-tools/src/message.h (enum syntax_check_type): Add sc_url, sc_email.
(NSYNTAXCHECKS): Increase by 2.
* gettext-tools/src/message.c (syntax_check_name): Update.
* gettext-tools/src/xgettext.h (default_syntax_check): Add comment.
* gettext-tools/src/xgettext.c (default_syntax_check): Add initializer.
(main): Recognize --no-check option.
(usage): Document --no-check option.
* gettext-tools/src/xg-message.c (decide_syntax_check): Assume that
default_syntax_check[i] != undecided.
* gettext-tools/src/xg-check.c (syntax_check_function): Remove the second
argument.
(string_has_ascii_ellipsis): New function, extracted from
syntax_check_ellipsis_unicode.
(message_has_ascii_ellipsis): New function.
(syntax_check_ellipsis_unicode): Remove the second argument. Simplify. Emit only
a single error for both msgid and msgid_plural.
(string_has_space_ellipsis): New function, extracted from
syntax_check_space_ellipsis.
(message_has_space_ellipsis): New function.
(syntax_check_space_ellipsis): Remove the second argument. Simplify. Emit only
a single error for both msgid and msgid_plural.
(syntax_check_quote_unicode): Remove the second argument.
(syntax_check_bullet_unicode_string): New function, extracted from
syntax_check_bullet_unicode.
(syntax_check_bullet_unicode): Remove the second argument. Simplify.
(string_has_url): Don't recognize 'mailto:' URLs.
(syntax_check_url, syntax_check_email): New functions, extracted from
url_check_message.
(url_check_message): Remove function.
(sc_funcs): Add syntax_check_url, syntax_check_email.
(syntax_check_message): Simplify.
(xgettext_check_message_list): Don't invoke url_check_message.
* gettext-tools/tests/xgettext-14: Update after xg-check.c changesd.
* gettext-tools/tests/xgettext-20: Add more testcases.
* gettext-tools/doc/xgettext.texi: Document the --no-check option.
* gettext-tools/doc/gettext.texi: Bump copyright year.
* NEWS: Mention the change.
2026-01-10 20:16:46 +01:00
Bruno Haible
387a2e083a tests: Remove a left-over debugging trace.
* gettext-tools/tests/xgettext-20: Remove a 'set -x' statement.
2025-12-01 19:56:59 +01:00
Bruno Haible
0c0bd837fa xgettext: Warn when a message contains an URL or email address.
Reported by Arsen Arsenović <arsen@aarsen.me>
at <https://savannah.gnu.org/bugs/?67000>.

* gettext-tools/src/xg-check.c: Include c-strstr.h.
(SIZEOF): New macro.
(string_has_url, message_has_url, string_has_email, message_has_email,
url_check_message): New functions.
(xgettext_check_message_list): Invoke url_check_message.
* gettext-tools/tests/xgettext-20: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.
2025-07-04 04:00:23 +02:00
Bruno Haible
386ecf4f42 Move xgettext-20 to xgettext-glade-2. 2009-06-23 12:11:10 +02:00
Bruno Haible
62abb37f74 Update test results. 2009-06-23 12:10:15 +02:00
Bruno Haible
b90432f0ab Remove SKIP: messages, now that automake emits them from the Makefile. 2009-06-23 12:10:13 +02:00
Bruno Haible
a52ce7ad83 Move tests/xgettext-20 to gettext-tools/tests/xgettext-20. 2009-06-23 12:10:01 +02:00