+2007-09-30 Bruno Haible <bruno@clisp.org>
+
+ * woe32dll/gettextsrc-exports.c: Add formatstring_kde.
+
2007-07-07 Bruno Haible <bruno@clisp.org>
* configure.ac: Don't create libuniname/Makefile.
+2007-09-30 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.am (libgettextpo_la_AUXSOURCES): Add format-kde.c.
+
2007-06-08 Bruno Haible <bruno@clisp.org>
* Makefile.am (LDADD): Remove variable.
../src/format-php.c \
../src/format-gcc-internal.c \
../src/format-qt.c \
+ ../src/format-kde.c \
../src/format-boost.c \
../src/format.c \
../src/plural-exp.c \
+2007-09-30 Bruno Haible <bruno@clisp.org>
+
+ * message.h (format_type): New enum value 'format_kde'.
+ (NFORMATS): Increment.
+ * message.c (format_language): Add format_kde entry.
+ (format_language_pretty): Likewise.
+ * format.h (formatstring_kde): New declaration.
+ * format-kde.c: New file.
+ * format.c (formatstring_parsers): Add formatstring_kde.
+ * x-c.c (init_flag_table_c): Also register flags for qt-format and
+ kde-format.
+ * xgettext.c (flag_table_cxx_kde): New variable.
+ (recognize_format_kde): New variable.
+ (main): Handle --kde option.
+ (usage): Document --kde option.
+ (xgettext_record_flag): Also fill flag_table_cxx_kde.
+ (remember_a_message, remember_a_message_plural): In the heuristics,
+ don't mark a string as c-format that is already known to be a
+ kde-format.
+ (language_to_extractor): Use a flag_table_cxx_kde that is different
+ from flag_table_c.
+ * Makefile.am (FORMAT_SOURCE): Add format-kde.c.
+ * FILES: Update.
+
2007-09-09 Bruno Haible <bruno@clisp.org>
Add support for Qt 4 format strings.
format-php.c Format string handling for PHP.
format-gcc-internal.c Format string handling GCC internal.
format-qt.c Format string handling for Qt.
+format-kde.c Format string handling for KDE.
format-boost.c Format string handling for Boost.
format.c Table of the language dependent format string handlers.
format-c.c format-sh.c format-python.c format-lisp.c format-elisp.c \
format-librep.c format-scheme.c format-java.c format-csharp.c format-awk.c \
format-pascal.c format-ycp.c format-tcl.c format-perl.c format-perl-brace.c \
-format-php.c format-gcc-internal.c format-qt.c format-boost.c
+format-php.c format-gcc-internal.c format-qt.c format-kde.c format-boost.c
# libgettextsrc contains all code that is needed by at least two programs.
libgettextsrc_la_SOURCES = \
/* Format strings.
- Copyright (C) 2001-2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
/* format_php */ &formatstring_php,
/* format_gcc_internal */ &formatstring_gcc_internal,
/* format_qt */ &formatstring_qt,
+ /* format_kde */ &formatstring_kde,
/* format_boost */ &formatstring_boost
};
/* Format strings.
- Copyright (C) 2001-2006 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
extern DLL_VARIABLE struct formatstring_parser formatstring_php;
extern DLL_VARIABLE struct formatstring_parser formatstring_gcc_internal;
extern DLL_VARIABLE struct formatstring_parser formatstring_qt;
+extern DLL_VARIABLE struct formatstring_parser formatstring_kde;
extern DLL_VARIABLE struct formatstring_parser formatstring_boost;
/* Table of all format string parsers. */
/* format_php */ "php",
/* format_gcc_internal */ "gcc-internal",
/* format_qt */ "qt",
+ /* format_kde */ "kde",
/* format_boost */ "boost"
};
/* format_php */ "PHP",
/* format_gcc_internal */ "GCC internal",
/* format_qt */ "Qt",
+ /* format_kde */ "KDE",
/* format_boost */ "Boost"
};
/* GNU gettext - internationalization aids
- Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
format_php,
format_gcc_internal,
format_qt,
+ format_kde,
format_boost
};
-#define NFORMATS 21 /* Number of format_type enum values. */
+#define NFORMATS 22 /* Number of format_type enum values. */
extern DLL_VARIABLE const char *const format_language[NFORMATS];
extern DLL_VARIABLE const char *const format_language_pretty[NFORMATS];
xgettext_record_flag ("argp_failure:2:c-format");
#endif
+ xgettext_record_flag ("gettext:1:pass-qt-format");
+ xgettext_record_flag ("dgettext:2:pass-qt-format");
+ xgettext_record_flag ("dcgettext:2:pass-qt-format");
+ xgettext_record_flag ("ngettext:1:pass-qt-format");
+ xgettext_record_flag ("ngettext:2:pass-qt-format");
+ xgettext_record_flag ("dngettext:2:pass-qt-format");
+ xgettext_record_flag ("dngettext:3:pass-qt-format");
+ xgettext_record_flag ("dcngettext:2:pass-qt-format");
+ xgettext_record_flag ("dcngettext:3:pass-qt-format");
+ xgettext_record_flag ("gettext_noop:1:pass-qt-format");
+ xgettext_record_flag ("pgettext:2:pass-qt-format");
+ xgettext_record_flag ("dpgettext:3:pass-qt-format");
+ xgettext_record_flag ("dcpgettext:3:pass-qt-format");
+ xgettext_record_flag ("npgettext:2:pass-qt-format");
+ xgettext_record_flag ("npgettext:3:pass-qt-format");
+ xgettext_record_flag ("dnpgettext:3:pass-qt-format");
+ xgettext_record_flag ("dnpgettext:4:pass-qt-format");
+ xgettext_record_flag ("dcnpgettext:3:pass-qt-format");
+ xgettext_record_flag ("dcnpgettext:4:pass-qt-format");
+
+ xgettext_record_flag ("gettext:1:pass-kde-format");
+ xgettext_record_flag ("dgettext:2:pass-kde-format");
+ xgettext_record_flag ("dcgettext:2:pass-kde-format");
+ xgettext_record_flag ("ngettext:1:pass-kde-format");
+ xgettext_record_flag ("ngettext:2:pass-kde-format");
+ xgettext_record_flag ("dngettext:2:pass-kde-format");
+ xgettext_record_flag ("dngettext:3:pass-kde-format");
+ xgettext_record_flag ("dcngettext:2:pass-kde-format");
+ xgettext_record_flag ("dcngettext:3:pass-kde-format");
+ xgettext_record_flag ("gettext_noop:1:pass-kde-format");
+ xgettext_record_flag ("pgettext:2:pass-kde-format");
+ xgettext_record_flag ("dpgettext:3:pass-kde-format");
+ xgettext_record_flag ("dcpgettext:3:pass-kde-format");
+ xgettext_record_flag ("npgettext:2:pass-kde-format");
+ xgettext_record_flag ("npgettext:3:pass-kde-format");
+ xgettext_record_flag ("dnpgettext:3:pass-kde-format");
+ xgettext_record_flag ("dnpgettext:4:pass-kde-format");
+ xgettext_record_flag ("dcnpgettext:3:pass-kde-format");
+ xgettext_record_flag ("dcnpgettext:4:pass-kde-format");
+
xgettext_record_flag ("gettext:1:pass-boost-format");
xgettext_record_flag ("dgettext:2:pass-boost-format");
xgettext_record_flag ("dcgettext:2:pass-boost-format");
/* Table of flag_context_list_ty tables. */
static flag_context_list_table_ty flag_table_c;
static flag_context_list_table_ty flag_table_cxx_qt;
+static flag_context_list_table_ty flag_table_cxx_kde;
static flag_context_list_table_ty flag_table_cxx_boost;
static flag_context_list_table_ty flag_table_objc;
static flag_context_list_table_ty flag_table_gcc_internal;
/* If true, recognize Qt format strings. */
static bool recognize_format_qt;
+/* If true, recognize KDE format strings. */
+static bool recognize_format_kde;
+
/* If true, recognize Boost format strings. */
static bool recognize_format_boost;
{
{ "add-comments", optional_argument, NULL, 'c' },
{ "add-location", no_argument, &line_comment, 1 },
- { "boost", no_argument, NULL, CHAR_MAX + 10 },
+ { "boost", no_argument, NULL, CHAR_MAX + 11 },
{ "c++", no_argument, NULL, 'C' },
{ "copyright-holder", required_argument, NULL, CHAR_MAX + 1 },
{ "debug", no_argument, &do_debug, 1 },
{ "help", no_argument, NULL, 'h' },
{ "indent", no_argument, NULL, 'i' },
{ "join-existing", no_argument, NULL, 'j' },
+ { "kde", no_argument, NULL, CHAR_MAX + 10 },
{ "keyword", optional_argument, NULL, 'k' },
{ "language", required_argument, NULL, 'L' },
{ "msgid-bugs-address", required_argument, NULL, CHAR_MAX + 5 },
case CHAR_MAX + 9: /* --qt */
recognize_format_qt = true;
break;
- case CHAR_MAX + 10: /* --boost */
+ case CHAR_MAX + 10: /* --kde */
+ recognize_format_kde = true;
+ break;
+ case CHAR_MAX + 11: /* --boost */
recognize_format_boost = true;
break;
default:
error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
"--sort-output", "--sort-by-file");
+ /* We cannot support both Qt and KDE, or Qt and Boost, or KDE and Boost
+ format strings, because there are only two formatstring parsers per
+ language, and formatstring_c is the first one for C++. */
+ if (recognize_format_qt && recognize_format_kde)
+ error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
+ "--qt", "--kde");
if (recognize_format_qt && recognize_format_boost)
- /* We cannot support both Qt and Boost format strings, because there are
- only two formatstring parsers per language, and formatstring_c is the
- first one for C++. */
error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
"--qt", "--boost");
+ if (recognize_format_kde && recognize_format_boost)
+ error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
+ "--kde", "--boost");
if (join_existing && strcmp (default_domain, "-") == 0)
error (EXIT_FAILURE, 0, _("\
printf (_("\
(only language C++)\n"));
printf (_("\
+ --kde recognize KDE 4 format strings\n"));
+ printf (_("\
+ (only language C++)\n"));
+ printf (_("\
--boost recognize Boost format strings\n"));
printf (_("\
(only language C++)\n"));
flag_context_list_table_insert (&flag_table_cxx_qt, 0,
name_start, name_end,
argnum, value, pass);
+ flag_context_list_table_insert (&flag_table_cxx_kde, 0,
+ name_start, name_end,
+ argnum, value, pass);
flag_context_list_table_insert (&flag_table_cxx_boost, 0,
name_start, name_end,
argnum, value, pass);
name_start, name_end,
argnum, value, pass);
break;
+ case format_kde:
+ flag_context_list_table_insert (&flag_table_cxx_kde, 1,
+ name_start, name_end,
+ argnum, value, pass);
+ break;
case format_boost:
flag_context_list_table_insert (&flag_table_cxx_boost, 1,
name_start, name_end,
&& !(i == format_c && possible_format_p (is_format[format_objc]))
&& !(i == format_objc && possible_format_p (is_format[format_c]))
/* Avoid flagging a string as c-format when it's known to be a
- qt-format or boost-format string. */
+ qt-format or kde-format or boost-format string. */
&& !(i == format_c
&& (possible_format_p (is_format[format_qt])
+ || possible_format_p (is_format[format_kde])
|| possible_format_p (is_format[format_boost]))))
{
struct formatstring_parser *parser = formatstring_parsers[i];
qt-format or boost-format string. */
&& !(i == format_c
&& (possible_format_p (mp->is_format[format_qt])
+ || possible_format_p (mp->is_format[format_kde])
|| possible_format_p (mp->is_format[format_boost]))))
{
struct formatstring_parser *parser = formatstring_parsers[i];
result.flag_table = &flag_table_cxx_qt;
result.formatstring_parser2 = &formatstring_qt;
}
+ /* Likewise for --kde. */
+ if (recognize_format_kde && strcmp (tp->name, "C++") == 0)
+ {
+ result.flag_table = &flag_table_cxx_kde;
+ result.formatstring_parser2 = &formatstring_kde;
+ }
/* Likewise for --boost. */
if (recognize_format_boost && strcmp (tp->name, "C++") == 0)
{
/* List of exported symbols of libgettextsrc on Cygwin.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software; you can redistribute it and/or modify
VARIABLE(formatstring_elisp)
VARIABLE(formatstring_gcc_internal)
VARIABLE(formatstring_java)
+VARIABLE(formatstring_kde)
VARIABLE(formatstring_librep)
VARIABLE(formatstring_lisp)
VARIABLE(formatstring_objc)