# [PATCH] merge-ort: split "distinct types" message into two translatable messages

6 messages from 2021-05-09 to 2021-05-10. Participants: Alex Henrie, Bagas Sanjaya, Elijah Newren, Jeff King.
Thread: https://gitlist.dev/t/55654

## Alex Henrie, 2021-05-09 21:52

Subject: [PATCH] merge-ort: split "distinct types" message into two translatable messages
Message-ID: <20210509215250.33215-1-alexhenrie24@gmail.com>
URL: https://gitlist.dev/e/20210509215250.33215-1-alexhenrie24%40gmail.com

```
The word "renamed" has two possible translations in many European
languages depending on whether one thing was renamed or two things were
renamed. Give translators freedom to alter any part of the message to
make it sound right in their language.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 merge-ort.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/merge-ort.c b/merge-ort.c
index 6c2792b10e..745a844b18 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -3050,12 +3050,21 @@ static void process_entry(struct merge_options *opt,
 				rename_b = 1;
 			}
 
-			path_msg(opt, path, 0,
-				 _("CONFLICT (distinct types): %s had different "
-				   "types on each side; renamed %s of them so "
-				   "each can be recorded somewhere."),
-				 path,
-				 (rename_a && rename_b) ? _("both") : _("one"));
+			if (rename_a && rename_b) {
+				path_msg(opt, path, 0,
+					 _("CONFLICT (distinct types): %s had "
+					   "different types on each side; "
+					   "renamed both of them so each can "
+					   "be recorded somewhere."),
+					 path);
+			} else {
+				path_msg(opt, path, 0,
+					 _("CONFLICT (distinct types): %s had "
+					   "different types on each side; "
+					   "renamed one of them so each can be "
+					   "recorded somewhere."),
+					 path);
+			}
 
 			ci->merged.clean = 0;
 			memcpy(new_ci, ci, sizeof(*new_ci));
-- 
2.31.1


```

## Bagas Sanjaya, 2021-05-10 05:36

Subject: Re: [PATCH] merge-ort: split "distinct types" message into two translatable messages
Message-ID: <bb3a3968-f78e-7534-1274-2e6c916b9a8a@gmail.com>
URL: https://gitlist.dev/e/bb3a3968-f78e-7534-1274-2e6c916b9a8a%40gmail.com
In-Reply-To: <20210509215250.33215-1-alexhenrie24@gmail.com>

```
On 10/05/21 04.52, Alex Henrie wrote:
> The word "renamed" has two possible translations in many European
> languages depending on whether one thing was renamed or two things were
> renamed. Give translators freedom to alter any part of the message to
> make it sound right in their language.

What are the examples? In French, Spanish, German, Portuguese (pt-PT),
or even Slavic (like Russian) or even Hungarian, and etc?

> -			path_msg(opt, path, 0,
> -				 _("CONFLICT (distinct types): %s had different "
> -				   "types on each side; renamed %s of them so "
> -				   "each can be recorded somewhere."),
> -				 path,
> -				 (rename_a && rename_b) ? _("both") : _("one"));
> +			if (rename_a && rename_b) {
> +				path_msg(opt, path, 0,
> +					 _("CONFLICT (distinct types): %s had "
> +					   "different types on each side; "
> +					   "renamed both of them so each can "
> +					   "be recorded somewhere."),
> +					 path);
> +			} else {
> +				path_msg(opt, path, 0,
> +					 _("CONFLICT (distinct types): %s had "
> +					   "different types on each side; "
> +					   "renamed one of them so each can be "
> +					   "recorded somewhere."),
> +					 path);
> +			}

Seems OK.

For example, in Indonesian, the first case (both sides are renamed) would be
something like:
ˋˋˋ
%s punya tipe yang berbeda pada setiap sisi, kedua-duanya dinamai ulang...
ˋˋˋ
The second case (only one side) would be something like:
ˋˋˋ
%s punya tipe yang berbeda pada setiap sisi, salah satunya dinamai ulang...
ˋˋˋ
But the status quo (before this patch) would be translated as:
ˋˋˋ
%s punya tipe yang berbeda pada setiap sisi, (kedua-duanya | satu) dari mereka
dinamai ulang...
ˋˋˋ
On the both sides case of status quo, the personal pronoun `mereka` (they)
refers to the conflicted sides, where as on this patch, such conflicted sides
are instead be referred as `-nya` suffix on the translation.

I personally avoid using `mereka` atau `ia` as personal pronoun that refer
to things, and instead using `itu`.

-- 
An old man doll... just what I always wanted! - Clara

```

