From 8032d76b5bcb037e6bcb4b5615432d4f3842c523 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 26 Mar 2009 22:26:08 +0000 Subject: Gettext plural support In the backend, I changed only a handful of exemplary or important-looking instances to make use of the plural support; there is probably more work there. For the rest of the source, this should cover all relevant cases. --- src/backend/parser/parse_func.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/backend/parser/parse_func.c') diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index 4ef129a67b8..edee35edcee 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.211 2009/01/01 17:23:45 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.212 2009/03/26 22:26:06 petere Exp $ * *------------------------------------------------------------------------- */ @@ -89,7 +89,9 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, if (list_length(fargs) > FUNC_MAX_ARGS) ereport(ERROR, (errcode(ERRCODE_TOO_MANY_ARGUMENTS), - errmsg("cannot pass more than %d arguments to a function", + errmsg(ngettext("cannot pass more than %d argument to a function", + "cannot pass more than %d arguments to a function", + FUNC_MAX_ARGS), FUNC_MAX_ARGS), parser_errposition(pstate, location))); @@ -259,7 +261,9 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, if (nargsplusdefs >= FUNC_MAX_ARGS) ereport(ERROR, (errcode(ERRCODE_TOO_MANY_ARGUMENTS), - errmsg("cannot pass more than %d arguments to a function", + errmsg(ngettext("cannot pass more than %d argument to a function", + "cannot pass more than %d arguments to a function", + FUNC_MAX_ARGS), FUNC_MAX_ARGS), parser_errposition(pstate, location))); @@ -538,7 +542,9 @@ func_select_candidate(int nargs, if (nargs > FUNC_MAX_ARGS) ereport(ERROR, (errcode(ERRCODE_TOO_MANY_ARGUMENTS), - errmsg("cannot pass more than %d arguments to a function", + errmsg(ngettext("cannot pass more than %d argument to a function", + "cannot pass more than %d arguments to a function", + FUNC_MAX_ARGS), FUNC_MAX_ARGS))); /* @@ -1413,7 +1419,9 @@ LookupFuncNameTypeNames(List *funcname, List *argtypes, bool noError) if (argcount > FUNC_MAX_ARGS) ereport(ERROR, (errcode(ERRCODE_TOO_MANY_ARGUMENTS), - errmsg("functions cannot have more than %d arguments", + errmsg(ngettext("functions cannot have more than %d argument", + "functions cannot have more than %d arguments", + FUNC_MAX_ARGS), FUNC_MAX_ARGS))); args_item = list_head(argtypes); @@ -1451,7 +1459,9 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError) if (argcount > FUNC_MAX_ARGS) ereport(ERROR, (errcode(ERRCODE_TOO_MANY_ARGUMENTS), - errmsg("functions cannot have more than %d arguments", + errmsg(ngettext("functions cannot have more than %d argument", + "functions cannot have more than %d arguments", + FUNC_MAX_ARGS), FUNC_MAX_ARGS))); i = 0; -- cgit v1.2.3