threads / discuss / 29476

i18n: Avoid sentence puzzles

Subject: i18n: Avoid sentence puzzles

## tl;dr

4 messages between Jan 30, 2012 and Jan 30, 2012.

replies: 3people: 4as markdown or json

Frederik Schwarzer· Jan 30, 2012, 11:31 UTC · lore
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 <schwarzerf@gmail.com>
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
Nguyen Thai Ngoc Duy· Jan 30, 2012, 11:46 UTC · re: Frederik Schwarzer · lore

Re: i18n: Avoid sentence puzzles

On Mon, Jan 30, 2012 at 6:31 PM, Frederik Schwarzer <schwarzerf@gmail.com> wrote:

Show 12 quoted lines
> 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.
> ...
> 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.

As a translator (though not git's because my time is limited and GUI apps have my priority), I completely agree and support this. There are other places where a sentence is broken down into many short phrases. It's hard for a translator to find a good translation in such cases.

I remember there was also a patch about "1 file vs 2 files" in diff summary, which was rejected because it would break scripts. I think grammar patches should be allowed at least for interactive use (i.e. either pager is on, or std{out,err} is tty).

-- 
Duy
Junio C Hamano· Jan 30, 2012, 18:57 UTC · re: Frederik Schwarzer · lore

Re: i18n: Avoid sentence puzzles

Frederik Schwarzer <schwarzerf@gmail.com> writes:
> 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.

The sample you supplied for 'branch' vs 'remote branch' is a good change in the logic to choose what translatable message to use, and I do suspect that there are other instances of problems of this kind.

I am expecting that we may see some activity to the logic in that file during this cycle, and we would need to be careful not make people step on other people's toes, though.

Ævar Arnfjörð Bjarmason· Jan 30, 2012, 21:12 UTC · re: Frederik Schwarzer · lore

Re: i18n: Avoid sentence puzzles

On Mon, Jan 30, 2012 at 12:31, Frederik Schwarzer <schwarzerf@gmail.com> wrote:
Show 10 quoted lines
> 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.

I added the i18n support you're having problems with, and I completely agree that this is the sort of thing we need to do.

Unfortunately when I added the i18n support I didn't have time to get rid of all these sentence puzzles (or, to put it another way "lego" sentences). You should never force translators to translate partial sentences, you should always provide them with full sentences that they can translate completely, even if that means that there's some duplication for some languages.

Problem reports like this one are exactly what we need at this point for i18n, we need people spotting these issues, and then we can fix them.

← back to recent threads