# [PATCH] setup: split "extensions found" messages into singular and plural

3 messages from 2021-05-18 to 2021-05-18. Participants: Alex Henrie, Jeff King, Michal Suchánek.
Thread: https://gitlist.dev/t/55717

## Alex Henrie, 2021-05-18 06:19

Subject: [PATCH] setup: split "extensions found" messages into singular and plural
Message-ID: <20210518061917.57556-1-alexhenrie24@gmail.com>
URL: https://gitlist.dev/e/20210518061917.57556-1-alexhenrie24%40gmail.com

```
It's easier to translate this way.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 setup.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/setup.c b/setup.c
index 59e2facd9d..ead2f80cd8 100644
--- a/setup.c
+++ b/setup.c
@@ -666,7 +666,9 @@ int verify_repository_format(const struct repository_format *format,
 	if (format->version >= 1 && format->unknown_extensions.nr) {
 		int i;
 
-		strbuf_addstr(err, _("unknown repository extensions found:"));
+		strbuf_addstr(err, Q_("unknown repository extension found:",
+				      "unknown repository extensions found:",
+				      format->unknown_extensions.nr));
 
 		for (i = 0; i < format->unknown_extensions.nr; i++)
 			strbuf_addf(err, "\n\t%s",
@@ -678,7 +680,9 @@ int verify_repository_format(const struct repository_format *format,
 		int i;
 
 		strbuf_addstr(err,
-			      _("repo version is 0, but v1-only extensions found:"));
+			      Q_("repo version is 0, but v1-only extension found:",
+				 "repo version is 0, but v1-only extensions found:",
+				 format->v1_only_extensions.nr));
 
 		for (i = 0; i < format->v1_only_extensions.nr; i++)
 			strbuf_addf(err, "\n\t%s",
-- 
2.31.1


```

## Jeff King, 2021-05-18 06:29

Subject: Re: [PATCH] setup: split "extensions found" messages into singular and plural
Message-ID: <YKNe50TDMftkadYI@coredump.intra.peff.net>
URL: https://gitlist.dev/e/YKNe50TDMftkadYI%40coredump.intra.peff.net
In-Reply-To: <20210518061917.57556-1-alexhenrie24@gmail.com>

```
On Tue, May 18, 2021 at 12:19:17AM -0600, Alex Henrie wrote:

> It's easier to translate this way.

Makes sense.

I don't know about "easier to translate", since there are twice as many
strings now. But certainly what the user sees will be more grammatically
correct. :)

-Peff

```

## Michal Suchánek, 2021-05-18 08:27

Subject: Re: [PATCH] setup: split "extensions found" messages into singular and plural
Message-ID: <20210518082715.GO8544@kitsune.suse.cz>
URL: https://gitlist.dev/e/20210518082715.GO8544%40kitsune.suse.cz
In-Reply-To: <YKNe50TDMftkadYI@coredump.intra.peff.net>

```
On Tue, May 18, 2021 at 02:29:59AM -0400, Jeff King wrote:
> On Tue, May 18, 2021 at 12:19:17AM -0600, Alex Henrie wrote:
> 
> > It's easier to translate this way.
> 
> Makes sense.
> 
> I don't know about "easier to translate", since there are twice as many
> strings now. But certainly what the user sees will be more grammatically
> correct. :)

Note that some languages may still have dual (that is 2 extensions is
different from both 1 and 3 and more extensions), and so on for 3 and 4,
and in some languages 21 (and 31 but not necessarily 11) extensions may
be singular again.

Kind of reminds me of
https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/

Thanks

Michal

```