## Bagas Sanjaya, 2021-05-10 05:50

Subject: Re: [PATCH] merge-ort: split "distinct types" message into two translatable messages
Message-ID: <4c86452a-81dd-3bb9-a6a8-29cb1a0dd0de@gmail.com>
URL: https://gitlist.dev/e/4c86452a-81dd-3bb9-a6a8-29cb1a0dd0de%40gmail.com
In-Reply-To: <bb3a3968-f78e-7534-1274-2e6c916b9a8a@gmail.com>

```
On 10/05/21 12.36, Bagas Sanjaya wrote:
> Seems OK.
> 
> For example, in Indonesian, the first case (both sides are renamed) would be
> something like:
> ˋˋˋ
> %s punya tipe yang berbeda pada setiap sisi, kedua-duanya dinamai ulang...
> ˋˋˋ
> The second case (only one side) would be something like:
> ˋˋˋ
> %s punya tipe yang berbeda pada setiap sisi, salah satunya dinamai ulang...
> ˋˋˋ
> But the status quo (before this patch) would be translated as:
> ˋˋˋ
> %s punya tipe yang berbeda pada setiap sisi, (kedua-duanya | satu) dari mereka
> dinamai ulang...
> ˋˋˋ
> On the both sides case of status quo, the personal pronoun `mereka` (they)
> refers to the conflicted sides, where as on this patch, such conflicted sides
> are instead be referred as `-nya` suffix on the translation.
> 
> I personally avoid using `mereka` atau `ia` as personal pronoun that refer
> to things, and instead using `itu`.
> 

What I meant was I use `itu` as personal pronoun that refers to things (not
people) instead of `mereka` or `ia` as translation of English pronouns
"them" and "it".

-- 
An old man doll... just what I always wanted! - Clara

```

## Alex Henrie, 2021-05-10 16:42

Subject: Re: [PATCH] merge-ort: split "distinct types" message into two translatable messages
Message-ID: <CAMMLpeT7ezjh95rpJ4_MJ=QyEgCpjYBNG5kaQt00RUKGA7Jd9w@mail.gmail.com>
URL: https://gitlist.dev/e/CAMMLpeT7ezjh95rpJ4_MJ%3DQyEgCpjYBNG5kaQt00RUKGA7Jd9w%40mail.gmail.com
In-Reply-To: <bb3a3968-f78e-7534-1274-2e6c916b9a8a@gmail.com>

```
On Sun, May 9, 2021 at 11:36 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
>
> On 10/05/21 04.52, Alex Henrie wrote:
> > The word "renamed" has two possible translations in many European
> > languages depending on whether one thing was renamed or two things were
> > renamed. Give translators freedom to alter any part of the message to
> > make it sound right in their language.
>
> What are the examples? In French, Spanish, German, Portuguese (pt-PT),
> or even Slavic (like Russian) or even Hungarian, and etc?

The ones I know of are Catalan, German, and Spanish, but I'm sure
there are others.

-Alex

```

## Elijah Newren, 2021-05-10 19:29

Subject: Re: [PATCH] merge-ort: split "distinct types" message into two translatable messages
Message-ID: <CABPp-BFa484zCeXpzZ36ev2pBfDCH=Kp4wWWF_hZSQvgrf3LYA@mail.gmail.com>
URL: https://gitlist.dev/e/CABPp-BFa484zCeXpzZ36ev2pBfDCH%3DKp4wWWF_hZSQvgrf3LYA%40mail.gmail.com
In-Reply-To: <20210509215250.33215-1-alexhenrie24@gmail.com>

