{"thread":{"id":"25023","subject":"[PATCH 00/20] [CONTINUE] Add gettext support to Git","startedAt":"2010-09-07T16:45:35Z","lastAt":"2010-09-10T23:21:25Z","messageCount":47,"participants":["Ævar Arnfjörð Bjarmason","Jonathan Nieder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":20},"messages":[{"id":"150219","messageId":"1283877955-19105-1-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":null,"subject":"[PATCH 00/20] [CONTINUE] Add gettext support to Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:45:35Z","receivedAt":"2010-09-07T16:45:35Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This series continues work where the already pulled ab/i18n series\n(now merged to pu) left off.\n\nIt can also be pulled from:\n\n    git://github.com/avar/git.git ab/i18n-continue\n    http://github.com/avar/git/compare/ab/i18n-in-git-2010-09-07...ab/i18n-continue\n    http://github.com/avar/git/compare/ab/i18n-in-git-2010-09-07...ab/i18n-continue.patch\n\nIt includes the first translation of a mainporcelain command written\nin shellscript (git-am). Comments on invividual patches below.\n\nÆvar Arnfjörð Bjarmason (20):\n  gettextize: git-clean clean.requireForce braces\n  gettextize: git-clone \"Cloning into\" message braces\n\nUnder GCC this warns under -Wall and will presumably break Junio's\n-Werror build. I didn't notice because I use clang which (IMO rightly)\ndoesn't complain about this.\n\n  po/de.po: make the German translation msgfmt --check clean\n\nWe'll see what ze Germans come up with translation wise, but meanwhile\nthis un-breaks the translation already in ab/i18n.\n\n  Makefile: add GNU_GETTEXT, set when we expect GNU gettext\n  Makefile: MSGFMT=\"msgfmt --check\" under GNU_GETTEXT\n\nAnd these two patches make sure that a translation will never break\nlike that again. Since msgfmt --check is a GNU-ism I needed to add\nsupport for GNU_GETTEXT=YesPlease in the Makefile.\n\nMaybe a check for this could be added to the configure.ac script, but\nI couldn't find a way to do so, and for the reasons explained in the\npatches I don't think it was worth my time.\n\n  Revert \"gettextize: git-revert mark the \"me\" variable for\n    translation\"\n\nRevert this as discussion on-list. Alternatively the \"gettextize:\ngit-revert mark the \"me\" variable for translation\" patch could be\nejected from the existing ab/i18n series.\n\n  gettextize: git-revert \"Your local changes\" message\n  gettextize: git-revert literal \"me\" messages\n\nDo The Right Thing when translating the \"me\" messsages.\n\n  gettext: add GETTEXT_POISON support for shell scripts\n  gettext: add GETTEXT_POISON tests for shell scripts\n\nWe need poison for .sh too to ensure sanity.\n\n  gettextize: git-am add git-sh-i18n\n  gettextize: git-am one-line gettext $msg; echo\n  gettextize: git-am multi-line getttext $msg; echo\n  gettextize: git-am eval_gettext messages\n  gettextize: git-am die messages\n  gettextize: git-am cannot_fallback messages\n\nNote: Isn't --check clean because the existing code indented with\nspaces.\n\n  gettextize: git-am clean_abort messages\n  gettextize: git-am \"Apply?\" message\n  gettextize: git-am core say messages\n  gettextize: git-am printf(1) message to eval_gettext\n\nAll these git-am patches are split up like this to make it easier to\nreview them, and to demonstrate the different sort of messages we'll\nhave to translate in the shell scripts.\n\nI won't sent commits quite so granular in the future (unless\nrequested).\n\n Makefile                     |   16 +++++++++\n builtin/clean.c              |    3 +-\n builtin/clone.c              |    3 +-\n builtin/revert.c             |   32 +++++++++++------\n git-am.sh                    |   68 +++++++++++++++++++-----------------\n git-sh-i18n.sh               |   77 +++++++++++++++++++++++++----------------\n po/de.po                     |   11 +++---\n t/t0201-gettext-fallbacks.sh |   12 +++---\n t/t0201-gettext-poison.sh    |   36 +++++++++++++++++++\n t/t4150-am.sh                |    4 ++-\n t/t4151-am-abort.sh          |    2 +-\n t/test-lib.sh                |    9 ++++-\n 12 files changed, 184 insertions(+), 89 deletions(-)\n create mode 100755 t/t0201-gettext-poison.sh\n\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150220","messageId":"1283877955-19105-2-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 01/20] gettextize: git-clean clean.requireForce braces","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:45:36Z","receivedAt":"2010-09-07T16:45:36Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Use braces around a nested if/if/else to appease GCC, which'll whine\nunder -Wall and \"suggest explicit braces to avoid ambiguous ‘else’\".\n\nThis code was originally added in \"gettextize: git-clean\nclean.requireForce messages\", and tested under clang (which doesn't\nwhine about perfectly valid uses of C).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clean.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 50ade84..52ec17a 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -77,13 +77,14 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \tif (ignored && ignored_only)\n \t\tdie(_(\"-x and -X cannot be used together\"));\n \n-\tif (!show_only && !force)\n+\tif (!show_only && !force) {\n \t\tif (config_set)\n \t\t\tdie(_(\"clean.requireForce set to true and neither -n nor -f given; \"\n \t\t\t\t  \"refusing to clean\"));\n \t\telse\n \t\t\tdie(_(\"clean.requireForce defaults to true and neither -n nor -f given; \"\n \t\t\t\t  \"refusing to clean\"));\n+\t}\n \n \tif (force > 1)\n \t\trm_flags = 0;\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150221","messageId":"1283877955-19105-3-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 02/20] gettextize: git-clone \"Cloning into\" message braces","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:45:37Z","receivedAt":"2010-09-07T16:45:37Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Use braces around a nested if/if/else to appease GCC, which'll whine\nunder -Wall and \"suggest explicit braces to avoid ambiguous ‘else’\".\n\nThis code was originally added in \"gettextize: git-clone \"Cloning\ninto\" message\", and tested under clang (which doesn't whine about\nperfectly valid uses of C).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/clone.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 7b0d104..1f10f3f 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -465,11 +465,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n-\tif (0 <= option_verbosity)\n+\tif (0 <= option_verbosity) {\n \t\tif (option_bare)\n \t\t\tprintf(_(\"Cloning into bare repository %s\"), dir);\n \t\telse\n \t\t\tprintf(_(\"Cloning into %s\"), dir);\n+\t}\n \tinit_db(option_template, INIT_DB_QUIET);\n \n \t/*\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150222","messageId":"1283878065-19349-1-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 04/20] Makefile: add GNU_GETTEXT, set when we expect GNU gettext","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:47:40Z","receivedAt":"2010-09-07T16:47:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a GNU_GETTEXT flag that's set to YesPlease by default everywhere\nbut on Solaris if the NO_GETTEXT flag isn't set.\n\nEveryone uses GNU gettext these days except Solaris developers, so\nhaving a dumb check for this that just depends on SunOS should be\nOK.\n\nI also don't plan to use this (for the time being) for anything that\nwould break if it isn't correctly set (e.g. if you're using GNU\nlibintl on Solaris), so I haven't added paranoid autoconf guards.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile |   12 ++++++++++++\n 1 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex f26fca3..3fe2e47 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -43,6 +43,11 @@ all::\n # on platforms where we don't expect glibc (Linux, Hurd,\n # GNU/kFreeBSD), which includes libintl.\n #\n+# Define GNU_GETTEXT if you're using the GNU implementation of\n+# libintl. We define this everywhere except on Solaris, which has its\n+# own gettext implementation. If GNU_GETTEXT is set we'll use GNU\n+# extensions like `msgfmt --check'.\n+#\n # Define GETTEXT_POISON to turn all strings that use gettext into\n # gibberish. This option should only be used by the Git developers to\n # check that the Git gettext implementation itself is sane.\n@@ -783,6 +788,10 @@ EXTLIBS =\n ifndef NO_GETTEXT\n \t# Systems that use GNU gettext and glibc are the exception\n \tNEEDS_LIBINTL = YesPlease\n+\n+\t# Systems that don't use GNU gettext are the exception. Only\n+\t# Solaris has a mature non-GNU gettext implementation.\n+\tGNU_GETTEXT = YesPlease\n endif\n \n # We choose to avoid \"if .. else if .. else .. endif endif\"\n@@ -872,6 +881,9 @@ ifeq ($(uname_S),SunOS)\n \tNO_MKDTEMP = YesPlease\n \tNO_MKSTEMPS = YesPlease\n \tNO_REGEX = YesPlease\n+ifndef NO_GETTEXT\n+\tGNU_GETTEXT =\n+endif\n \tifeq ($(uname_R),5.6)\n \t\tSOCKLEN_T = int\n \t\tNO_HSTRERROR = YesPlease\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150224","messageId":"1283878065-19349-2-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 05/20] Makefile: MSGFMT=\"msgfmt --check\" under GNU_GETTEXT","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:47:41Z","receivedAt":"2010-09-07T16:47:41Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"GNU msgfmt(1) supports the --check parameter which does various sanity\nchecks on the translated strings we're processing, including checks\nthat the printf(3) format of \"c-format\" translations matches the\noriginal. I.e. that a \"%s\" isn't missing, or that there aren't\nspurious or missing newlines in the translation.\n\nSince Solaris msgfmt(1) doesn't support --check we have to wrap this\nin `ifdef GNU_GETTEXT'.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3fe2e47..38ae13f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1523,6 +1523,10 @@ ifdef NEEDS_LIBINTL\n \tEXTLIBS += -lintl\n endif\n \n+ifdef GNU_GETTEXT\n+\tMSGFMT += --check\n+endif\n+\n ifdef GETTEXT_POISON\n \tCOMPAT_CFLAGS += -DGETTEXT_POISON\n endif\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150225","messageId":"1283878065-19349-3-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 06/20] Revert \"gettextize: git-revert mark the \"me\" variable for translation\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:47:42Z","receivedAt":"2010-09-07T16:47:42Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The `me' variable can be either \"revert\" or \"cherry-pick\". Some of\nthese should be translated, but it's used in too many different\ncontexts for the approach I initially took to be useful.\n\nReported-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 7157ee1..a93a5ba 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -553,9 +553,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \tstruct rev_info revs;\n \n \tgit_config(git_default_config, NULL);\n-\t/* TRANSLATORS: This is used in several error messages indicating\n-\t   the name of the current program */\n-\tme = action == REVERT ? N_(\"revert\") : N_(\"cherry-pick\");\n+\tme = action == REVERT ? \"revert\" : \"cherry-pick\";\n \tsetenv(GIT_REFLOG_ACTION, me, 0);\n \tparse_args(argc, argv);\n \n-- \n1.7.2.3.313.gcd15\n"},{"id":"150223","messageId":"1283878065-19349-4-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 07/20] gettextize: git-revert \"Your local changes\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:47:43Z","receivedAt":"2010-09-07T16:47:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate the \"Your local changes [...]\" message without using the\n`me' variable, instead split up the two messages so translators can\ntranslate the whole messages as-is.\n\nReported-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c |   18 +++++++++++++-----\n 1 files changed, 13 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex a93a5ba..ad2c76a 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -285,11 +285,19 @@ static NORETURN void die_dirty_index(const char *me)\n \tif (read_cache_unmerged()) {\n \t\tdie_resolve_conflict(me);\n \t} else {\n-\t\tif (advice_commit_before_merge)\n-\t\t\tdie(_(\"Your local changes would be overwritten by %s.\\n\"\n-\t\t\t    \"Please, commit your changes or stash them to proceed.\"), _(me));\n-\t\telse\n-\t\t\tdie(_(\"Your local changes would be overwritten by %s.\\n\"), _(me));\n+\t\tif (advice_commit_before_merge) {\n+\t\t\tif (action == REVERT)\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by revert.\\n\"\n+\t\t\t\t\t  \"Please, commit your changes or stash them to proceed.\"));\n+\t\t\telse\n+\t\t\t\tdie(_(\"Your local changes would be overwritten by cherry-pick.\\n\"\n+\t\t\t\t\t  \"Please, commit your changes or stash them to proceed.\"));\n+\t\t} else {\n+\t\t\tif (action == REVERT)\n+\t\t\t\tdie(\"Your local changes would be overwritten by revert.\\n\");\n+\t\t\telse\n+\t\t\t\tdie(\"Your local changes would be overwritten by cherry-pick.\\n\");\n+\t\t}\n \t}\n }\n \n-- \n1.7.2.3.313.gcd15\n"},{"id":"150232","messageId":"1283878065-19349-5-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 08/20] gettextize: git-revert literal \"me\" messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:47:44Z","receivedAt":"2010-09-07T16:47:44Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Redo the translation of the remaining messages that used the `me'\nvariable. These are all error messages referencing the command name,\nso the name shouldn't be translated.\n\nReported-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n builtin/revert.c |   10 +++++++---\n 1 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex ad2c76a..a89dd12 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -347,7 +347,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,\n \tif (active_cache_changed &&\n \t    (write_cache(index_fd, active_cache, active_nr) ||\n \t     commit_locked_index(&index_lock)))\n-\t\tdie(_(\"%s: Unable to write new index file\"), _(me));\n+\t\t/* TRANSLATORS: %s will be \"revert\" or \"cherry-pick\" */\n+\t\tdie(_(\"%s: Unable to write new index file\"), me);\n \trollback_lock_file(&index_lock);\n \n \tif (!clean) {\n@@ -454,8 +455,10 @@ static int do_pick_commit(void)\n \t\treturn fast_forward_to(commit->object.sha1, head);\n \n \tif (parent && parse_commit(parent) < 0)\n+\t\t/* TRANSLATORS: The first %s will be \"revert\" or\n+\t\t   \"cherry-pick\", the second %s a SHA1 */\n \t\tdie(_(\"%s: cannot parse parent commit %s\"),\n-\t\t    _(me), sha1_to_hex(parent->object.sha1));\n+\t\t    me, sha1_to_hex(parent->object.sha1));\n \n \tif (get_message(commit->buffer, &msg) != 0)\n \t\tdie(_(\"Cannot get commit message for %s\"),\n@@ -577,7 +580,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)\n \t}\n \n \tif (read_cache() < 0)\n-\t\tdie(_(\"git %s: failed to read the index\"), _(me));\n+\t\t/* TRANSLATORS: %s will be \"revert\" or \"cherry-pick\" */\n+\t\tdie(_(\"git %s: failed to read the index\"), me);\n \n \tprepare_revs(&revs);\n \n-- \n1.7.2.3.313.gcd15\n"},{"id":"150226","messageId":"1283878065-19349-6-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 09/20] gettext: add GETTEXT_POISON support for shell scripts","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:47:45Z","receivedAt":"2010-09-07T16:47:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Expand the existing GETTEXT_POISON=YesPlease support to support shell\nscripts. Analogous the existing C support this is needed to test that\nchanges to the output of the shell scripts don't break the plumbing\noutput.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-sh-i18n.sh               |   73 ++++++++++++++++++++++++++----------------\n t/t0201-gettext-fallbacks.sh |   12 +++---\n t/test-lib.sh                |    8 ++++-\n 3 files changed, 58 insertions(+), 35 deletions(-)\n\ndiff --git a/git-sh-i18n.sh b/git-sh-i18n.sh\nindex 698a000..b8b645a 100644\n--- a/git-sh-i18n.sh\n+++ b/git-sh-i18n.sh\n@@ -28,44 +28,61 @@ else\n fi\n export TEXTDOMAINDIR\n \n-if test -z \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\" && type gettext.sh >/dev/null 2>&1\n+if test -z \"$GIT_INTERNAL_GETTEXT_GETTEXT_POISON\"\n then\n-\t# This is GNU libintl's gettext.sh, we don't need to do anything\n-\t# else than setting up the environment and loading gettext.sh\n-\tGIT_INTERNAL_GETTEXT_SH_SCHEME=gnu\n-\texport GIT_INTERNAL_GETTEXT_SH_SCHEME\n+\tif test -z \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\" && type gettext.sh >/dev/null 2>&1\n+\tthen\n+\t\t# This is GNU libintl's gettext.sh, we don't need to do anything\n+\t\t# else than setting up the environment and loading gettext.sh\n+\t\tGIT_INTERNAL_GETTEXT_SH_SCHEME=gnu\n+\t\texport GIT_INTERNAL_GETTEXT_SH_SCHEME\n \n-\t# Try to use libintl's gettext.sh, or fall back to English if we\n-\t# can't.\n-\t. gettext.sh\n-elif test -z \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\" && test \"$(gettext -h 2>&1)\" = \"-h\"\n-then\n-\t# We don't have gettext.sh, but there's a gettext binary in our\n-\t# path. This is probably Solaris or something like it which has a\n-\t# gettext implementation that isn't GNU libintl.\n-\tGIT_INTERNAL_GETTEXT_SH_SCHEME=solaris\n-\texport GIT_INTERNAL_GETTEXT_SH_SCHEME\n+\t\t# Try to use libintl's gettext.sh, or fall back to English if we\n+\t\t# can't.\n+\t\t. gettext.sh\n+\telif test -z \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\" && test \"$(gettext -h 2>&1)\" = \"-h\"\n+\tthen\n+\t\t# We don't have gettext.sh, but there's a gettext binary in our\n+\t\t# path. This is probably Solaris or something like it which has a\n+\t\t# gettext implementation that isn't GNU libintl.\n+\t\tGIT_INTERNAL_GETTEXT_SH_SCHEME=solaris\n+\t\texport GIT_INTERNAL_GETTEXT_SH_SCHEME\n \n-\t# Solaris has a gettext(1) but no eval_gettext(1)\n-\teval_gettext () {\n-\t\tgettext_out=$(gettext \"$1\")\n-\t\tgettext_eval=\"printf '%s' \\\"$gettext_out\\\"\"\n-\t\tprintf \"%s\" \"`eval \\\"$gettext_eval\\\"`\"\n-\t}\n+\t\t# Solaris has a gettext(1) but no eval_gettext(1)\n+\t\teval_gettext () {\n+\t\t\tgettext_out=$(gettext \"$1\")\n+\t\t\tgettext_eval=\"printf '%s' \\\"$gettext_out\\\"\"\n+\t\t\tprintf \"%s\" \"`eval \\\"$gettext_eval\\\"`\"\n+\t\t}\n+\telse\n+\t\t# Since gettext.sh isn't available we'll have to define our own\n+\t\t# dummy pass-through functions.\n+\n+\t\t# Tell our tests that we don't have the real gettext.sh\n+\t\tGIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough\n+\t\texport GIT_INTERNAL_GETTEXT_SH_SCHEME\n+\n+\t\tgettext () {\n+\t\t\tprintf \"%s\" \"$1\"\n+\t\t}\n+\n+\t\teval_gettext () {\n+\t\t\tgettext_eval=\"printf '%s' \\\"$1\\\"\"\n+\t\t\tprintf \"%s\" \"`eval \\\"$gettext_eval\\\"`\"\n+\t\t}\n+\tfi\n else\n-\t# Since gettext.sh isn't available we'll have to define our own\n-\t# dummy pass-through functions.\n+\t# Emit garbage under GETTEXT_POISON=YesPlease. Unlike the C tests\n+\t# this relies on an environment variable\n \n-\t# Tell our tests that we don't have the real gettext.sh\n-\tGIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough\n+\tGIT_INTERNAL_GETTEXT_SH_SCHEME=poison\n \texport GIT_INTERNAL_GETTEXT_SH_SCHEME\n \n \tgettext () {\n-\t\tprintf \"%s\" \"$1\"\n+\t\tprintf \"%s\" \"# GETTEXT POISON #\"\n \t}\n \n \teval_gettext () {\n-\t\tgettext_eval=\"printf '%s' \\\"$1\\\"\"\n-\t\tprintf \"%s\" \"`eval \\\"$gettext_eval\\\"`\"\n+\t\tprintf \"%s\" \"# GETTEXT POISON #\"\n \t}\n fi\ndiff --git a/t/t0201-gettext-fallbacks.sh b/t/t0201-gettext-fallbacks.sh\nindex 47ce4f6..7a85d9b 100755\n--- a/t/t0201-gettext-fallbacks.sh\n+++ b/t/t0201-gettext-fallbacks.sh\n@@ -10,19 +10,19 @@ export GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\n \n . ./lib-gettext.sh\n \n-test_expect_success \"sanity: \\$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)\" '\n+test_expect_success NO_GETTEXT_POISON \"sanity: \\$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)\" '\n     test -n \"$GIT_INTERNAL_GETTEXT_SH_SCHEME\"\n '\n \n-test_expect_success 'sanity: $GIT_INTERNAL_GETTEXT_TEST_FALLBACKS is set' '\n+test_expect_success NO_GETTEXT_POISON 'sanity: $GIT_INTERNAL_GETTEXT_TEST_FALLBACKS is set' '\n     test -n \"$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\"\n '\n \n-test_expect_success 'sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME\" is fallthrough' '\n+test_expect_success NO_GETTEXT_POISON 'sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME\" is fallthrough' '\n     test \"$GIT_INTERNAL_GETTEXT_SH_SCHEME\" = \"fallthrough\"\n '\n \n-test_expect_success 'gettext: our gettext() fallback has pass-through semantics' '\n+test_expect_success NO_GETTEXT_POISON 'gettext: our gettext() fallback has pass-through semantics' '\n     printf \"test\" >expect &&\n     gettext \"test\" >actual &&\n     test_cmp expect actual &&\n@@ -31,7 +31,7 @@ test_expect_success 'gettext: our gettext() fallback has pass-through semantics'\n     test_cmp expect actual\n '\n \n-test_expect_success 'eval_gettext: our eval_gettext() fallback has pass-through semantics' '\n+test_expect_success NO_GETTEXT_POISON 'eval_gettext: our eval_gettext() fallback has pass-through semantics' '\n     printf \"test\" >expect &&\n     eval_gettext \"test\" >actual &&\n     test_cmp expect actual &&\n@@ -40,7 +40,7 @@ test_expect_success 'eval_gettext: our eval_gettext() fallback has pass-through\n     test_cmp expect actual\n '\n \n-test_expect_success 'eval_gettext: our eval_gettext() fallback can interpolate variables' '\n+test_expect_success NO_GETTEXT_POISON 'eval_gettext: our eval_gettext() fallback can interpolate variables' '\n     printf \"test YesPlease\" >expect &&\n     eval_gettext \"test \\$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS\" >actual &&\n     test_cmp expect actual\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b297ef6..5a9f989 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -963,7 +963,13 @@ esac\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PYTHON\" && test_set_prereq PYTHON\n test -z \"$NO_GETTEXT\" && test_set_prereq GETTEXT\n-test -z \"$GETTEXT_POISON\" && test_set_prereq NO_GETTEXT_POISON\n+if test -z \"$GETTEXT_POISON\"\n+then\n+\ttest_set_prereq NO_GETTEXT_POISON\n+else\n+\tGIT_INTERNAL_GETTEXT_GETTEXT_POISON=YesPlease\n+\texport GIT_INTERNAL_GETTEXT_GETTEXT_POISON\n+fi\n \n # test whether the filesystem supports symbolic links\n ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150228","messageId":"1283878113-19533-1-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 10/20] gettext: add GETTEXT_POISON tests for shell scripts","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:24Z","receivedAt":"2010-09-07T16:48:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Test the new GETTEXT_POISON=YesPlease support for shell scripts. This\ntest is derived from the existing t0201-gettext-fallbacks.sh test.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t0201-gettext-poison.sh |   36 ++++++++++++++++++++++++++++++++++++\n t/test-lib.sh             |    1 +\n 2 files changed, 37 insertions(+), 0 deletions(-)\n create mode 100755 t/t0201-gettext-poison.sh\n\ndiff --git a/t/t0201-gettext-poison.sh b/t/t0201-gettext-poison.sh\nnew file mode 100755\nindex 0000000..2361590\n--- /dev/null\n+++ b/t/t0201-gettext-poison.sh\n@@ -0,0 +1,36 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n+#\n+\n+test_description='Gettext Shell poison'\n+\n+. ./lib-gettext.sh\n+\n+test_expect_success GETTEXT_POISON \"sanity: \\$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)\" '\n+    test -n \"$GIT_INTERNAL_GETTEXT_SH_SCHEME\"\n+'\n+\n+test_expect_success GETTEXT_POISON 'sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME\" is poison' '\n+    test \"$GIT_INTERNAL_GETTEXT_SH_SCHEME\" = \"poison\"\n+'\n+\n+test_expect_success GETTEXT_POISON 'gettext: our gettext() fallback has poison semantics' '\n+    printf \"# GETTEXT POISON #\" >expect &&\n+    gettext \"test\" >actual &&\n+    test_cmp expect actual &&\n+    printf \"# GETTEXT POISON #\" >expect &&\n+    gettext \"test more words\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_expect_success GETTEXT_POISON 'eval_gettext: our eval_gettext() fallback has poison semantics' '\n+    printf \"# GETTEXT POISON #\" >expect &&\n+    eval_gettext \"test\" >actual &&\n+    test_cmp expect actual &&\n+    printf \"# GETTEXT POISON #\" >expect &&\n+    eval_gettext \"test more words\" >actual &&\n+    test_cmp expect actual\n+'\n+\n+test_done\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 5a9f989..48e1256 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -967,6 +967,7 @@ if test -z \"$GETTEXT_POISON\"\n then\n \ttest_set_prereq NO_GETTEXT_POISON\n else\n+\ttest_set_prereq GETTEXT_POISON\n \tGIT_INTERNAL_GETTEXT_GETTEXT_POISON=YesPlease\n \texport GIT_INTERNAL_GETTEXT_GETTEXT_POISON\n fi\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150227","messageId":"1283878113-19533-2-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 11/20] gettextize: git-am add git-sh-i18n","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:25Z","receivedAt":"2010-09-07T16:48:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Source git-sh-i18n in git-am.sh, it's needed to import the Git gettext\nshell functions.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex e7f008c..a7185d9 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -37,6 +37,7 @@ rerere-autoupdate update the index with reused conflict resolution if possible\n rebasing*       (internal use for git-rebase)\"\n \n . git-sh-setup\n+. git-sh-i18n\n prefix=$(git rev-parse --show-prefix)\n set_reflog_action am\n require_work_tree\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150229","messageId":"1283878113-19533-3-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 12/20] gettextize: git-am one-line gettext $msg; echo","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:26Z","receivedAt":"2010-09-07T16:48:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"One-line `gettext $msg; echo' messages are the simplest use case for\ngettext(1).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex a7185d9..bd04a15 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -93,7 +93,7 @@ go_next () {\n \n cannot_fallback () {\n \techo \"$1\"\n-\techo \"Cannot fall back to three-way merge.\"\n+\tgettext \"Cannot fall back to three-way merge.\"; echo\n \texit 1\n }\n \n@@ -629,7 +629,7 @@ do\n \n \tif test -z \"$GIT_AUTHOR_EMAIL\"\n \tthen\n-\t\techo \"Patch does not have a valid e-mail address.\"\n+\t\tgettext \"Patch does not have a valid e-mail address.\"; echo\n \t\tstop_here $this\n \tfi\n \n@@ -680,7 +680,7 @@ do\n \t    action=again\n \t    while test \"$action\" = again\n \t    do\n-\t\techo \"Commit Body is:\"\n+\t\tgettext \"Commit Body is:\"; echo\n \t\techo \"--------------------------\"\n \t\tcat \"$dotest/final-commit\"\n \t\techo \"--------------------------\"\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150230","messageId":"1283878113-19533-4-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 13/20] gettextize: git-am multi-line getttext $msg; echo","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:27Z","receivedAt":"2010-09-07T16:48:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"When we have multi-line `gettext $msg; echo' messages we can't\npreserve the existing indenting because gettext(1) can't accept input\non stdin.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex bd04a15..73a4046 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -741,16 +741,16 @@ do\n \t\t# working tree.\n \t\tresolved=\n \t\tgit diff-index --quiet --cached HEAD -- && {\n-\t\t\techo \"No changes - did you forget to use 'git add'?\"\n-\t\t\techo \"If there is nothing left to stage, chances are that something else\"\n-\t\t\techo \"already introduced the same changes; you might want to skip this patch.\"\n+\t\t\tgettext \"No changes - did you forget to use 'git add'?\n+If there is nothing left to stage, chances are that something else\n+already introduced the same changes; you might want to skip this patch.\"; echo\n \t\t\tstop_here_user_resolve $this\n \t\t}\n \t\tunmerged=$(git ls-files -u)\n \t\tif test -n \"$unmerged\"\n \t\tthen\n-\t\t\techo \"You still have unmerged paths in your index\"\n-\t\t\techo \"did you forget to use 'git add'?\"\n+\t\t\tgettext \"You still have unmerged paths in your index\n+did you forget to use 'git add'?\"; echo\n \t\t\tstop_here_user_resolve $this\n \t\tfi\n \t\tapply_status=0\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150237","messageId":"1283878113-19533-5-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 14/20] gettextize: git-am eval_gettext messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:28Z","receivedAt":"2010-09-07T16:48:28Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Messages that use variables to be interpolated need to use\neval_gettext(), this wrapper will eval the message and expand the\nvariable for us.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 73a4046..98819e6 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -77,9 +77,9 @@ stop_here_user_resolve () {\n \t    printf '%s\\n' \"$resolvemsg\"\n \t    stop_here $1\n     fi\n-    echo \"When you have resolved this problem run \\\"$cmdline --resolved\\\".\"\n-    echo \"If you would prefer to skip this patch, instead run \\\"$cmdline --skip\\\".\"\n-    echo \"To restore the original branch and stop patching run \\\"$cmdline --abort\\\".\"\n+    eval_gettext \"When you have resolved this problem run \\\"\\$cmdline --resolved\\\".\n+If you would prefer to skip this patch, instead run \\\"\\$cmdline --skip\\\".\n+To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"; echo\n \n     stop_here $1\n }\n@@ -592,9 +592,9 @@ do\n \t\t\tgo_next && continue\n \n \t\ttest -s \"$dotest/patch\" || {\n-\t\t\techo \"Patch is empty.  Was it split wrong?\"\n-\t\t\techo \"If you would prefer to skip this patch, instead run \\\"$cmdline --skip\\\".\"\n-\t\t\techo \"To restore the original branch and stop patching run \\\"$cmdline --abort\\\".\"\n+\t\t\teval_gettext \"Patch is empty.  Was it split wrong?\n+If you would prefer to skip this patch, instead run \\\"\\$cmdline --skip\\\".\n+To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"; echo\n \t\t\tstop_here $this\n \t\t}\n \t\trm -f \"$dotest/original-commit\" \"$dotest/author-script\"\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150234","messageId":"1283878113-19533-6-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 15/20] gettextize: git-am die messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:29Z","receivedAt":"2010-09-07T16:48:29Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The die messages in git-am need to use:\n\n    die \"$(gettext \"string\")\"\n\nSince gettext(1) emits the message instead of returning it like the C\nequivalent, and our die() function in git-sh-setup needs to get a\nstring as an argument.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 98819e6..4bee325 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -44,7 +44,7 @@ require_work_tree\n cd_to_toplevel\n \n git var GIT_COMMITTER_IDENT >/dev/null ||\n-\tdie \"You need to set your committer info first\"\n+\tdie \"$(gettext \"You need to set your committer info first\")\"\n \n if git rev-parse --verify -q HEAD >/dev/null\n then\n@@ -337,7 +337,7 @@ do\n \t--rebasing)\n \t\trebasing=t threeway=t keep=t scissors=f no_inbody_headers=t ;;\n \t-d|--dotest)\n-\t\tdie \"-d option is no longer supported.  Do not use.\"\n+\t\tdie \"$(gettext \"-d option is no longer supported.  Do not use.\")\"\n \t\t;;\n \t--resolvemsg)\n \t\tshift; resolvemsg=$1 ;;\n@@ -400,12 +400,12 @@ then\n \t\tfalse\n \t\t;;\n \tesac ||\n-\tdie \"previous rebase directory $dotest still exists but mbox given.\"\n+\tdie \"$(eval_gettext \"previous rebase directory \\$dotest still exists but mbox given.\")\"\n \tresume=yes\n \n \tcase \"$skip,$abort\" in\n \tt,t)\n-\t\tdie \"Please make up your mind. --skip or --abort?\"\n+\t\tdie \"$(gettext \"Please make up your mind. --skip or --abort?\")\"\n \t\t;;\n \tt,)\n \t\tgit rerere clear\n@@ -431,7 +431,7 @@ then\n else\n \t# Make sure we are not given --skip, --resolved, nor --abort\n \ttest \"$skip$resolved$abort\" = \"\" ||\n-\t\tdie \"Resolve operation not in progress, we are not resuming.\"\n+\t\tdie \"$(gettext \"Resolve operation not in progress, we are not resuming.\")\"\n \n \t# Start afresh.\n \tmkdir -p \"$dotest\" || exit\n@@ -496,7 +496,7 @@ case \"$resolved\" in\n \tif test \"$files\"\n \tthen\n \t\ttest -n \"$HAS_HEAD\" && : >\"$dotest/dirtyindex\"\n-\t\tdie \"Dirty index: cannot apply patches (dirty: $files)\"\n+\t\tdie \"$(eval_gettext \"Dirty index: cannot apply patches (dirty: \\$files)\")\"\n \tfi\n esac\n \n@@ -676,7 +676,7 @@ To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"; ec\n \tif test \"$interactive\" = t\n \tthen\n \t    test -t 0 ||\n-\t    die \"cannot be interactive without stdin connected to a terminal.\"\n+\t    die \"$(gettext \"cannot be interactive without stdin connected to a terminal.\")\"\n \t    action=again\n \t    while test \"$action\" = again\n \t    do\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150235","messageId":"1283878113-19533-7-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 16/20] gettextize: git-am cannot_fallback messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:30Z","receivedAt":"2010-09-07T16:48:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Translate messages with gettext(1) before they're passed to the\ncannot_fallback function, just like we handle the die function.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 4bee325..8e894e5 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -108,7 +108,7 @@ fall_back_3way () {\n \t\"$dotest/patch\" &&\n     GIT_INDEX_FILE=\"$dotest/patch-merge-tmp-index\" \\\n     git write-tree >\"$dotest/patch-merge-base+\" ||\n-    cannot_fallback \"Repository lacks necessary blobs to fall back on 3-way merge.\"\n+    cannot_fallback \"$(gettext \"Repository lacks necessary blobs to fall back on 3-way merge.\")\"\n \n     say Using index info to reconstruct a base tree...\n     if GIT_INDEX_FILE=\"$dotest/patch-merge-tmp-index\" \\\n@@ -117,8 +117,8 @@ fall_back_3way () {\n \tmv \"$dotest/patch-merge-base+\" \"$dotest/patch-merge-base\"\n \tmv \"$dotest/patch-merge-tmp-index\" \"$dotest/patch-merge-index\"\n     else\n-        cannot_fallback \"Did you hand edit your patch?\n-It does not apply to blobs recorded in its index.\"\n+        cannot_fallback \"$(gettext \"Did you hand edit your patch?\n+It does not apply to blobs recorded in its index.\")\"\n     fi\n \n     test -f \"$dotest/patch-merge-index\" &&\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150233","messageId":"1283878113-19533-8-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 17/20] gettextize: git-am clean_abort messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:31Z","receivedAt":"2010-09-07T16:48:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Messages that used the clean_abort function needed both gettext(1) and\neval_gettext(). These need to be interpolated in a string like the die\nand cannot_fallback messages.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 8e894e5..3403267 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -233,7 +233,7 @@ split_patches () {\n \tstgit-series)\n \t\tif test $# -ne 1\n \t\tthen\n-\t\t\tclean_abort \"Only one StGIT patch series can be applied at once\"\n+\t\t\tclean_abort \"$(gettext \"Only one StGIT patch series can be applied at once\")\"\n \t\tfi\n \t\tseries_dir=`dirname \"$1\"`\n \t\tseries_file=\"$1\"\n@@ -285,9 +285,9 @@ split_patches () {\n \t\t;;\n \t*)\n \t\tif test -n \"$parse_patch\" ; then\n-\t\t\tclean_abort \"Patch format $patch_format is not supported.\"\n+\t\t\tclean_abort \"$(eval_gettext \"Patch format \\$patch_format is not supported.\")\"\n \t\telse\n-\t\t\tclean_abort \"Patch format detection failed.\"\n+\t\t\tclean_abort \"$(gettext \"Patch format detection failed.\")\"\n \t\tfi\n \t\t;;\n \tesac\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150236","messageId":"1283878113-19533-9-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 18/20] gettextize: git-am \"Apply?\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:32Z","receivedAt":"2010-09-07T16:48:32Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the \"Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all\" message\ntranslatable, and leave a note in a TRANSLATORS comment explaining\nthat translators have to preserve a mention of the y/n/e/v/a\ncharacters since the program will expect them, and not their\nlocalized equivalents.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 3403267..90f2a9d 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -684,7 +684,10 @@ To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"; ec\n \t\techo \"--------------------------\"\n \t\tcat \"$dotest/final-commit\"\n \t\techo \"--------------------------\"\n-\t\tprintf \"Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all \"\n+\t\t# TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]\n+\t\t# in your translation. The program will only accept English\n+\t\t# input at this point.\n+\t\tgettext \"Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all \"\n \t\tread reply\n \t\tcase \"$reply\" in\n \t\t[yY]*) action=yes ;;\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150231","messageId":"1283878113-19533-10-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 19/20] gettextize: git-am core say messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:48:33Z","receivedAt":"2010-09-07T16:48:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the core git-am messages that use say() translatable. These are\nvisible on almost every git am invocation.\n\nThere are tests that depend on the \"Applying\" output that need to be\nskipped along with this translation.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh           |    6 +++---\n t/t4150-am.sh       |    4 +++-\n t/t4151-am-abort.sh |    2 +-\n 3 files changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 90f2a9d..6992d92 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -723,7 +723,7 @@ To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"; ec\n \t\tstop_here $this\n \tfi\n \n-\tsay \"Applying: $FIRSTLINE\"\n+\tsay \"$(eval_gettext \"Applying: \\$FIRSTLINE\")\"\n \n \tcase \"$resolved\" in\n \t'')\n@@ -768,7 +768,7 @@ did you forget to use 'git add'?\"; echo\n \t\t    # Applying the patch to an earlier tree and merging the\n \t\t    # result may have produced the same tree as ours.\n \t\t    git diff-index --quiet --cached HEAD -- && {\n-\t\t\tsay No changes -- Patch already applied.\n+\t\t\tsay \"$(gettext \"No changes -- Patch already applied.\")\"\n \t\t\tgo_next\n \t\t\tcontinue\n \t\t    }\n@@ -794,7 +794,7 @@ did you forget to use 'git add'?\"; echo\n \t\t\tGIT_AUTHOR_DATE=\n \t\tfi\n \t\tparent=$(git rev-parse --verify -q HEAD) ||\n-\t\tsay >&2 \"applying to an empty history\"\n+\t\tsay >&2 \"$(gettext \"applying to an empty history\")\"\n \n \t\tif test -n \"$committer_date_is_author_date\"\n \t\tthen\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 1c3d8ed..59ba994 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -464,7 +464,9 @@ test_expect_success 'am newline in subject' '\n \tgit checkout first &&\n \ttest_tick &&\n \tsed -e \"s/second/second \\\\\\n foo/\" patch1 >patchnl &&\n-\tgit am <patchnl >output.out 2>&1 &&\n+\tgit am <patchnl >output.out 2>&1'\n+\n+test_expect_success NO_GETTEXT_POISON 'output: am newline in subject' '\n \tgrep \"^Applying: second \\\\\\n foo$\" output.out\n '\n \ndiff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh\nindex b55c411..5bb24f8 100755\n--- a/t/t4151-am-abort.sh\n+++ b/t/t4151-am-abort.sh\n@@ -43,7 +43,7 @@ do\n \t\ttest_cmp expect actual\n \t'\n \n-\ttest_expect_success \"am$with3 --skip continue after failed am$with3\" '\n+\ttest_expect_success NO_GETTEXT_POISON \"am$with3 --skip continue after failed am$with3\" '\n \t\ttest_must_fail git am$with3 --skip >output &&\n \t\ttest \"$(grep \"^Applying\" output)\" = \"Applying: 6\" &&\n \t\ttest_cmp file-2-expect file-2 &&\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150238","messageId":"1283878224-20202-1-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH 20/20] gettextize: git-am printf(1) message to eval_gettext","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T16:50:24Z","receivedAt":"2010-09-07T16:50:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Convert a message that used printf(1) format to use eval_gettext. It's\neasier for translators to handle the latter, since the eval format\nautomatically gives them context via variable names.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-am.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 6992d92..a13d488 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -778,7 +778,7 @@ did you forget to use 'git add'?\"; echo\n \tfi\n \tif test $apply_status != 0\n \tthen\n-\t\tprintf 'Patch failed at %s %s\\n' \"$msgnum\" \"$FIRSTLINE\"\n+\t\techo \"$(eval_gettext \"Patch failed at \\$msgnum \\$FIRSTLINE\")\"\n \t\tstop_here_user_resolve $this\n \tfi\n \n-- \n1.7.2.3.313.gcd15\n"},{"id":"150248","messageId":"AANLkTim_ovWkPPepB7xRez5DTmJRTrFoZWG+Nx0_O=oL@mail.gmail.com","threadId":"25023","inReplyTo":"1283878224-20202-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 20/20] gettextize: git-am printf(1) message to eval_gettext","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-07T20:10:50Z","receivedAt":"2010-09-07T20:10:50Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nÆvar Arnfjörð Bjarmason wrote:\n\n> +++ b/git-am.sh\n> @@ -778,7 +778,7 @@ did you forget to use 'git add'?\"; echo\n>        fi\n>        if test $apply_status != 0\n>        then\n> -               printf 'Patch failed at %s %s\\n' \"$msgnum\" \"$FIRSTLINE\"\n> +               echo \"$(eval_gettext \"Patch failed at \\$msgnum \\$FIRSTLINE\")\"\n\nProbably I am missing something silly, but why not just:\n\n        eval_gettext 'Patch failed at $msgnum $FIRSTLINE\\n'\n\n? I ask because it is nice to be able to avoid \"echo\" with arbitrary\ndata: special characters (e.g. \\) can make for portability hassles.\n\nJonathan\n"},{"id":"150250","messageId":"AANLkTimDofOpfOrFisvP-1+qn1DYuk1oq2anjUcCHQw6@mail.gmail.com","threadId":"25023","inReplyTo":"AANLkTim_ovWkPPepB7xRez5DTmJRTrFoZWG+Nx0_O=oL@mail.gmail.com","subject":"Re: [PATCH 20/20] gettextize: git-am printf(1) message to eval_gettext","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T20:29:03Z","receivedAt":"2010-09-07T20:29:03Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Sep 7, 2010 at 20:10, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Hi,\n>\n> Ævar Arnfjörð Bjarmason wrote:\n>\n>> +++ b/git-am.sh\n>> @@ -778,7 +778,7 @@ did you forget to use 'git add'?\"; echo\n>>        fi\n>>        if test $apply_status != 0\n>>        then\n>> -               printf 'Patch failed at %s %s\\n' \"$msgnum\" \"$FIRSTLINE\"\n>> +               echo \"$(eval_gettext \"Patch failed at \\$msgnum \\$FIRSTLINE\")\"\n>\n> Probably I am missing something silly, but why not just:\n>\n>        eval_gettext 'Patch failed at $msgnum $FIRSTLINE\\n'\n\nThat looks better, or:\n\n    eval_gettext 'Patch failed at $msgnum $FIRSTLINE'; echo\n\nTo remove the change for translators to screw up the \\n, the gettext\nmanual uses that style.\n\nIt also uses double quotes consistently, but '' works fine too. I\ndon't know if '' should be avoided for some other reason, probably\nnot.\n\n> ? I ask because it is nice to be able to avoid \"echo\" with arbitrary\n> data: special characters (e.g. \\) can make for portability hassles.\n\nAside from this example (which looks nicer as you suggest) we'd be in\nsome slight trouble if the code in the patch is unportable, since I\nthink I'm using equivalent constructions elsewhere to thinks that get\npassed to echo, but maybe that's not a problem if there's a level of\nindirection.\n\nIn any case we could solve those with printf \"%s\" $str.\n"},{"id":"150251","messageId":"AANLkTim1+BSZJt-LBkytXJvYujd8zhNeZCu29752P63G@mail.gmail.com","threadId":"25023","inReplyTo":"AANLkTimDofOpfOrFisvP-1+qn1DYuk1oq2anjUcCHQw6@mail.gmail.com","subject":"Re: [PATCH 20/20] gettextize: git-am printf(1) message to eval_gettext","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-07T20:32:40Z","receivedAt":"2010-09-07T20:32:40Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n\n> In any case we could solve those with printf \"%s\" $str.\n\nIn general\n\n printf \"%s\\n\" \"$str\"\n\nis more reliable than\n\n echo \"$str\"\n\n, yes.  See <http://www.opengroup.org/onlinepubs/9699919799/utilities/echo.html>.\n"},{"id":"150252","messageId":"1283892319-28958-1-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"[PATCH v2 19/20] gettextize: git-am core say messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T20:45:19Z","receivedAt":"2010-09-07T20:45:19Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Make the core git-am messages that use say() translatable. These are\nvisible on almost every git am invocation.\n\nThere are tests that depend on the \"Applying\" output that need to be\nskipped along with this translation.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nFix for a trivial coding style issue:\n    \n    -+      git am <patchnl >output.out 2>&1'\n    ++      git am <patchnl >output.out 2>&1\n    ++'\n\n git-am.sh           |    6 +++---\n t/t4150-am.sh       |    5 ++++-\n t/t4151-am-abort.sh |    2 +-\n 3 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 90f2a9d..6992d92 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -723,7 +723,7 @@ To restore the original branch and stop patching run \\\"\\$cmdline --abort\\\".\"; ec\n \t\tstop_here $this\n \tfi\n \n-\tsay \"Applying: $FIRSTLINE\"\n+\tsay \"$(eval_gettext \"Applying: \\$FIRSTLINE\")\"\n \n \tcase \"$resolved\" in\n \t'')\n@@ -768,7 +768,7 @@ did you forget to use 'git add'?\"; echo\n \t\t    # Applying the patch to an earlier tree and merging the\n \t\t    # result may have produced the same tree as ours.\n \t\t    git diff-index --quiet --cached HEAD -- && {\n-\t\t\tsay No changes -- Patch already applied.\n+\t\t\tsay \"$(gettext \"No changes -- Patch already applied.\")\"\n \t\t\tgo_next\n \t\t\tcontinue\n \t\t    }\n@@ -794,7 +794,7 @@ did you forget to use 'git add'?\"; echo\n \t\t\tGIT_AUTHOR_DATE=\n \t\tfi\n \t\tparent=$(git rev-parse --verify -q HEAD) ||\n-\t\tsay >&2 \"applying to an empty history\"\n+\t\tsay >&2 \"$(gettext \"applying to an empty history\")\"\n \n \t\tif test -n \"$committer_date_is_author_date\"\n \t\tthen\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 1c3d8ed..373d79b 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -464,7 +464,10 @@ test_expect_success 'am newline in subject' '\n \tgit checkout first &&\n \ttest_tick &&\n \tsed -e \"s/second/second \\\\\\n foo/\" patch1 >patchnl &&\n-\tgit am <patchnl >output.out 2>&1 &&\n+\tgit am <patchnl >output.out 2>&1\n+'\n+\n+test_expect_success NO_GETTEXT_POISON 'output: am newline in subject' '\n \tgrep \"^Applying: second \\\\\\n foo$\" output.out\n '\n \ndiff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh\nindex b55c411..5bb24f8 100755\n--- a/t/t4151-am-abort.sh\n+++ b/t/t4151-am-abort.sh\n@@ -43,7 +43,7 @@ do\n \t\ttest_cmp expect actual\n \t'\n \n-\ttest_expect_success \"am$with3 --skip continue after failed am$with3\" '\n+\ttest_expect_success NO_GETTEXT_POISON \"am$with3 --skip continue after failed am$with3\" '\n \t\ttest_must_fail git am$with3 --skip >output &&\n \t\ttest \"$(grep \"^Applying\" output)\" = \"Applying: 6\" &&\n \t\ttest_cmp file-2-expect file-2 &&\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150253","messageId":"1283892381-29826-1-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"1283878224-20202-1-git-send-email-avarab@gmail.com","subject":"[PATCH v2 20/20] gettextize: git-am printf(1) message to eval_gettext","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-07T20:46:21Z","receivedAt":"2010-09-07T20:46:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Convert a message that used printf(1) format to use eval_gettext. It's\neasier for translators to handle the latter, since the eval format\nautomatically gives them context via variable names.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nUse eval_gettext directly as suggested by Jonathan Nieder.\n\n git-am.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 6992d92..bf0258d 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -778,7 +778,7 @@ did you forget to use 'git add'?\"; echo\n \tfi\n \tif test $apply_status != 0\n \tthen\n-\t\tprintf 'Patch failed at %s %s\\n' \"$msgnum\" \"$FIRSTLINE\"\n+\t\teval_gettext 'Patch failed at $msgnum $FIRSTLINE'; echo\n \t\tstop_here_user_resolve $this\n \tfi\n \n-- \n1.7.2.3.313.gcd15\n"},{"id":"150309","messageId":"7vd3sonq2n.fsf@alter.siamese.dyndns.org","threadId":"25023","inReplyTo":"1283877955-19105-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 00/20] [CONTINUE] Add gettext support to Git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-08T16:43:44Z","receivedAt":"2010-09-08T16:43:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I've done\n\n    git fetch git://github.com/avar/git +ab/i18n-all-continue:ab/i18n\n\nand rebuilt 'pu' with it (I am not quite ready to push the results out,\nthough).\n\nPlease squash in the following to appropriate patches in the series.\nThanks.\n\n-- >8 --\nFrom: Junio C Hamano <gitster@pobox.com>\nDate: Wed, 8 Sep 2010 09:33:18 -0700\nSubject: [PATCH] Style fixups: explicitly disambiguate nested if/if/else correspondence\n\nWrite {} to let the compiler know that we know what we are doing, like\nthis, when writing a nested if/if/else:\n\n    if (...) {\n        if (...)\n\t    ...\n\telse\n\t    ...\n    }\n\nThe programmer who writes the code like the above without the outermost {}\nmay know that \"else\" corresponds to the innermost \"if\", but it will keep\nthings easier and safer while reviewing patches that build on top of code\nlike this.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/clean.c |    3 ++-\n builtin/clone.c |    3 ++-\n 2 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 642d767..e1694c0 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -77,13 +77,14 @@ int cmd_clean(int argc, const char **argv, const char *prefix)\n \tif (ignored && ignored_only)\n \t\tdie(_(\"-x and -X cannot be used together\"));\n \n-\tif (!show_only && !force)\n+\tif (!show_only && !force) {\n \t\tif (config_set)\n \t\t\tdie(_(\"clean.requireForce set to true and neither -n nor -f given; \"\n \t\t\t\t  \"refusing to clean\"));\n \t\telse\n \t\t\tdie(_(\"clean.requireForce defaults to true and neither -n nor -f given; \"\n \t\t\t\t  \"refusing to clean\"));\n+\t}\n \n \tif (force > 1)\n \t\trm_flags = 0;\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 7b0d104..1f10f3f 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -465,11 +465,12 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tdie(_(\"could not create leading directories of '%s'\"), git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n-\tif (0 <= option_verbosity)\n+\tif (0 <= option_verbosity) {\n \t\tif (option_bare)\n \t\t\tprintf(_(\"Cloning into bare repository %s\"), dir);\n \t\telse\n \t\t\tprintf(_(\"Cloning into %s\"), dir);\n+\t}\n \tinit_db(option_template, INIT_DB_QUIET);\n \n \t/*\n-- \n1.7.3.rc0.183.gb0497\n"},{"id":"150334","messageId":"AANLkTinC59XFt8pPyUF3ifMTeVMSC1e44MDPto5Fy1+n@mail.gmail.com","threadId":"25023","inReplyTo":"7vd3sonq2n.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 00/20] [CONTINUE] Add gettext support to Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-08T23:32:45Z","receivedAt":"2010-09-08T23:32:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Sep 8, 2010 at 16:43, Junio C Hamano <gitster@pobox.com> wrote:\n> I've done\n>\n>    git fetch git://github.com/avar/git +ab/i18n-all-continue:ab/i18n\n>\n> and rebuilt 'pu' with it (I am not quite ready to push the results out,\n> though).\n>\n> Please squash in the following to appropriate patches in the series.\n> Thanks.\n\nThanks, those fixes were actually already part of the series, but I\nhadn't squashed those yet.\n\nI've gone ahead and done so:\n\n    pick 8e9b49d gettextize: git-clone \"Cloning into\" message\n    fixup 73f08a1 gettextize: git-clone \"Cloning into\" message braces\n\nand:\n\n    pick 8e9b49d gettextize: git-clone \"Cloning into\" message\n    fixup 73f08a1 gettextize: git-clone \"Cloning into\" message braces\n\nI've also fixed up the whole mess with the \"me\" messages. I.e. dropped\nthe revert commits and just fixed the originals so they make sense in\nthe first place.\n"},{"id":"150433","messageId":"AANLkTimU6Cznnqp+SokZDK7fnhV712a9QcAAd5peo93m@mail.gmail.com","threadId":"25023","inReplyTo":"AANLkTinC59XFt8pPyUF3ifMTeVMSC1e44MDPto5Fy1+n@mail.gmail.com","subject":"Re: [PATCH 00/20] [CONTINUE] Add gettext support to Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T12:00:43Z","receivedAt":"2010-09-10T12:00:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Sep 8, 2010 at 23:32, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> On Wed, Sep 8, 2010 at 16:43, Junio C Hamano <gitster@pobox.com> wrote:\n>> I've done\n>>\n>>    git fetch git://github.com/avar/git +ab/i18n-all-continue:ab/i18n\n>>\n>> and rebuilt 'pu' with it (I am not quite ready to push the results out,\n>> though).\n>>\n>> Please squash in the following to appropriate patches in the series.\n>> Thanks.\n>\n> Thanks, those fixes were actually already part of the series, but I\n> hadn't squashed those yet.\n>\n> I've gone ahead and done so:\n>\n>    pick 8e9b49d gettextize: git-clone \"Cloning into\" message\n>    fixup 73f08a1 gettextize: git-clone \"Cloning into\" message braces\n>\n> and:\n>\n>    pick 8e9b49d gettextize: git-clone \"Cloning into\" message\n>    fixup 73f08a1 gettextize: git-clone \"Cloning into\" message braces\n>\n> I've also fixed up the whole mess with the \"me\" messages. I.e. dropped\n> the revert commits and just fixed the originals so they make sense in\n> the first place.\n\nHi, since you didn't pick this up in the last push I fixed it up a bit\nmore.\n\nI rebased ab/i18n-all-continue on the new master:\n\n    git fetch git://github.com/avar/git +ab/i18n-all-continue:ab/i18n\n\nBut you probably want this instead:\n\n    git fetch git://github.com/avar/git +ab/i18n-all-continue-with-hindi:ab/i18n\n\nI took the liberty of adding Ramkumar Ramachandra's hi.po patch to the\nseries.\n\nIt also doesn't have your \"Style fixups: explicitly disambiguate\nnested if/if/else correspondence\" commit since I fixed that in my\ncopy, and fixes the \"me\" issues by rewriting some old commits.\n"},{"id":"150443","messageId":"7vaanpio4n.fsf@alter.siamese.dyndns.org","threadId":"25023","inReplyTo":"AANLkTimU6Cznnqp+SokZDK7fnhV712a9QcAAd5peo93m@mail.gmail.com","subject":"Re: [PATCH 00/20] [CONTINUE] Add gettext support to Git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-10T16:01:28Z","receivedAt":"2010-09-10T16:01:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> Hi, since you didn't pick this up in the last push I fixed it up a bit\n> more.\n>\n> I rebased ab/i18n-all-continue on the new master:\n>\n>     git fetch git://github.com/avar/git +ab/i18n-all-continue:ab/i18n\n>\n> But you probably want this instead:\n>\n>     git fetch git://github.com/avar/git +ab/i18n-all-continue-with-hindi:ab/i18n\n>\n> I took the liberty of adding Ramkumar Ramachandra's hi.po patch to the\n> series.\n\nI think that the latter is \"i18n-continue-with-hindi\" (no \"all\"), and also\nsuspect that ab/i18n-all-continue either hasn't be pushed out or is stale?\n\nThe copy of \"all-continue\" I just fetched ends with 2b5170f (gettextize:\ngit-shortlog basic messages, 2010-09-05) while hindi^ is at c4adf2e\n(gettextize: git-am printf(1) message to eval_gettext, 2010-09-07).\n\nI haven't formed an opinion as to what to do with the *.po files after the\nseries hits 'next' (or anything more stable than 'pu'); my preference is\nto delegate that part of the system to somebody who volunteers as an i18n\ncoordinator, and pull from him/her from time to time, just like the way\ngitk and git-gui are managed.\n\nFor now, I'll queue the whole thing and merge that to 'pu', but we would\nwant to squash l10n commits after (but not including) 8d65a35 (gettext\ntests: test re-encoding with a UTF-8 msgid under Shell, 2010-08-30) that\ntouch only one file in po/*.po into one commit per language, move them\nnear the tip after all the infrastructure enhancements (and fix-ups to the\ninfrastructure, if necessary) and individual command i18ns, to make the\nend result a reasonably complete and clean \"first cut for public testing\"\nof the series before it hits 'next'.\n\nAs a companion update to 6495411 (gettext docs: add po/README file\ndocumenting Git's gettext, 2010-09-03), we would need a file in\nDocumentation/ directory to describe the use of _() and N_() for\nprogrammers and point it from CodingGuidelines.  We might also want to\nmove po/README to Documentation/ but I don't have strong preference either\nway.\n\nThanks.\n"},{"id":"150455","messageId":"AANLkTikdHZFmXAdABvS9hPXtbXNJU5NdCOrw5_KP73bX@mail.gmail.com","threadId":"25023","inReplyTo":"7vaanpio4n.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 00/20] [CONTINUE] Add gettext support to Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T17:17:02Z","receivedAt":"2010-09-10T17:17:02Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Sep 10, 2010 at 16:01, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>> Hi, since you didn't pick this up in the last push I fixed it up a bit\n>> more.\n>>\n>> I rebased ab/i18n-all-continue on the new master:\n>>\n>>     git fetch git://github.com/avar/git +ab/i18n-all-continue:ab/i18n\n>>\n>> But you probably want this instead:\n>>\n>>     git fetch git://github.com/avar/git +ab/i18n-all-continue-with-hindi:ab/i18n\n>>\n>> I took the liberty of adding Ramkumar Ramachandra's hi.po patch to the\n>> series.\n>\n> I think that the latter is \"i18n-continue-with-hindi\" (no \"all\")\n\nYes, sorry. It's just \"ab/i18n-continue-with-hindi\".\n\n> and also suspect that ab/i18n-all-continue either hasn't be pushed\n> out or is stale?\n\nYes sorry, I pushed to \"ab/i18n-continue\"\ninstead. \"ab/i18n-all-continue\" is now up-to-date (equivalent to\n\"ab/i18n-continue\"). Sorry abuot the mixup.\n\n> The copy of \"all-continue\" I just fetched ends with 2b5170f (gettextize:\n> git-shortlog basic messages, 2010-09-05) while hindi^ is at c4adf2e\n> (gettextize: git-am printf(1) message to eval_gettext, 2010-09-07).\n\nThe hindi^ one was the right tip.\n\n> I haven't formed an opinion as to what to do with the *.po files after the\n> series hits 'next' (or anything more stable than 'pu'); my preference is\n> to delegate that part of the system to somebody who volunteers as an i18n\n> coordinator, and pull from him/her from time to time, just like the way\n> gitk and git-gui are managed.\n\nWe could certainly set up something like that. I going to wait and see\nif we needed it before proposing such a thing.\n\nAfter an initial spur of translation submissions po/ will probably\nquiet down quickly. We aren't adding new strings that often, so\nupdating translations shouldn't represent much PATCH traffic on-list.\n\nBut it could be split up if that's preferred too.\n\n> For now, I'll queue the whole thing and merge that to 'pu', but we would\n> want to squash l10n commits after (but not including) 8d65a35 (gettext\n> tests: test re-encoding with a UTF-8 msgid under Shell, 2010-08-30) that\n> touch only one file in po/*.po into one commit per language, move them\n> near the tip after all the infrastructure enhancements (and fix-ups to the\n> infrastructure, if necessary) and individual command i18ns, to make the\n> end result a reasonably complete and clean \"first cut for public testing\"\n> of the series before it hits 'next'.\n\nI can move those around, I didn't do so already because their position\nin the series is semantically meaningful. I.e. at the time is.po is\nadded it's pretty much a 100% translation, but more strings are added\nafter that.\n\nThat's a trivial minor issue with msgmerge and msgfmt --statistics to\nfind out how much is translated though. So I've re-arranged them and\nsquashed 'em for you here:\n\n    git://github.com/avar/git.git ab/i18n-for-junio\n\n> As a companion update to 6495411 (gettext docs: add po/README file\n> documenting Git's gettext, 2010-09-03), we would need a file in\n> Documentation/ directory to describe the use of _() and N_() for\n> programmers and point it from CodingGuidelines.\n\nI can add that to ab/i18n-for-junio, but haven't already. Isn't it\nbetter if I send that to the list for review instead of just tucking\nsomething at the end of the series. I can do either.\n\n> We might also want to move po/README to Documentation/ but I don't\n> have strong preference either way.\n\nI'd like to make it a manpage (as mentioned before), but i can't\nfigure out a good git-*.txt name for it.\n"},{"id":"150467","messageId":"1284147353-18000-1-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"AANLkTikdHZFmXAdABvS9hPXtbXNJU5NdCOrw5_KP73bX@mail.gmail.com","subject":"[PATCH 0/5] gettext docs: programmer docs in po/README","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T19:35:48Z","receivedAt":"2010-09-10T19:35:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Sep 10, 2010 at 17:17, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> On Fri, Sep 10, 2010 at 16:01, Junio C Hamano <gitster@pobox.com> wrote:\n>> As a companion update to 6495411 (gettext docs: add po/README file\n>> documenting Git's gettext, 2010-09-03), we would need a file in\n>> Documentation/ directory to describe the use of _() and N_() for\n>> programmers and point it from CodingGuidelines.\n>\n> I can add that to ab/i18n-for-junio, but haven't already. Isn't it\n> better if I send that to the list for review instead of just tucking\n> something at the end of the series. I can do either.\n\nHere it is on top of ab/i18n-for-junio. These can also be fetched\nfrom:\n\n    git://github.com/avar/git.git ab/i18n-for-junio-with-docs\n\nÆvar Arnfjörð Bjarmason (5):\n  gettext docs: add a \"Testing your changes\" section to po/README\n  gettext docs: add \"Marking strings for translation\" section in\n    po/README\n  gettext docs: the gettext.h C interface\n  gettext docs: the git-sh-i18n.sh Shell interface\n  gettext docs: the Git::I18N Perl interface\n\n Documentation/CodingGuidelines |    7 ++\n git-sh-i18n.sh                 |   16 +-----\n po/README                      |  125 +++++++++++++++++++++++++++++++++++++++-\n 3 files changed, 133 insertions(+), 15 deletions(-)\n\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150468","messageId":"1284147353-18000-2-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"AANLkTikdHZFmXAdABvS9hPXtbXNJU5NdCOrw5_KP73bX@mail.gmail.com","subject":"[PATCH 1/5] gettext docs: add a \"Testing your changes\" section to po/README","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T19:35:49Z","receivedAt":"2010-09-10T19:35:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change po/README to tell translators that they should do `make` at the\ntop-level before submitting their translations. Many common errors\nwill be caught with the `msgfmt --check` run that the Makefile will\ncompile the message catalogs with.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/README |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/po/README b/po/README\nindex cca8012..4d23ca6 100644\n--- a/po/README\n+++ b/po/README\n@@ -66,3 +66,17 @@ But then you need remember to remove the comments before you submit\n the file upstream:\n \n     perl -pi -e 's/^#: .*\\n//' XX.po\n+\n+\n+Testing your changes\n+--------------------\n+\n+Before you submit your changes go back to the top-level and do:\n+\n+    make\n+\n+On systems with GNU gettext (i.e. not Solaris) this will compile your\n+changed PO file with `msgfmt --check`, the --check option flags many\n+common errors, e.g. missing printf format strings, or translated\n+messages that deviate from the originals in whether they begin/end\n+with a newline or not.\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150472","messageId":"1284147353-18000-3-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"AANLkTikdHZFmXAdABvS9hPXtbXNJU5NdCOrw5_KP73bX@mail.gmail.com","subject":"[PATCH 2/5] gettext docs: add \"Marking strings for translation\" section in po/README","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T19:35:50Z","receivedAt":"2010-09-10T19:35:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add a \"Marking strings for translation\" section to po/README and\nmention it in Documentation/CodingGuidelines.\n\nThis section documents how the maintainers of Git's source code should\ngo about properly marking strings for translation.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Documentation/CodingGuidelines |    7 ++++++\n po/README                      |   41 +++++++++++++++++++++++++++++++++++++++-\n 2 files changed, 47 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex b8bf618..2e114d6 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -70,6 +70,10 @@ For shell scripts specifically (not exhaustive):\n      are ERE elements not BRE (note that \\? and \\+ are not even part\n      of BRE -- making them accessible from BRE is a GNU extension).\n \n+ - Use Git's gettext wrappers in git-sh-i18n to make the user\n+   interface translatable. See \"Marking strings for translation\" in\n+   po/README.\n+\n For C programs:\n \n  - We use tabs to indent, and interpret tabs as taking up to\n@@ -132,3 +136,6 @@ For C programs:\n \n  - When we pass <string, length> pair to functions, we should try to\n    pass them in that order.\n+\n+ - Use Git's gettext wrappers to make the user interface\n+   translatable. See \"Marking strings for translation\" in po/README.\ndiff --git a/po/README b/po/README\nindex 4d23ca6..372cb9c 100644\n--- a/po/README\n+++ b/po/README\n@@ -2,7 +2,8 @@ Core GIT Translations\n =====================\n \n This directory holds the translations for the core of Git. This\n-document describes how to add to and maintain these translations.\n+document describes how to add to and maintain these translations, and\n+how to mark source strings for translation.\n \n \n Generating a .pot file\n@@ -80,3 +81,41 @@ changed PO file with `msgfmt --check`, the --check option flags many\n common errors, e.g. missing printf format strings, or translated\n messages that deviate from the originals in whether they begin/end\n with a newline or not.\n+\n+\n+Marking strings for translation\n+-------------------------------\n+\n+Before strings can be translated they first have to be marked for\n+translation.\n+\n+Git uses an internationalization interface that wraps the system's\n+gettext library, so most of the advice in your gettext documentation\n+(on GNU systems `info gettext` in a terminal) applies.\n+\n+General advice:\n+\n+ - Don't mark everything for translation, only strings which will be\n+   read by humans (the porcelain interface) should be translated.\n+\n+   The output from Git's plumbing utilities will primarily be read by\n+   programs and would break scripts under non-C locales. These strings\n+   should not be translated.\n+\n+ - Adjust the strings so that they're easy to translate. Most of the\n+   advice in `info '(gettext)Preparing Strings'` applies here.\n+\n+ - If something is unclear or ambiguous you can use a \"TRANSLATORS\"\n+   comment to tell the translators what to make of it. These will be\n+   extracted by xgettext(1) and put in the po/*.po files, e.g. from\n+   git-am.sh:\n+\n+       # TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a]\n+       # in your translation. The program will only accept English\n+       # input at this point.\n+       gettext \"Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all \"\n+\n+   Or in C, from builtin/revert.c:\n+\n+       /* TRANSLATORS: %s will be \"revert\" or \"cherry-pick\" */\n+       die(_(\"%s: Unable to write new index file\"), me);\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150469","messageId":"1284147353-18000-4-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"AANLkTikdHZFmXAdABvS9hPXtbXNJU5NdCOrw5_KP73bX@mail.gmail.com","subject":"[PATCH 3/5] gettext docs: the gettext.h C interface","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T19:35:51Z","receivedAt":"2010-09-10T19:35:51Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change po/README's \"Marking strings for translation\" section so that\nit covers the gettext.h C interface.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/README |   36 ++++++++++++++++++++++++++++++++++++\n 1 files changed, 36 insertions(+), 0 deletions(-)\n\ndiff --git a/po/README b/po/README\nindex 372cb9c..ac12637 100644\n--- a/po/README\n+++ b/po/README\n@@ -119,3 +119,39 @@ General advice:\n \n        /* TRANSLATORS: %s will be \"revert\" or \"cherry-pick\" */\n        die(_(\"%s: Unable to write new index file\"), me);\n+\n+We provide wrappers for C, Shell and Perl programs. Here's how they're\n+used:\n+\n+C:\n+\n+ - Include builtin.h at the top, it'll pull in in gettext.h, which\n+   defines the gettext interface. Consult with the list if you need to\n+   use gettext.h directly.\n+\n+ - The C interface is a subset of the normal GNU gettext\n+   interface. We currently export these functions:\n+\n+   - _()\n+\n+    Mark and translate a string. E.g.:\n+\n+        printf(_(\"HEAD is now at %s\"), hex);\n+\n+   - N_()\n+\n+    A no-op pass-through macro for marking strings inside static\n+    initializations, e.g.:\n+        \n+        static const char *reset_type_names[] = {\n+            N_(\"mixed\"), N_(\"soft\"), N_(\"hard\"), N_(\"merge\"), N_(\"keep\"), NULL\n+        };\n+        \n+    And then, later:\n+\n+        die(_(\"%s reset is not allowed in a bare repository\"),\n+               _(reset_type_names[reset_type]));\n+\n+    Here _() couldn't have statically determined what the translation\n+    string will be, but since it was already marked for translation\n+    with N_() the look-up in the message catalog will succeed.\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150470","messageId":"1284147353-18000-5-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"AANLkTikdHZFmXAdABvS9hPXtbXNJU5NdCOrw5_KP73bX@mail.gmail.com","subject":"[PATCH 4/5] gettext docs: the git-sh-i18n.sh Shell interface","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T19:35:52Z","receivedAt":"2010-09-10T19:35:52Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change po/README's \"Marking strings for translation\" section so that\nit covers the git-sh-i18n.sh Shell interface.\n\nThe existing documentation in git-sh-i18n.sh has been moved to the\nREADME file, to avoid them drifting in apart..\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-sh-i18n.sh |   16 ++--------------\n po/README      |   23 +++++++++++++++++++++++\n 2 files changed, 25 insertions(+), 14 deletions(-)\n\ndiff --git a/git-sh-i18n.sh b/git-sh-i18n.sh\nindex b8b645a..f8dd43a 100644\n--- a/git-sh-i18n.sh\n+++ b/git-sh-i18n.sh\n@@ -2,20 +2,8 @@\n #\n # Copyright (c) 2010 Ævar Arnfjörð Bjarmason\n #\n-# This is Git's interface to gettext.sh. Use it right after\n-# git-sh-setup as:\n-#\n-#   . git-sh-setup\n-#   . git-sh-i18n\n-#\n-#   # For constant interface messages:\n-#   gettext \"A message for the user\"; echo\n-#\n-#   # To interpolate variables:\n-#   details=\"oh noes\"\n-#   eval_gettext \"An error occured: \\$details\"; echo\n-#\n-# See \"info '(gettext)sh'\" for the full manual.\n+# This is Git's interface to gettext.sh. See po/README for usage\n+# instructions.\n \n # Export the TEXTDOMAIN* data that we need for Git\n TEXTDOMAIN=git\ndiff --git a/po/README b/po/README\nindex ac12637..513cf32 100644\n--- a/po/README\n+++ b/po/README\n@@ -155,3 +155,26 @@ C:\n     Here _() couldn't have statically determined what the translation\n     string will be, but since it was already marked for translation\n     with N_() the look-up in the message catalog will succeed.\n+\n+Shell:\n+\n+ - The Git gettext shell interface is just a wrapper for\n+   gettext.sh. Import it right after git-sh-setup like this:\n+\n+       . git-sh-setup\n+       . git-sh-i18n\n+\n+   And then use the gettext or eval_gettext functions:\n+\n+       # For constant interface messages:\n+       gettext \"A message for the user\"; echo\n+\n+       # To interpolate variables:\n+       details=\"oh noes\"\n+       eval_gettext \"An error occured: \\$details\"; echo\n+\n+   More documentation about the interface is available in the GNU info\n+   page: `info '(gettext)sh'`. Looking at git-am.sh (the first shell\n+   command to be translated) for examples is also useful:\n+\n+       git log --reverse -p --grep=gettextize git-am.sh\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150471","messageId":"1284147353-18000-6-git-send-email-avarab@gmail.com","threadId":"25023","inReplyTo":"AANLkTikdHZFmXAdABvS9hPXtbXNJU5NdCOrw5_KP73bX@mail.gmail.com","subject":"[PATCH 5/5] gettext docs: the Git::I18N Perl interface","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T19:35:53Z","receivedAt":"2010-09-10T19:35:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change po/README's \"Marking strings for translation\" section so that\nit covers the Git::I18N Perl interface.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n po/README |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/po/README b/po/README\nindex 513cf32..0d1cfa0 100644\n--- a/po/README\n+++ b/po/README\n@@ -178,3 +178,14 @@ Shell:\n    command to be translated) for examples is also useful:\n \n        git log --reverse -p --grep=gettextize git-am.sh\n+\n+Perl:\n+\n+ - The Git::I18N module provides a limited subset of the\n+   Locale::Messages functionality, e.g.:\n+\n+       use Git::I18N;\n+       print __(\"Welcome to Git!\\n\");\n+       printf __(\"The following error occured: %s\\n\"), $error;\n+\n+   Run `perldoc perl/Git/I18N.pm` for more info.\n-- \n1.7.2.3.313.gcd15\n"},{"id":"150481","messageId":"7vmxrpgrqe.fsf@alter.siamese.dyndns.org","threadId":"25023","inReplyTo":"1284147353-18000-3-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 2/5] gettext docs: add \"Marking strings for translation\" section in po/README","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-10T22:26:33Z","receivedAt":"2010-09-10T22:26:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> + - Don't mark everything for translation, only strings which will be\n> +   read by humans (the porcelain interface) should be translated.\n> +\n> +   The output from Git's plumbing utilities will primarily be read by\n> +   programs and would break scripts under non-C locales. These strings\n> +   should not be translated.\n\nHmm, I had to re-read the above twice and then mentally annotate \"would\nbreak ... _if translated_\" to make sense of the advice.  Perhaps other\npeople are much less dense than me?\n"},{"id":"150482","messageId":"7viq2dgrji.fsf@alter.siamese.dyndns.org","threadId":"25023","inReplyTo":"1284147353-18000-4-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 3/5] gettext docs: the gettext.h C interface","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-10T22:30:41Z","receivedAt":"2010-09-10T22:30:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> +C:\n> +\n> + - Include builtin.h at the top, it'll pull in in gettext.h, which\n> +   defines the gettext interface.\n\nHmm, I would have thought that <git-compat-util.h> would be a much more\nnatural place for this kind of thing, not <builtin.h>.  Shouldn't you be\nable to write a non-builtin Porcelain if you wanted to?\n"},{"id":"150483","messageId":"AANLkTi=Ahh1vvwwYoAKNSVQE5dxV7RLdvjSefHOx+JK=@mail.gmail.com","threadId":"25023","inReplyTo":"7vmxrpgrqe.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/5] gettext docs: add \"Marking strings for translation\" section in po/README","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T22:31:10Z","receivedAt":"2010-09-10T22:31:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Sep 10, 2010 at 22:26, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>\n>> + - Don't mark everything for translation, only strings which will be\n>> +   read by humans (the porcelain interface) should be translated.\n>> +\n>> +   The output from Git's plumbing utilities will primarily be read by\n>> +   programs and would break scripts under non-C locales. These strings\n>> +   should not be translated.\n>\n> Hmm, I had to re-read the above twice and then mentally annotate \"would\n> break ... _if translated_\" to make sense of the advice.  Perhaps other\n> people are much less dense than me?\n\nNo, that \"... if translated\" wording is better.\n"},{"id":"150484","messageId":"7veid1gqjd.fsf@alter.siamese.dyndns.org","threadId":"25023","inReplyTo":"1284147353-18000-4-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 3/5] gettext docs: the gettext.h C interface","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-10T22:52:22Z","receivedAt":"2010-09-10T22:52:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> +   - _()\n> +\n> +    Mark and translate a string. E.g.:\n> +\n> +        printf(_(\"HEAD is now at %s\"), hex);\n> +\n> +   - N_()\n> +\n> +    A no-op pass-through macro for marking strings inside static\n> +    initializations, e.g.:\n> +        \n> +        static const char *reset_type_names[] = {\n> +            N_(\"mixed\"), N_(\"soft\"), N_(\"hard\"), N_(\"merge\"), N_(\"keep\"), NULL\n> +        };\n> +        \n> +    And then, later:\n> +\n> +        die(_(\"%s reset is not allowed in a bare repository\"),\n> +               _(reset_type_names[reset_type]));\n\nI do not think this is a very good example.  Unless we are doing l10n of\noption names, a Portuguese won't be typing \"git reset --misto\", so there\nis no point in invoking _(reset_type_names[]) to begin with, and there is\nno need to mark mixed/soft/hard/... for translation.\n\nAnd we won't be doing l10n of option names or subcommand names, I hope ;-).\n"},{"id":"150485","messageId":"AANLkTikHvr7Xp8jST4wrtyhF3UY5hnvVsuEsr=D9byXj@mail.gmail.com","threadId":"25023","inReplyTo":"7viq2dgrji.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/5] gettext docs: the gettext.h C interface","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T22:53:50Z","receivedAt":"2010-09-10T22:53:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Sep 10, 2010 at 22:30, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>\n>> +C:\n>> +\n>> + - Include builtin.h at the top, it'll pull in in gettext.h, which\n>> +   defines the gettext interface.\n>\n> Hmm, I would have thought that <git-compat-util.h> would be a much more\n> natural place for this kind of thing, not <builtin.h>.  Shouldn't you be\n> able to write a non-builtin Porcelain if you wanted to?\n\nI don't know, I just put it in builtin.h for the builtin/*.c commands,\nthe rest of the porcelain stuff should all have gettext.h already.\n\nMaybe gettext.h should be in git-compat-util.h, I don't know.\n"},{"id":"150486","messageId":"7vaanpgqg6.fsf@alter.siamese.dyndns.org","threadId":"25023","inReplyTo":"1284147353-18000-5-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 4/5] gettext docs: the git-sh-i18n.sh Shell interface","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-10T22:54:17Z","receivedAt":"2010-09-10T22:54:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> +       git log --reverse -p --grep=gettextize git-am.sh\n\nRunning this from the tip of ab/i18n reveals that one commit introduces a\nwhitespace breakage ;-).\n"},{"id":"150487","messageId":"AANLkTi=AFp+8+tHRNjiXbp_CymNLqCZQhMGcMe-1gsKe@mail.gmail.com","threadId":"25023","inReplyTo":"7vaanpgqg6.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 4/5] gettext docs: the git-sh-i18n.sh Shell interface","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T22:58:12Z","receivedAt":"2010-09-10T22:58:12Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Sep 10, 2010 at 22:54, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>\n>> +       git log --reverse -p --grep=gettextize git-am.sh\n>\n> Running this from the tip of ab/i18n reveals that one commit introduces a\n> whitespace breakage ;-).\n\nThat breakage was actually intentional (and I *think* I noted it\nsomewhere). The existing \"Did you hand edit your patch\" in git-am.sh\nalready indented with spaces, and I didn't change it while I was at it\nto keep the patch on-topic.\n\nI was going to fix a whitespace fixup later.\n"},{"id":"150488","messageId":"AANLkTimNvSuJ8g_Z3OuN2d-EGO99NNohe_HN+yzBaBMy@mail.gmail.com","threadId":"25023","inReplyTo":"7veid1gqjd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/5] gettext docs: the gettext.h C interface","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T23:03:04Z","receivedAt":"2010-09-10T23:03:04Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Sep 10, 2010 at 22:52, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>\n>> +   - _()\n>> +\n>> +    Mark and translate a string. E.g.:\n>> +\n>> +        printf(_(\"HEAD is now at %s\"), hex);\n>> +\n>> +   - N_()\n>> +\n>> +    A no-op pass-through macro for marking strings inside static\n>> +    initializations, e.g.:\n>> +\n>> +        static const char *reset_type_names[] = {\n>> +            N_(\"mixed\"), N_(\"soft\"), N_(\"hard\"), N_(\"merge\"), N_(\"keep\"), NULL\n>> +        };\n>> +\n>> +    And then, later:\n>> +\n>> +        die(_(\"%s reset is not allowed in a bare repository\"),\n>> +               _(reset_type_names[reset_type]));\n>\n> I do not think this is a very good example.  Unless we are doing l10n of\n> option names, a Portuguese won't be typing \"git reset --misto\", so there\n> is no point in invoking _(reset_type_names[]) to begin with, and there is\n> no need to mark mixed/soft/hard/... for translation.\n\nActually all the code that uses reset_type_names isn't referring to\nthe option directly, but to the action currently being undertaken:\n\n    die(_(\"Cannot do a %s reset in the middle of a merge.\"),\n        _(reset_type_names[reset_type]));\n\n    die(_(\"Cannot do %s reset with paths.\"),\n        _(reset_type_names[reset_type]));\n\n    die(_(\"%s reset is not allowed in a bare repository\"),\n        _(reset_type_names[reset_type]));\n\nIn that context translators probably want to translate them, e.g. I'd\ntranslate the first one into Icelandic as:\n\n    \"Get ekki framkvæmt %s endurstillingu í miðri sameiningu\" with %s\n== \"blandaða\" (\"mixed\")\n\n> And we won't be doing l10n of option names or subcommand names, I hope ;-).\n\nWe could do that, I don't have plans for it though, and in any case I\ndon't think this is such a case.\n"},{"id":"150489","messageId":"7v62ydgpvs.fsf@alter.siamese.dyndns.org","threadId":"25023","inReplyTo":"7veid1gqjd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/5] gettext docs: the gettext.h C interface","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-10T23:06:31Z","receivedAt":"2010-09-10T23:06:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n> ...\n>> +        static const char *reset_type_names[] = {\n>> +            N_(\"mixed\"), N_(\"soft\"), N_(\"hard\"), N_(\"merge\"), N_(\"keep\"), NULL\n>> +        };\n>> +        \n>> +    And then, later:\n>> +\n>> +        die(_(\"%s reset is not allowed in a bare repository\"),\n>> +               _(reset_type_names[reset_type]));\n>\n> I do not think this is a very good example.  Unless we are doing l10n of\n> option names, a Portuguese won't be typing \"git reset --misto\", so there\n> is no point in invoking _(reset_type_names[]) to begin with, and there is\n> no need to mark mixed/soft/hard/... for translation.\n\nAhh, I think I should take half of what I said back.  The line of thought\nhere is that\n\n (1) the user types \"git reset --mixed\"; no l10n of option names;\n\n (2) however, various modes of operations in \"reset\" command have\n     human-readable names, not necessarily cuttable-and-pastable for\n     machine consumption.  E.g. \"git reset --mixed\" is called \"mixed\n     reset\" in English and that is primarily meant to be explanation of\n     concept in human language, i.e. should be translated.\n\nUnder that assumption, localizing reset_type_names[] in the above may make\nsense.\n\nI said \"half of\", because I think the example is still problematic if you\nwant to translate to a language where \"reset\" in the fixed part of the\ndie() message may need to be spelled differently depending on what\nadjective in reset_type_names[] it takes (or the word order between the\nnoun \"reset\" and the adjective may have to be different depending on what\nthe adjective is), so an example may probaby need to be more like:\n\n    static const char *error_msgs[] = {\n        N_(\"mixed reset is not allowed...\"),\n        N_(\"soft reset is not allowed...\"),\n        ...\n    };\n\n    die(\"%s\", _(error_msgs[reset_type]));\n"},{"id":"150492","messageId":"AANLkTimhR5UDCM_T+UeO=7pbAubR4L6dW4TmUV3B07Pn@mail.gmail.com","threadId":"25023","inReplyTo":"7v62ydgpvs.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/5] gettext docs: the gettext.h C interface","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T23:16:32Z","receivedAt":"2010-09-10T23:16:32Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Sep 10, 2010 at 23:06, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n>> ...\n>>> +        static const char *reset_type_names[] = {\n>>> +            N_(\"mixed\"), N_(\"soft\"), N_(\"hard\"), N_(\"merge\"), N_(\"keep\"), NULL\n>>> +        };\n>>> +\n>>> +    And then, later:\n>>> +\n>>> +        die(_(\"%s reset is not allowed in a bare repository\"),\n>>> +               _(reset_type_names[reset_type]));\n>>\n>> I do not think this is a very good example.  Unless we are doing l10n of\n>> option names, a Portuguese won't be typing \"git reset --misto\", so there\n>> is no point in invoking _(reset_type_names[]) to begin with, and there is\n>> no need to mark mixed/soft/hard/... for translation.\n>\n> Ahh, I think I should take half of what I said back.  The line of thought\n> here is that\n>\n>  (1) the user types \"git reset --mixed\"; no l10n of option names;\n>\n>  (2) however, various modes of operations in \"reset\" command have\n>     human-readable names, not necessarily cuttable-and-pastable for\n>     machine consumption.  E.g. \"git reset --mixed\" is called \"mixed\n>     reset\" in English and that is primarily meant to be explanation of\n>     concept in human language, i.e. should be translated.\n>\n> Under that assumption, localizing reset_type_names[] in the above may make\n> sense.\n\nYeah.\n\n> I said \"half of\", because I think the example is still problematic if you\n> want to translate to a language where \"reset\" in the fixed part of the\n> die() message may need to be spelled differently depending on what\n> adjective in reset_type_names[] it takes (or the word order between the\n> noun \"reset\" and the adjective may have to be different depending on what\n> the adjective is), so an example may probaby need to be more like:\n>\n>    static const char *error_msgs[] = {\n>        N_(\"mixed reset is not allowed...\"),\n>        N_(\"soft reset is not allowed...\"),\n>        ...\n>    };\n>\n>    die(\"%s\", _(error_msgs[reset_type]));\n\nThat, or we could also solve issues like that to some extent by using\nthe gettext message context, which the limited gettext.h API doesn't\nsupport yet, it's probably not useful in this case but in others you\ncould do:\n\n    _(\"reset-verb\", \"mixed\")\n\nAnd elsewhere:\n\n    _(\"reset-noun\", \"mixed\")\n\nAnd that would turn into:\n\n    msgctxt \"reset-verb\"\n    msgid \"mixed\"\n    msgstr \"blandað\"\n\nOr something like that.\n\nAnyway, regarding the examples it's the only one of two N_() uses\nright now, and the builtin/notes.c example is more subtle, and needs\nmore explanation.\n\nSo out of lazyness I'd prefer to keep it as-is for now.\n"},{"id":"150493","messageId":"AANLkTinojLSMFbgg6RMer0_hnhG4DwM1V3CX99-SSOgi@mail.gmail.com","threadId":"25023","inReplyTo":"1284147353-18000-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH 0/5] gettext docs: programmer docs in po/README","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T23:21:25Z","receivedAt":"2010-09-10T23:21:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Sep 10, 2010 at 19:35, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> On Fri, Sep 10, 2010 at 17:17, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n>> On Fri, Sep 10, 2010 at 16:01, Junio C Hamano <gitster@pobox.com> wrote:\n>>> As a companion update to 6495411 (gettext docs: add po/README file\n>>> documenting Git's gettext, 2010-09-03), we would need a file in\n>>> Documentation/ directory to describe the use of _() and N_() for\n>>> programmers and point it from CodingGuidelines.\n>>\n>> I can add that to ab/i18n-for-junio, but haven't already. Isn't it\n>> better if I send that to the list for review instead of just tucking\n>> something at the end of the series. I can do either.\n>\n> Here it is on top of ab/i18n-for-junio. These can also be fetched\n> from:\n>\n>    git://github.com/avar/git.git ab/i18n-for-junio-with-docs\n\nI fixed the wording on this as suggested by Junio, and a trivial\nwhitespace issue, but not the N_() example.\n\nThis ref can replace the existing ab/i18n ref in pu.\n"}]}