gettext
e4e4e06e - Add support for C++ format strings.

Commit
1 year ago
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
Author
Committer
Parents
Loading