mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
Add more message pluralization
Even though we can't do much about the case with multiple plurals in one sentence, we can fix the other cases.
This commit is contained in:
parent
80edfd7659
commit
ccc65b710e
@ -1804,19 +1804,20 @@ check_db_file_conflict(Oid db_id)
|
|||||||
static int
|
static int
|
||||||
errdetail_busy_db(int notherbackends, int npreparedxacts)
|
errdetail_busy_db(int notherbackends, int npreparedxacts)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* We don't worry about singular versus plural here, since the English
|
|
||||||
* rules for that don't translate very well. But we can at least avoid
|
|
||||||
* the case of zero items.
|
|
||||||
*/
|
|
||||||
if (notherbackends > 0 && npreparedxacts > 0)
|
if (notherbackends > 0 && npreparedxacts > 0)
|
||||||
|
/* We don't deal with singular versus plural here, since gettext
|
||||||
|
* doesn't support multiple plurals in one string. */
|
||||||
errdetail("There are %d other session(s) and %d prepared transaction(s) using the database.",
|
errdetail("There are %d other session(s) and %d prepared transaction(s) using the database.",
|
||||||
notherbackends, npreparedxacts);
|
notherbackends, npreparedxacts);
|
||||||
else if (notherbackends > 0)
|
else if (notherbackends > 0)
|
||||||
errdetail("There are %d other session(s) using the database.",
|
errdetail_plural("There is %d other session using the database.",
|
||||||
|
"There are %d other sessions using the database.",
|
||||||
|
notherbackends,
|
||||||
notherbackends);
|
notherbackends);
|
||||||
else
|
else
|
||||||
errdetail("There are %d prepared transaction(s) using the database.",
|
errdetail_plural("There is %d prepared transaction using the database.",
|
||||||
|
"There are %d prepared transactions using the database.",
|
||||||
|
npreparedxacts,
|
||||||
npreparedxacts);
|
npreparedxacts);
|
||||||
return 0; /* just to keep ereport macro happy */
|
return 0; /* just to keep ereport macro happy */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user