git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Martin Ågren" <martin.agren@gmail.com>
To: git@vger.kernel.org
Cc: "Jiang Xin" <worldhello.net@gmail.com>,
	"Alexander Shopov" <ash@kambanaria.org>,
	"Jordi Mas" <jmas@softcatala.org>,
	"Ralf Thielow" <ralf.thielow@gmail.com>,
	"Christopher Díaz" <christopher.diaz.riv@gmail.com>,
	"Jean-Noël Avila" <jn.avila@free.fr>,
	"Marco Paolone" <marcopaolone@gmail.com>,
	"Changwoo Ryu" <cwryu@debian.org>,
	"Vasco Almeida" <vascomalmeida@sapo.pt>,
	"Dimitriy Ryazantcev" <DJm00n@mail.ru>,
	"Peter Krefting" <peter@softwolves.pp.se>,
	"Trần Ngọc Quân" <vnwildman@gmail.com>,
	"Jacques Viviers" <jacques.viviers@gmail.com>,
	m4sk1n <m4sk1n@o2.pl>, "Junio C Hamano" <gitster@pobox.com>,
	"Stefan Beller" <sbeller@google.com>
Subject: [PATCH] submodule: avoid sentence-lego in translated string
Date: Sun,  8 Oct 2017 10:48:24 +0200	[thread overview]
Message-ID: <20171008084824.5331-1-martin.agren@gmail.com> (raw)
In-Reply-To: <CANYiYbGHBDGMEjbrvX_ayXkXkciT3GgL4seM_X1NmWtud2upcg@mail.gmail.com>

We currently build an error message like "entry is a %s, not a commit",
where the placeholder will be replaced with "blob", "tag" or "tree".
Apart from those three placeholder words not being translated, in some
languages it might be awkward or impossible to ensure a grammatically
correct end result.

Shorten the error message to "entry is not a commit". We will still
error out, we will still give a hint about what is wrong, but we will
not be as explicit as before.

Alternatively, we could have different switch-cases for the different
types and pick one of three different error messages. We might still
want a `default` and maybe more tests. So go for this simpler approach
instead.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
I browsed the diff of the .pot and found an addition that looked a bit
translation-unfriendly. Maybe something like this?

 submodule.c                    | 4 ++--
 t/t5531-deep-submodule-push.sh | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/submodule.c b/submodule.c
index 63e7094e1..3d91dbfd5 100644
--- a/submodule.c
+++ b/submodule.c
@@ -796,8 +796,8 @@ static int check_has_commit(const struct object_id *oid, void *data)
 		cb->result = 0;
 		return 0;
 	default:
-		die(_("submodule entry '%s' (%s) is a %s, not a commit"),
-		    cb->path, oid_to_hex(oid), typename(type));
+		die(_("submodule entry '%s' (%s) is not a commit"),
+		    cb->path, oid_to_hex(oid));
 	}
 }
 
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 39cb2c1c3..e4c98bbc5 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -305,7 +305,7 @@ test_expect_success 'submodule entry pointing at a tag is error' '
 	git -C work commit -m "bad commit" &&
 	test_when_finished "git -C work reset --hard HEAD^" &&
 	test_must_fail git -C work push --recurse-submodules=on-demand ../pub.git master 2>err &&
-	test_i18ngrep "is a tag, not a commit" err
+	test_i18ngrep "is not a commit" err
 '
 
 test_expect_success 'push fails if recurse submodules option passed as yes' '
-- 
2.15.0.rc0.37.gd35688db1


  reply	other threads:[~2017-10-08  8:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-08  7:38 [L10N] Kickoff of translation for Git 2.15.0 round 1 Jiang Xin
2017-10-08  8:48 ` Martin Ågren [this message]
2017-10-08  9:32   ` [PATCH] submodule: avoid sentence-lego in translated string Philip Oakley
2017-10-08 10:26     ` Martin Ågren
2017-10-09  0:51     ` brian m. carlson
2017-10-09  1:30       ` Junio C Hamano
2017-10-09  4:14         ` Martin Ågren
2017-10-09 16:47           ` Stefan Beller
2017-10-09 21:11             ` Jean-Noël AVILA
2017-10-10  1:26               ` Junio C Hamano
2017-10-10  2:35                 ` Changwoo Ryu
2017-10-10 18:14                   ` Martin Ågren
2017-10-08 12:18 ` [PATCH] i18n: add a missing space in message Jean-Noel Avila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171008084824.5331-1-martin.agren@gmail.com \
    --to=martin.agren@gmail.com \
    --cc=DJm00n@mail.ru \
    --cc=ash@kambanaria.org \
    --cc=christopher.diaz.riv@gmail.com \
    --cc=cwryu@debian.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacques.viviers@gmail.com \
    --cc=jmas@softcatala.org \
    --cc=jn.avila@free.fr \
    --cc=m4sk1n@o2.pl \
    --cc=marcopaolone@gmail.com \
    --cc=peter@softwolves.pp.se \
    --cc=ralf.thielow@gmail.com \
    --cc=sbeller@google.com \
    --cc=vascomalmeida@sapo.pt \
    --cc=vnwildman@gmail.com \
    --cc=worldhello.net@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).