Use singular number when appropriate

Started by David Fetterover 5 years ago5 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t44389
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 27, 2026 at 04:48 PM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t44389_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t44389_1 && git checkout t44389_1

Patchset v1 (message #1) is on t44389_1

Jump to latest
#1David Fetter
david@fetter.org

Hi,

I thought about using the dual, but wasn't sure how many languages
support it.

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Attachments:

t44389_1
v1-0001-Singular-number-when-appropriate.patchtext/x-diff; charset=us-asciiDownload+13-8
#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: David Fetter (#1)
Re: Use singular number when appropriate

On 15/06/2021 07:59, David Fetter wrote:

Hi,

I thought about using the dual, but wasn't sure how many languages
support it.

if (fail_count == 0 && fail_ignore_count == 0)
snprintf(buf, sizeof(buf),
_(" %s %d test%s passed. "),
success_count == 1 ? "The" : "All",
success_count,
success_count == 1 ? "" : "s");

Constructing sentences like that is bad practice for translations. See
https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html.

- Heikki

#3Julien Rouhaud
rjuju123@gmail.com
In reply to: David Fetter (#1)
Re: Use singular number when appropriate

On Tue, Jun 15, 2021 at 04:59:24AM +0000, David Fetter wrote:

Hi,

I thought about using the dual, but wasn't sure how many languages
support it.

I don't think that you can assume that appending something will work in all
languages. Note that it also doesn't always work in english (e.g. this/these),
as seen in this inconsistent change:

- _(" %d of %d tests failed, %d of these failures ignored. "),

+ _(" %d of %d test%s failed, %d of these failures ignored. "),

#4Laurenz Albe
laurenz.albe@cybertec.at
In reply to: David Fetter (#1)
Re: Use singular number when appropriate

On Tue, 2021-06-15 at 04:59 +0000, David Fetter wrote:

I thought about using the dual, but wasn't sure how many languages
support it.

I think none of the languages for which we cater uses the dual.
But I guess you were joking, since the tests are not translated ...

if (fail_count == 0 && fail_ignore_count == 0)
snprintf(buf, sizeof(buf),
-				 _(" All %d tests passed. "),
-				 success_count);
+				 _(" %s %d test%s passed. "),
+				 success_count == 1 ? "The" : "All",
+				 success_count,
+				 success_count == 1 ? "" : "s");

... and that wouldn't be translatable.

Yours,
Laurenz Albe

#5David Fetter
david@fetter.org
In reply to: Laurenz Albe (#4)
Re: Use singular number when appropriate

On Tue, Jun 15, 2021 at 09:37:11AM +0200, Laurenz Albe wrote:

On Tue, 2021-06-15 at 04:59 +0000, David Fetter wrote:

I thought about using the dual, but wasn't sure how many languages
support it.

I think none of the languages for which we cater uses the dual. But
I guess you were joking, since the tests are not translated ...

I was.

if (fail_count == 0 && fail_ignore_count == 0)
snprintf(buf, sizeof(buf),
-				 _(" All %d tests passed. "),
-				 success_count);
+				 _(" %s %d test%s passed. "),
+				 success_count == 1 ? "The" : "All",
+				 success_count,
+				 success_count == 1 ? "" : "s");

... and that wouldn't be translatable.

Thanks, will rearrange.

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate