]> git.ipfire.org Git - thirdparty/gettext.git/commit
Add support for C++ format strings.
authorBruno Haible <bruno@clisp.org>
Thu, 8 Jun 2023 18:41:14 +0000 (20:41 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 8 Jun 2023 21:51:38 +0000 (23:51 +0200)
commite4e4e06e21dff1733ab195770130834811190dd6
tree1db3555a4a8308373406a2af1075b894a8dc05bd
parent9524d5d8dd265b49985bef106e37573d9cbe7459
Add support for C++ format strings.

* gettext-tools/src/message.h (enum format_type): New enum item
format_cplusplus_brace.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add
entries for format_cplusplus_brace.
* gettext-tools/src/format.h (formatstring_cplusplus_brace): New declaration.
* gettext-tools/src/format-c++-brace.c: New file, based on
gettext-tools/src/format-awk.c.
* gettext-tools/src/format.c (formatstring_parsers): Add an entry for
format_cplusplus_brace.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-c++-brace.c.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/x-c.h (SCANNERS_C): In language C++, use
formatstring_cplusplus_brace as second format string parser.
* gettext-tools/src/x-c.c (init_flag_table_c): Initialize flags related to
c++-format.
* gettext-tools/src/xgettext.c (xgettext_record_flag): Handle
format_cplusplus_brace.
(recognize_qt_formatstrings, language_to_extractor): Update.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Update.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-c++-brace.c.
* gettext-tools/tests/format-c++-brace-1: New file, based on
gettext-tools/tests/format-c-1.
* gettext-tools/tests/format-c++-brace-2: New file, based on
gettext-tools/tests/format-c-2.
* gettext-tools/tests/lang-c++20: New file, based on
gettext-tools/tests/lang-c++.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* gettext-tools/doc/gettext.texi (PO Files): Mention c++-format and
no-c++-format.
(Preparing strings): Add subheading "No programmer-defined format string
directives".
(Mark Keywords): Mention the need to use std::vformat instead of std::format.
(c++-format): New subsection.
* gettext-tools/doc/lang-c.texi: Mention the syntax for C++ format strings.
* NEWS: Mention the change.

tweak c++-format
19 files changed:
NEWS
gettext-tools/doc/gettext.texi
gettext-tools/doc/lang-c.texi
gettext-tools/libgettextpo/Makefile.am
gettext-tools/src/FILES
gettext-tools/src/Makefile.am
gettext-tools/src/format-c++-brace.c [new file with mode: 0644]
gettext-tools/src/format.c
gettext-tools/src/format.h
gettext-tools/src/message.c
gettext-tools/src/message.h
gettext-tools/src/x-c.c
gettext-tools/src/x-c.h
gettext-tools/src/xg-arglist-parser.c
gettext-tools/src/xgettext.c
gettext-tools/tests/Makefile.am
gettext-tools/tests/format-c++-brace-1 [new file with mode: 0755]
gettext-tools/tests/format-c++-brace-2 [new file with mode: 0755]
gettext-tools/tests/lang-c++20 [new file with mode: 0755]