diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2012-06-15 02:01:00 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2012-06-15 02:01:00 +0300 |
commit | ccc65b710ef119237fe5469634cf7589c13b365f (patch) | |
tree | 74a20d1ffd4e3db600cd57ebd3cd6475cce74369 /src | |
parent | 80edfd76591fdb9beec061de3c05ef4e9d96ce56 (diff) | |
download | postgresql-ccc65b710ef119237fe5469634cf7589c13b365f.tar.gz postgresql-ccc65b710ef119237fe5469634cf7589c13b365f.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/commands/dbcommands.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index b7224bde870..c9b80ad8232 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -1804,20 +1804,21 @@ check_db_file_conflict(Oid db_id) static int 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) + /* 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.", notherbackends, npreparedxacts); else if (notherbackends > 0) - errdetail("There are %d other session(s) using the database.", - notherbackends); + errdetail_plural("There is %d other session using the database.", + "There are %d other sessions using the database.", + notherbackends, + notherbackends); else - errdetail("There are %d prepared transaction(s) using the database.", - npreparedxacts); + errdetail_plural("There is %d prepared transaction using the database.", + "There are %d prepared transactions using the database.", + npreparedxacts, + npreparedxacts); return 0; /* just to keep ereport macro happy */ } |