diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2009-03-26 22:26:08 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2009-03-26 22:26:08 +0000 |
commit | 8032d76b5bcb037e6bcb4b5615432d4f3842c523 (patch) | |
tree | aec09ebeb02b20d8f0b9833f819fcd60ae315d07 /src/bin/psql | |
parent | 845693f70f9c49ada509187b153848c47a32b530 (diff) | |
download | postgresql-8032d76b5bcb037e6bcb4b5615432d4f3842c523.tar.gz postgresql-8032d76b5bcb037e6bcb4b5615432d4f3842c523.zip |
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.
Diffstat (limited to 'src/bin/psql')
-rw-r--r-- | src/bin/psql/describe.c | 6 | ||||
-rw-r--r-- | src/bin/psql/print.c | 7 |
2 files changed, 4 insertions, 9 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index fe3f6a46bce..0649573b3ed 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -8,7 +8,7 @@ * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.202 2009/03/25 13:11:43 petere Exp $ + * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.203 2009/03/26 22:26:07 petere Exp $ */ #include "postgres_fe.h" @@ -1891,10 +1891,8 @@ describeRoles(const char *pattern, bool verbose) if (conns == 0) appendPQExpBuffer(&buf, _("No connections")); - else if (conns == 1) - appendPQExpBuffer(&buf, _("1 connection")); else - appendPQExpBuffer(&buf, _("%d connections"), conns); + appendPQExpBuffer(&buf, ngettext("1 connection", "%d connections", conns), conns); } attr[i] = pg_strdup(buf.data); diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index 52de0d9463f..1ebf488b35f 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.110 2009/01/01 17:23:55 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.111 2009/03/26 22:26:07 petere Exp $ */ #include "postgres_fe.h" @@ -2348,10 +2348,7 @@ printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout, FILE *f char default_footer[100]; total_records = opt->topt.prior_records + cont.nrows; - if (total_records == 1) - snprintf(default_footer, 100, _("(1 row)")); - else - snprintf(default_footer, 100, _("(%lu rows)"), total_records); + snprintf(default_footer, 100, ngettext("(1 row)", "(%lu rows)", total_records), total_records); printTableAddFooter(&cont, default_footer); } |