{"thread":{"id":"29476","subject":"i18n: Avoid sentence puzzles","startedAt":"2012-01-30T11:31:20Z","lastAt":"2012-01-30T21:12:34Z","messageCount":4,"participants":["Frederik Schwarzer","Nguyen Thai Ngoc Duy","Junio C Hamano","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"183308","messageId":"201201301231.21090.schwarzerf@gmail.com","threadId":"29476","inReplyTo":null,"subject":"i18n: Avoid sentence puzzles","fromName":"Frederik Schwarzer","fromEmail":"schwarzerf@gmail.com","sentAt":"2012-01-30T11:31:20Z","receivedAt":"2012-01-30T11:31:20Z","isPatch":false,"sender":{"key":"schwarzerf@gmail.com","avatar":null},"body":"Hi,\n\nin order to enable translators to prepare proper translations, \nsentence puzzles have to be avoided. While it makes perfect sense for \nEnglish, some languages may have to separate those words to sound or \neven be correct.\n\nThe attached patch demonstrates a change to achive that. I did not \ntest it because its purpose is only to raise awareness and start a \ndiscussion about this topic. After all the question is, how important \ntranslations are for a tool like Git. I have started a German \ntranslation but many things are really hard to translate.\n1) Many words are used in a germanised way, so translating them\n   not only feels awkward in some cases but it also might confuse\n   users who are used to the original wording.\n2) English is a language that can be used in a very compact way.\n   In German that can feel dumb or even rude. So texts can grow\n   up to twice or thrice their size. That can clutter the terminal\n   appearance quite a bit.\n\nGiven those problems many people avoid using command line tools in \ntheir language and I see the usefulness of translations rather \nlimited.\n\nSo my question would be: Is it considered worth it to extend the code \nfor translators' and translations' sake? If so, I would be glad to \nhelp with that.\n\nRegards\n\n\nFrom 7b1475cbffe120fdae1b46a2974a7b94846702c4 Mon Sep 17 00:00:00 2001\nFrom: Frederik Schwarzer <schwarzerf@gmail.com>\nDate: Mon, 30 Jan 2012 12:02:46 +0100\nSubject: [PATCH] Avoid puzzle sentences.\n\n---\n builtin/branch.c |   27 ++++++++++++++++++---------\n 1 files changed, 18 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 7095718..a07ac54 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -154,18 +154,17 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \tconst char *fmt, *remote;\n \tint i;\n \tint ret = 0;\n+\tint is_remote = 0;\n \tstruct strbuf bname = STRBUF_INIT;\n \n \tswitch (kinds) {\n \tcase REF_REMOTE_BRANCH:\n \t\tfmt = \"refs/remotes/%s\";\n-\t\t/* TRANSLATORS: This is \"remote \" in \"remote branch '%s' not found\" */\n-\t\tremote = _(\"remote \");\n+\t\tis_remote = 1;\n \t\tforce = 1;\n \t\tbreak;\n \tcase REF_LOCAL_BRANCH:\n \t\tfmt = \"refs/heads/%s\";\n-\t\tremote = \"\";\n \t\tbreak;\n \tdefault:\n \t\tdie(_(\"cannot use -a with -d\"));\n@@ -189,8 +188,11 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \n \t\tname = xstrdup(mkpath(fmt, bname.buf));\n \t\tif (read_ref(name, sha1)) {\n-\t\t\terror(_(\"%sbranch '%s' not found.\"),\n-\t\t\t\t\tremote, bname.buf);\n+\t\t\tif (is_remote) {\n+\t\t\t\terror(_(\"remote branch '%s' not found.\"), bname.buf);\n+\t\t\t} else {\n+\t\t\t\terror(_(\"branch '%s' not found.\"), bname.buf);\n+\t\t\t}\n \t\t\tret = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -211,14 +213,21 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)\n \t\t}\n \n \t\tif (delete_ref(name, sha1, 0)) {\n-\t\t\terror(_(\"Error deleting %sbranch '%s'\"), remote,\n-\t\t\t      bname.buf);\n+\t\t\tif (is_remote) {\n+\t\t\t\terror(_(\"Error deleting remote branch '%s'\"), bname.buf);\n+\t\t\t} else {\n+\t\t\t\terror(_(\"Error deleting branch '%s'\"), bname.buf);\n+\t\t\t}\n \t\t\tret = 1;\n \t\t} else {\n \t\t\tstruct strbuf buf = STRBUF_INIT;\n-\t\t\tprintf(_(\"Deleted %sbranch %s (was %s).\\n\"), remote,\n-\t\t\t       bname.buf,\n+\t\t\tif (is_remote) {\n+\t\t\t\tprintf(_(\"Deleted remote branch %s (was %s).\\n\"), bname.buf,\n \t\t\t       find_unique_abbrev(sha1, DEFAULT_ABBREV));\n+\t\t\t} else {\n+\t\t\t\tprintf(_(\"Deleted branch %s (was %s).\\n\"), bname.buf,\n+\t\t\t       find_unique_abbrev(sha1, DEFAULT_ABBREV));\n+\t\t\t}\n \t\t\tstrbuf_addf(&buf, \"branch.%s\", bname.buf);\n \t\t\tif (git_config_rename_section(buf.buf, NULL) < 0)\n \t\t\t\twarning(_(\"Update of config-file failed\"));\n-- \n1.7.8.3\n\n"},{"id":"183313","messageId":"CACsJy8CUXSSvToPrx9aW5a76BV=g7OTrWLZ2MQ6xDTpDSLpPeA@mail.gmail.com","threadId":"29476","inReplyTo":"201201301231.21090.schwarzerf@gmail.com","subject":"Re: i18n: Avoid sentence puzzles","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-01-30T11:46:52Z","receivedAt":"2012-01-30T11:46:52Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Jan 30, 2012 at 6:31 PM, Frederik Schwarzer\n<schwarzerf@gmail.com> wrote:\n> Hi,\n>\n> in order to enable translators to prepare proper translations,\n> sentence puzzles have to be avoided. While it makes perfect sense for\n> English, some languages may have to separate those words to sound or\n> even be correct.\n>\n> The attached patch demonstrates a change to achive that.\n> ...\n> So my question would be: Is it considered worth it to extend the code\n> for translators' and translations' sake? If so, I would be glad to\n> help with that.\n\nAs a translator (though not git's because my time is limited and GUI\napps have my priority), I completely agree and support this. There are\nother places where a sentence is broken down into many short phrases.\nIt's hard for a translator to find a good translation in such cases.\n\nI remember there was also a patch about \"1 file vs 2 files\" in diff\nsummary, which was rejected because it would break scripts. I think\ngrammar patches should be allowed at least for interactive use (i.e.\neither pager is on, or std{out,err} is tty).\n-- \nDuy\n"},{"id":"183359","messageId":"7vty3dauif.fsf@alter.siamese.dyndns.org","threadId":"29476","inReplyTo":"201201301231.21090.schwarzerf@gmail.com","subject":"Re: i18n: Avoid sentence puzzles","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-01-30T18:57:12Z","receivedAt":"2012-01-30T18:57:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frederik Schwarzer <schwarzerf@gmail.com> writes:\n\n> So my question would be: Is it considered worth it to extend the code \n> for translators' and translations' sake? If so, I would be glad to \n> help with that.\n\nThe sample you supplied for 'branch' vs 'remote branch' is a good change\nin the logic to choose what translatable message to use, and I do suspect\nthat there are other instances of problems of this kind.\n\nI am expecting that we may see some activity to the logic in that file\nduring this cycle, and we would need to be careful not make people step on\nother people's toes, though.\n"},{"id":"183390","messageId":"CACBZZX6HiGNGEbvCF=Ba2BwUuJ09XFn56nMnF0SDt4T_7OyOhA@mail.gmail.com","threadId":"29476","inReplyTo":"201201301231.21090.schwarzerf@gmail.com","subject":"Re: i18n: Avoid sentence puzzles","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2012-01-30T21:12:34Z","receivedAt":"2012-01-30T21:12:34Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Jan 30, 2012 at 12:31, Frederik Schwarzer <schwarzerf@gmail.com> wrote:\n> in order to enable translators to prepare proper translations,\n> sentence puzzles have to be avoided. While it makes perfect sense for\n> English, some languages may have to separate those words to sound or\n> even be correct.\n>\n> The attached patch demonstrates a change to achive that. I did not\n> test it because its purpose is only to raise awareness and start a\n> discussion about this topic. After all the question is, how important\n> translations are for a tool like Git. I have started a German\n> translation but many things are really hard to translate.\n\nI added the i18n support you're having problems with, and I completely\nagree that this is the sort of thing we need to do.\n\nUnfortunately when I added the i18n support I didn't have time to get\nrid of all these sentence puzzles (or, to put it another way \"lego\"\nsentences). You should never force translators to translate partial\nsentences, you should always provide them with full sentences that\nthey can translate completely, even if that means that there's some\nduplication for some languages.\n\nProblem reports like this one are exactly what we need at this point\nfor i18n, we need people spotting these issues, and then we can fix\nthem.\n"}]}