+2009-05-29 Bruno Haible <bruno@clisp.org>
+
+ Improve msgfmt error message about format directive mismatches
+ in msgstr[i].
+ * format.h (struct formatstring_parser): Add pretty_msgid argument to
+ 'check' member.
+ * format-awk.c (format_check): Add pretty_msgid argument.
+ * format-boost.c (format_check): Likewise.
+ * format-c.c (format_check): Likewise.
+ * format-csharp.c (format_check): Likewise.
+ * format-elisp.c (format_check): Likewise.
+ * format-gcc-internal.c (format_check): Likewise.
+ * format-gfc-internal.c (format_check): Likewise.
+ * format-java.c (format_check): Likewise.
+ * format-kde.c (format_check): Likewise.
+ * format-librep.c (format_check): Likewise.
+ * format-lisp.c (format_check): Likewise.
+ * format-pascal.c (format_check): Likewise.
+ * format-perl-brace.c (format_check): Likewise.
+ * format-perl.c (format_check): Likewise.
+ * format-php.c (format_check): Likewise.
+ * format-python.c (format_check): Likewise.
+ * format-qt.c (format_check): Likewise.
+ * format-qt-plural.c (format_check): Likewise.
+ * format-scheme.c (format_check): Likewise.
+ * format-sh.c (format_check): Likewise.
+ * format-tcl.c (format_check): Likewise.
+ * format-ycp.c (format_check): Likewise.
+ * format.c (check_msgid_msgstr_format_i): Pass either "msgid" or
+ "msgid_plural" as pretty_msgid argument.
+
2009-05-23 Bruno Haible <bruno@clisp.org>
* Makefile.am (libgettextsrc_la_LINK, msgattrib_LINK, msgcat_LINK,
/* awk format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
/* Boost format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2006.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
/* C format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 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
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
: spec1->unnumbered_arg_count < spec2->unnumbered_arg_count)
{
if (error_logger)
- error_logger (_("number of format specifications in 'msgid' and '%s' does not match"),
- pretty_msgstr);
+ error_logger (_("number of format specifications in '%s' and '%s' does not match"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
else
if (spec1->unnumbered[i].type != spec2->unnumbered[i].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, i + 1);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr, i + 1);
err = true;
}
/* C# format strings.
- Copyright (C) 2003-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
: spec1->numbered_arg_count < spec2->numbered_arg_count)
{
if (error_logger)
- error_logger (_("number of format specifications in 'msgid' and '%s' does not match"),
- pretty_msgstr);
+ error_logger (_("number of format specifications in '%s' and '%s' does not match"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
/* Emacs Lisp format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
/* GCC internal format strings.
- Copyright (C) 2003-2008 Free Software Foundation, Inc.
+ Copyright (C) 2003-2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
if (error_logger)
{
if (spec1->uses_err_no)
- error_logger (_("'msgid' uses %%m but '%s' doesn't"),
- pretty_msgstr);
+ error_logger (_("'%s' uses %%m but '%s' doesn't"),
+ pretty_msgid, pretty_msgstr);
else
- error_logger (_("'msgid' does not use %%m but '%s' uses %%m"),
- pretty_msgstr);
+ error_logger (_("'%s' does not use %%m but '%s' uses %%m"),
+ pretty_msgid, pretty_msgstr);
}
err = true;
}
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
: spec1->unnumbered_arg_count < spec2->unnumbered_arg_count)
{
if (error_logger)
- error_logger (_("number of format specifications in 'msgid' and '%s' does not match"),
- pretty_msgstr);
+ error_logger (_("number of format specifications in '%s' and '%s' does not match"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
else
if (spec1->unnumbered[i].type != spec2->unnumbered[i].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, i + 1);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr, i + 1);
err = true;
}
if (error_logger)
{
if (spec1->uses_currentloc)
- error_logger (_("'msgid' uses %%C but '%s' doesn't"),
- pretty_msgstr);
+ error_logger (_("'%s' uses %%C but '%s' doesn't"),
+ pretty_msgid, pretty_msgstr);
else
- error_logger (_("'msgid' does not use %%C but '%s' uses %%C"),
- pretty_msgstr);
+ error_logger (_("'%s' does not use %%C but '%s' uses %%C"),
+ pretty_msgid, pretty_msgstr);
}
err = true;
}
/* Java format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 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
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument {%u}, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument {%u}, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument {%u} are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument {%u} are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
/* KDE format strings.
- Copyright (C) 2003-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
{
if (error_logger)
error_logger (_("a format specification for arguments %u and %u doesn't exist in '%s', only one argument may be ignored"),
- missing, spec1->numbered[i].number, pretty_msgstr);
+ missing, spec1->numbered[i].number,
+ pretty_msgstr);
err = true;
break;
}
/* librep format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 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
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
/* Lisp format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 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
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (!equal_list (spec1->list, spec2->list))
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' are not equivalent"),
- pretty_msgstr);
+ error_logger (_("format specifications in '%s' and '%s' are not equivalent"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
}
equal_list (intersection, spec2->list))))
{
if (error_logger)
- error_logger (_("format specifications in '%s' are not a subset of those in 'msgid'"),
- pretty_msgstr);
+ error_logger (_("format specifications in '%s' are not a subset of those in '%s'"),
+ pretty_msgstr, pretty_msgid);
err = true;
}
}
/* Object Pascal format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 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
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
/* Perl format strings.
- Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
/* PHP format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
/* Python format strings.
- Copyright (C) 2001-2004, 2006-2008 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2009 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
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (spec1->named_arg_count > 0 && spec2->unnamed_arg_count > 0)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' expect a mapping, those in '%s' expect a tuple"),
- pretty_msgstr);
+ error_logger (_("format specifications in '%s' expect a mapping, those in '%s' expect a tuple"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
else if (spec1->unnamed_arg_count > 0 && spec2->named_arg_count > 0)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' expect a tuple, those in '%s' expect a mapping"),
- pretty_msgstr);
+ error_logger (_("format specifications in '%s' expect a tuple, those in '%s' expect a mapping"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
else
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument '%s', as in '%s', doesn't exist in 'msgid'"),
- spec2->named[j].name, pretty_msgstr);
+ error_logger (_("a format specification for argument '%s', as in '%s', doesn't exist in '%s'"),
+ spec2->named[j].name, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
|| spec2->named[j].type == FAT_ANY))))
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument '%s' are not the same"),
- pretty_msgstr, spec2->named[j].name);
+ error_logger (_("format specifications in '%s' and '%s' for argument '%s' are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->named[j].name);
err = true;
break;
}
if (spec1->unnamed_arg_count != spec2->unnamed_arg_count)
{
if (error_logger)
- error_logger (_("number of format specifications in 'msgid' and '%s' does not match"),
- pretty_msgstr);
+ error_logger (_("number of format specifications in '%s' and '%s' does not match"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
else
|| spec2->unnamed[i].type == FAT_ANY))))
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, i + 1);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr, i + 1);
err = true;
}
}
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
|| (equality && spec1->directives > 0 && spec2->directives == 0))
{
if (error_logger)
- error_logger (_("number of format specifications in 'msgid' and '%s' does not match"),
- pretty_msgstr);
+ error_logger (_("number of format specifications in '%s' and '%s' does not match"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
/* Qt format strings.
- Copyright (C) 2003-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (spec1->simple && !spec2->simple)
{
if (error_logger)
- error_logger (_("'msgid' is a simple format string, but '%s' is not: it contains an 'L' flag or a double-digit argument number"),
- pretty_msgstr);
+ error_logger (_("'%s' is a simple format string, but '%s' is not: it contains an 'L' flag or a double-digit argument number"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
if (arg_used1 != arg_used2)
{
if (error_logger)
- error_logger (arg_used1
- ? _("a format specification for argument %u doesn't exist in '%s'")
- : _("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- i, pretty_msgstr);
+ {
+ if (arg_used1)
+ error_logger (_("a format specification for argument %u doesn't exist in '%s'"),
+ i, pretty_msgstr);
+ else
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ i, pretty_msgstr, pretty_msgid);
+ }
err = true;
break;
}
/* Scheme format strings.
- Copyright (C) 2001-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2007, 2009 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
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (!equal_list (spec1->list, spec2->list))
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' are not equivalent"),
- pretty_msgstr);
+ error_logger (_("format specifications in '%s' and '%s' are not equivalent"),
+ pretty_msgid, pretty_msgstr);
err = true;
}
}
equal_list (intersection, spec2->list))))
{
if (error_logger)
- error_logger (_("format specifications in '%s' are not a subset of those in 'msgid'"),
- pretty_msgstr);
+ error_logger (_("format specifications in '%s' are not a subset of those in '%s'"),
+ pretty_msgstr, pretty_msgid);
err = true;
}
}
/* Shell format strings.
- Copyright (C) 2003-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument '%s', as in '%s', doesn't exist in 'msgid'"),
- spec2->named[j].name, pretty_msgstr);
+ error_logger (_("a format specification for argument '%s', as in '%s', doesn't exist in '%s'"),
+ spec2->named[j].name, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
/* Tcl format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2002.
This program is free software: you can redistribute it and/or modify
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (cmp > 0)
{
if (error_logger)
- error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- spec2->numbered[j].number, pretty_msgstr);
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ spec2->numbered[j].number, pretty_msgstr,
+ pretty_msgid);
err = true;
break;
}
if (spec1->numbered[i].type != spec2->numbered[j].type)
{
if (error_logger)
- error_logger (_("format specifications in 'msgid' and '%s' for argument %u are not the same"),
- pretty_msgstr, spec2->numbered[j].number);
+ error_logger (_("format specifications in '%s' and '%s' for argument %u are not the same"),
+ pretty_msgid, pretty_msgstr,
+ spec2->numbered[j].number);
err = true;
break;
}
/* YCP and Smalltalk format strings.
- Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2007, 2009 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
static bool
format_check (void *msgid_descr, void *msgstr_descr, bool equality,
formatstring_error_logger_t error_logger,
- const char *pretty_msgstr)
+ const char *pretty_msgid, const char *pretty_msgstr)
{
struct spec *spec1 = (struct spec *) msgid_descr;
struct spec *spec2 = (struct spec *) msgstr_descr;
if (equality ? (arg_used1 != arg_used2) : (!arg_used1 && arg_used2))
{
if (error_logger)
- error_logger (arg_used1
- ? _("a format specification for argument %u doesn't exist in '%s'")
- : _("a format specification for argument %u, as in '%s', doesn't exist in 'msgid'"),
- i + 1, pretty_msgstr);
+ {
+ if (arg_used1)
+ error_logger (_("a format specification for argument %u doesn't exist in '%s'"),
+ i + 1, pretty_msgstr);
+ else
+ error_logger (_("a format specification for argument %u, as in '%s', doesn't exist in '%s'"),
+ i + 1, pretty_msgstr, pretty_msgid);
+ }
err = true;
break;
}
if (msgid_descr != NULL)
{
+ const char *pretty_msgid =
+ (msgid_plural != NULL ? "msgid_plural" : "msgid");
char buf[18+1];
const char *pretty_msgstr = "msgstr";
bool has_plural_translations = (strlen (msgstr) + 1 < msgstr_len);
if (parser->check (msgid_descr, msgstr_descr,
strict_checking,
- error_logger, pretty_msgstr))
+ error_logger, pretty_msgid, pretty_msgstr))
seen_errors++;
parser->free (msgstr_descr);
else
{
error_logger (_("\
-'%s' is not a valid %s format string, unlike 'msgid'. Reason: %s"),
+'%s' is not a valid %s format string, unlike '%s'. Reason: %s"),
pretty_msgstr, format_language_pretty[i],
- invalid_reason);
+ pretty_msgid, invalid_reason);
seen_errors++;
free (invalid_reason);
}
msgstr_descr may omit some of the arguments of msgid_descr).
If not, signal an error using error_logger (only if error_logger != NULL)
and return true. Otherwise return false. */
- bool (*check) (void *msgid_descr, void *msgstr_descr, bool equality, formatstring_error_logger_t error_logger, const char *pretty_msgstr);
+ bool (*check) (void *msgid_descr, void *msgstr_descr, bool equality, formatstring_error_logger_t error_logger, const char *pretty_msgid, const char *pretty_msgstr);
};
/* Format string parsers, each defined in its own file. */