Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d933092

Browse files
committed
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.
1 parent 8507c2f commit d933092

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/backend/commands/dbcommands.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -1804,20 +1804,21 @@ check_db_file_conflict(Oid db_id)
18041804
static int
18051805
errdetail_busy_db(int notherbackends, int npreparedxacts)
18061806
{
1807-
/*
1808-
* We don't worry about singular versus plural here, since the English
1809-
* rules for that don't translate very well. But we can at least avoid
1810-
* the case of zero items.
1811-
*/
18121807
if (notherbackends > 0 && npreparedxacts > 0)
1808+
/* We don't deal with singular versus plural here, since gettext
1809+
* doesn't support multiple plurals in one string. */
18131810
errdetail("There are %d other session(s) and %d prepared transaction(s) using the database.",
18141811
notherbackends, npreparedxacts);
18151812
else if (notherbackends > 0)
1816-
errdetail("There are %d other session(s) using the database.",
1817-
notherbackends);
1813+
errdetail_plural("There is %d other session using the database.",
1814+
"There are %d other sessions using the database.",
1815+
notherbackends,
1816+
notherbackends);
18181817
else
1819-
errdetail("There are %d prepared transaction(s) using the database.",
1820-
npreparedxacts);
1818+
errdetail_plural("There is %d prepared transaction using the database.",
1819+
"There are %d prepared transactions using the database.",
1820+
npreparedxacts,
1821+
npreparedxacts);
18211822
return 0; /* just to keep ereport macro happy */
18221823
}
18231824

0 commit comments

Comments
 (0)