Subject: i18n: Avoid sentence puzzles

From: Frederik Schwarzer <[email-masked]>
Date: Mon, 30 Jan 2012 12:31:20 +0100

Hi,

in order to enable translators to prepare proper translations, 
sentence puzzles have to be avoided. While it makes perfect sense for 
English, some languages may have to separate those words to sound or 
even be correct.

The attached patch demonstrates a change to achive that. I did not 
test it because its purpose is only to raise awareness and start a 
discussion about this topic. After all the question is, how important 
translations are for a tool like Git. I have started a German 
translation but many things are really hard to translate.
1) Many words are used in a germanised way, so translating them
   not only feels awkward in some cases but it also might confuse
   users who are used to the original wording.
2) English is a language that can be used in a very compact way.
   In German that can feel dumb or even rude. So texts can grow
   up to twice or thrice their size. That can clutter the terminal
   appearance quite a bit.

Given those problems many people avoid using command line tools in 
their language and I see the usefulness of translations rather 
limited.

So my question would be: Is it considered worth it to extend the code 
for translators' and translations' sake? If so, I would be glad to 
help with that.

Regards
From 7b1475cbffe120fdae1b46a2974a7b94846702c4 Mon Sep 17 00:00:00 2001
From: Frederik Schwarzer <[email-masked]>
Date: Mon, 30 Jan 2012 12:02:46 +0100
Subject: [PATCH] Avoid puzzle sentences.

---
 builtin/branch.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 7095718..a07ac54 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -154,18 +154,17 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 	const char *fmt, *remote;
 	int i;
 	int ret = 0;
+	int is_remote = 0;
 	struct strbuf bname = STRBUF_INIT;
 
 	switch (kinds) {
 	case REF_REMOTE_BRANCH:
 		fmt = "refs/remotes/%s";
-		/* TRANSLATORS: This is "remote " in "remote branch '%s' not found" */
-		remote = _("remote ");
+		is_remote = 1;
 		force = 1;
 		break;
 	case REF_LOCAL_BRANCH:
 		fmt = "refs/heads/%s";
-		remote = "";
 		break;
 	default:
 		die(_("cannot use -a with -d"));
@@ -189,8 +188,11 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 
 		name = xstrdup(mkpath(fmt, bname.buf));
 		if (read_ref(name, sha1)) {
-			error(_("%sbranch '%s' not found."),
-					remote, bname.buf);
+			if (is_remote) {
+				error(_("remote branch '%s' not found."), bname.buf);
+			} else {
+				error(_("branch '%s' not found."), bname.buf);
+			}
 			ret = 1;
 			continue;
 		}
@@ -211,14 +213,21 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 		}
 
 		if (delete_ref(name, sha1, 0)) {
-			error(_("Error deleting %sbranch '%s'"), remote,
-			      bname.buf);
+			if (is_remote) {
+				error(_("Error deleting remote branch '%s'"), bname.buf);
+			} else {
+				error(_("Error deleting branch '%s'"), bname.buf);
+			}
 			ret = 1;
 		} else {
 			struct strbuf buf = STRBUF_INIT;
-			printf(_("Deleted %sbranch %s (was %s).\n"), remote,
-			       bname.buf,
+			if (is_remote) {
+				printf(_("Deleted remote branch %s (was %s).\n"), bname.buf,
 			       find_unique_abbrev(sha1, DEFAULT_ABBREV));
+			} else {
+				printf(_("Deleted branch %s (was %s).\n"), bname.buf,
+			       find_unique_abbrev(sha1, DEFAULT_ABBREV));
+			}
 			strbuf_addf(&buf, "branch.%s", bname.buf);
 			if (git_config_rename_section(buf.buf, NULL) < 0)
 				warning(_("Update of config-file failed"));
-- 
1.7.8.3