```
On Sun, May 9, 2021 at 2:53 PM Alex Henrie <alexhenrie24@gmail.com> wrote:
>
> The word "renamed" has two possible translations in many European
> languages depending on whether one thing was renamed or two things were
> renamed. Give translators freedom to alter any part of the message to
> make it sound right in their language.
>
> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
> ---
>  merge-ort.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/merge-ort.c b/merge-ort.c
> index 6c2792b10e..745a844b18 100644
> --- a/merge-ort.c
> +++ b/merge-ort.c
> @@ -3050,12 +3050,21 @@ static void process_entry(struct merge_options *opt,
>                                 rename_b = 1;
>                         }
>
> -                       path_msg(opt, path, 0,
> -                                _("CONFLICT (distinct types): %s had different "
> -                                  "types on each side; renamed %s of them so "
> -                                  "each can be recorded somewhere."),
> -                                path,
> -                                (rename_a && rename_b) ? _("both") : _("one"));
> +                       if (rename_a && rename_b) {
> +                               path_msg(opt, path, 0,
> +                                        _("CONFLICT (distinct types): %s had "
> +                                          "different types on each side; "
> +                                          "renamed both of them so each can "
> +                                          "be recorded somewhere."),
> +                                        path);
> +                       } else {
> +                               path_msg(opt, path, 0,
> +                                        _("CONFLICT (distinct types): %s had "
> +                                          "different types on each side; "
> +                                          "renamed one of them so each can be "
> +                                          "recorded somewhere."),
> +                                        path);
> +                       }
>
>                         ci->merged.clean = 0;
>                         memcpy(new_ci, ci, sizeof(*new_ci));
> --
> 2.31.1

I don't know much on the translation side (thanks for fixing it up for
me), but looks innocuous and correct from the code side:

Acked-by: Elijah Newren <newren@gmail.com>

```

## Jeff King, 2021-05-10 22:33

Subject: Re: [PATCH] merge-ort: split "distinct types" message into two translatable messages
Message-ID: <YJm0r15gK3DjKbbl@coredump.intra.peff.net>
URL: https://gitlist.dev/e/YJm0r15gK3DjKbbl%40coredump.intra.peff.net
In-Reply-To: <20210509215250.33215-1-alexhenrie24@gmail.com>

```
On Sun, May 09, 2021 at 03:52:50PM -0600, Alex Henrie wrote:

> The word "renamed" has two possible translations in many European
> languages depending on whether one thing was renamed or two things were
> renamed. Give translators freedom to alter any part of the message to
> make it sound right in their language.

Makes sense. And in general, I think the advice (e.g., given in
gettext's "Preparing Strings" doc) is to avoid the kind of "lego"
translation structure we saw in the original (where words like "both" or
"none" might need more context than a single %s provides).

> -			path_msg(opt, path, 0,
> -				 _("CONFLICT (distinct types): %s had different "
> -				   "types on each side; renamed %s of them so "
> -				   "each can be recorded somewhere."),
> -				 path,
> -				 (rename_a && rename_b) ? _("both") : _("one"));
> +			if (rename_a && rename_b) {
> +				path_msg(opt, path, 0,
> +					 _("CONFLICT (distinct types): %s had "
> +					   "different types on each side; "
> +					   "renamed both of them so each can "
> +					   "be recorded somewhere."),
> +					 path);
> +			} else {
> +				path_msg(opt, path, 0,
> +					 _("CONFLICT (distinct types): %s had "
> +					   "different types on each side; "
> +					   "renamed one of them so each can be "
> +					   "recorded somewhere."),
> +					 path);
> +			}

I wondered if we could be using the Q_() helper here, which
distinguishes cases based on quantity. But I don't think this is
semantically quite the same thing (it's not "rename" versus "renames",
but rather two distinctly interesting cases).

-Peff

```
