{"thread":{"id":"31060","subject":"[PATCH 0/7] i18n for git-am, git-rebase and git-merge","startedAt":"2012-07-21T15:50:49Z","lastAt":"2012-07-22T01:33:44Z","messageCount":14,"participants":["Jiang Xin","Stefano Lattarini"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"195407","messageId":"cover.1342884458.git.worldhello.net@gmail.com","threadId":"31060","inReplyTo":null,"subject":"[PATCH 0/7] i18n for git-am, git-rebase and git-merge","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-21T15:50:49Z","receivedAt":"2012-07-21T15:50:49Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Mark strings in git-am, git-rebase, and git-merge for translation.\nAnd contain fixes for shell gettext extraction and xgettext workaround.\n\nJiang Xin (7):\n  i18n: New keywords for xgettext extraction from sh\n  i18n: rebase: mark strings for translation\n  i18n: Rewrite gettext messages start with dash\n  Remove obsolete LONG_USAGE which breaks xgettext\n  i18n: am: mark more strings for translation\n  Remove unused and bad gettext block from git-am\n  i18n: merge-recursive: mark strings for translation\n\n Makefile                      |   3 +-\n git-am.sh                     |  14 ++--\n git-rebase.sh                 |  83 +++++++++--------------\n git-submodule.sh              |   2 +-\n merge-recursive.c             | 152 ++++++++++++++++++++++--------------------\n t/t3404-rebase-interactive.sh |   2 +-\n 6 files changed, 120 insertions(+), 136 deletions(-)\n\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195413","messageId":"a7d2248051ddc62e38e67d9efbb41c01498c7a4c.1342884459.git.worldhello.net@gmail.com","threadId":"31060","inReplyTo":"cover.1342884458.git.worldhello.net@gmail.com","subject":"[PATCH 1/7] i18n: New keywords for xgettext extraction from sh","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-21T15:50:50Z","receivedAt":"2012-07-21T15:50:50Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Since we have additional shell wrappers (gettextln and eval_gettextln)\nfor gettext, we need to take into account these wrapers when run\n'make pot' to extract messages from shell scripts.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n Makefile | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 285c66..e1692 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2376,7 +2376,8 @@ XGETTEXT_FLAGS = \\\n \t--from-code=UTF-8\n XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \\\n \t--keyword=_ --keyword=N_ --keyword=\"Q_:1,2\"\n-XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell\n+XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \\\n+\t--keyword=gettextln --keyword=eval_gettextln\n XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl\n LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)\n LOCALIZED_SH := $(SCRIPT_SH)\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195409","messageId":"0fd901035a418562d3d9282553a96124814a298a.1342884459.git.worldhello.net@gmail.com","threadId":"31060","inReplyTo":"a7d2248051ddc62e38e67d9efbb41c01498c7a4c.1342884459.git.worldhello.net@gmail.com","subject":"[PATCH 2/7] i18n: rebase: mark strings for translation","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-21T15:50:51Z","receivedAt":"2012-07-21T15:50:51Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n git-rebase.sh | 58 ++++++++++++++++++++++++++++++----------------------------\n 1 file changed, 30 insertions(+), 28 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 1cd06..df5998 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -65,6 +65,7 @@ abort!             abort and check out the original branch\n skip!              skip current patch and continue\n \"\n . git-sh-setup\n+. git-sh-i18n\n set_reflog_action rebase\n require_work_tree_exists\n cd_to_toplevel\n@@ -72,11 +73,11 @@ cd_to_toplevel\n LF='\n '\n ok_to_skip_pre_rebase=\n-resolvemsg=\"\n+resolvemsg=\"$(gettext \"\n When you have resolved this problem run \\\"git rebase --continue\\\".\n If you would prefer to skip this patch, instead run \\\"git rebase --skip\\\".\n To check out the original branch and stop rebasing run \\\"git rebase --abort\\\".\n-\"\n+\")\"\n unset onto\n cmd=\n strategy=\n@@ -161,7 +162,7 @@ move_to_original_branch () {\n \t\tgit symbolic-ref \\\n \t\t\t-m \"rebase finished: returning to $head_name\" \\\n \t\t\tHEAD $head_name ||\n-\t\tdie \"Could not move back to $head_name\"\n+\t\tdie \"$(gettext \"Could not move back to $head_name\")\"\n \t\t;;\n \tesac\n }\n@@ -180,12 +181,12 @@ run_pre_rebase_hook () {\n \t   test -x \"$GIT_DIR/hooks/pre-rebase\"\n \tthen\n \t\t\"$GIT_DIR/hooks/pre-rebase\" ${1+\"$@\"} ||\n-\t\tdie \"The pre-rebase hook refused to rebase.\"\n+\t\tdie \"$(gettext \"The pre-rebase hook refused to rebase.\")\"\n \tfi\n }\n \n test -f \"$apply_dir\"/applying &&\n-\tdie 'It looks like git-am is in progress. Cannot rebase.'\n+\tdie \"$(gettext \"It looks like git-am is in progress. Cannot rebase.\")\"\n \n if test -d \"$apply_dir\"\n then\n@@ -316,12 +317,12 @@ test $# -gt 2 && usage\n if test -n \"$cmd\" &&\n    test \"$interactive_rebase\" != explicit\n then\n-\tdie \"--exec option must be used with --interactive option\"\n+\tdie \"$(gettext -- \"--exec option must be used with --interactive option\")\"\n fi\n \n if test -n \"$action\"\n then\n-\ttest -z \"$in_progress\" && die \"No rebase in progress?\"\n+\ttest -z \"$in_progress\" && die \"$(gettext \"No rebase in progress?\")\"\n \t# Only interactive rebase uses detailed reflog messages\n \tif test \"$type\" = interactive && test \"$GIT_REFLOG_ACTION\" = rebase\n \tthen\n@@ -334,11 +335,11 @@ case \"$action\" in\n continue)\n \t# Sanity check\n \tgit rev-parse --verify HEAD >/dev/null ||\n-\t\tdie \"Cannot read HEAD\"\n+\t\tdie \"$(gettext \"Cannot read HEAD\")\"\n \tgit update-index --ignore-submodules --refresh &&\n \tgit diff-files --quiet --ignore-submodules || {\n-\t\techo \"You must edit all merge conflicts and then\"\n-\t\techo \"mark them as resolved using git add\"\n+\t\techo \"$(gettext \"You must edit all merge conflicts and then\n+mark them as resolved using git add\")\"\n \t\texit 1\n \t}\n \tread_basic_state\n@@ -355,7 +356,7 @@ abort)\n \tcase \"$head_name\" in\n \trefs/*)\n \t\tgit symbolic-ref -m \"rebase: aborting\" HEAD $head_name ||\n-\t\tdie \"Could not move back to $head_name\"\n+\t\tdie \"$(eval_gettext \"Could not move back to \\$head_name\")\"\n \t\t;;\n \tesac\n \toutput git reset --hard $orig_head\n@@ -367,15 +368,16 @@ esac\n # Make sure no rebase is in progress\n if test -n \"$in_progress\"\n then\n-\tdie '\n-It seems that there is already a '\"${state_dir##*/}\"' directory, and\n+\tstate_dir_base=${state_dir##*/}\n+\tdie \"$(eval_gettext \"\n+It seems that there is already a \\$state_dir_base directory, and\n I wonder if you are in the middle of another rebase.  If that is the\n case, please try\n \tgit rebase (--continue | --abort | --skip)\n If that is not the case, please\n-\trm -fr '\"$state_dir\"'\n+\trm -fr \\\"\\$state_dir\\\"\n and run me again.  I am stopping in case you still have something\n-valuable there.'\n+valuable there.\")\"\n fi\n \n if test -n \"$rebase_root\" && test -z \"$onto\"\n@@ -413,7 +415,7 @@ then\n \t\t;;\n \tesac\n \tupstream=`git rev-parse --verify \"${upstream_name}^0\"` ||\n-\tdie \"invalid upstream $upstream_name\"\n+\tdie \"$(eval_gettext \"invalid upstream \\$upstream_name\")\"\n \tupstream_arg=\"$upstream_name\"\n else\n \tif test -z \"$onto\"\n@@ -437,19 +439,19 @@ case \"$onto_name\" in\n \tthen\n \t\tcase \"$onto\" in\n \t\t?*\"$LF\"?*)\n-\t\t\tdie \"$onto_name: there are more than one merge bases\"\n+\t\t\tdie \"$(eval_gettext \"\\$onto_name: there are more than one merge bases\")\"\n \t\t\t;;\n \t\t'')\n-\t\t\tdie \"$onto_name: there is no merge base\"\n+\t\t\tdie \"$(eval_gettext \"\\$onto_name: there is no merge base\")\"\n \t\t\t;;\n \t\tesac\n \telse\n-\t\tdie \"$onto_name: there is no merge base\"\n+\t\tdie \"$(eval_gettext \"\\$onto_name: there is no merge base\")\"\n \tfi\n \t;;\n *)\n \tonto=$(git rev-parse --verify \"${onto_name}^0\") ||\n-\tdie \"Does not point to a valid commit: $onto_name\"\n+\tdie \"$(eval_gettext \"Does not point to a valid commit: \\$onto_name\")\"\n \t;;\n esac\n \n@@ -472,7 +474,7 @@ case \"$#\" in\n \tthen\n \t\thead_name=\"detached HEAD\"\n \telse\n-\t\tdie \"fatal: no such branch: $1\"\n+\t\tdie \"$(eval_gettext \"fatal: no such branch: \\$branch_name\")\"\n \tfi\n \t;;\n 0)\n@@ -488,11 +490,11 @@ case \"$#\" in\n \torig_head=$(git rev-parse --verify \"${branch_name}^0\") || exit\n \t;;\n *)\n-\tdie \"BUG: unexpected number of arguments left to parse\"\n+\tdie \"$(gettext \"BUG: unexpected number of arguments left to parse\")\"\n \t;;\n esac\n \n-require_clean_work_tree \"rebase\" \"Please commit or stash them.\"\n+require_clean_work_tree \"rebase\" \"$(gettext \"Please commit or stash them.\")\"\n \n # Now we are rebasing commits $upstream..$orig_head (or with --root,\n # everything leading up to $orig_head) on top of $onto\n@@ -510,10 +512,10 @@ then\n \tthen\n \t\t# Lazily switch to the target branch if needed...\n \t\ttest -z \"$switch_to\" || git checkout \"$switch_to\" --\n-\t\tsay \"Current branch $branch_name is up to date.\"\n+\t\tsay \"$(eval_gettext \"Current branch \\$branch_name is up to date.\")\"\n \t\texit 0\n \telse\n-\t\tsay \"Current branch $branch_name is up to date, rebase forced.\"\n+\t\tsay \"$(eval_gettext \"Current branch \\$branch_name is up to date, rebase forced.\")\"\n \tfi\n fi\n \n@@ -524,7 +526,7 @@ if test -n \"$diffstat\"\n then\n \tif test -n \"$verbose\"\n \tthen\n-\t\techo \"Changes from $mb to $onto:\"\n+\t\techo \"$(eval_gettext \"Changes from \\$mb to \\$onto:\")\"\n \tfi\n \t# We want color (if set), but no pager\n \tGIT_PAGER='' git diff --stat --summary \"$mb\" \"$onto\"\n@@ -533,7 +535,7 @@ fi\n test \"$type\" = interactive && run_specific_rebase\n \n # Detach HEAD and reset the tree\n-say \"First, rewinding head to replay your work on top of it...\"\n+say \"$(gettext \"First, rewinding head to replay your work on top of it...\")\"\n git checkout -q \"$onto^0\" || die \"could not detach HEAD\"\n git update-ref ORIG_HEAD $orig_head\n \n@@ -541,7 +543,7 @@ git update-ref ORIG_HEAD $orig_head\n # we just fast-forwarded.\n if test \"$mb\" = \"$orig_head\"\n then\n-\tsay \"Fast-forwarded $branch_name to $onto_name.\"\n+\tsay \"$(eval_gettext \"Fast-forwarded \\$branch_name to \\$onto_name.\")\"\n \tmove_to_original_branch\n \texit 0\n fi\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195408","messageId":"77cbbce0450735a66ef1d9101af0bc82e3fc545c.1342884459.git.worldhello.net@gmail.com","threadId":"31060","inReplyTo":"0fd901035a418562d3d9282553a96124814a298a.1342884459.git.worldhello.net@gmail.com","subject":"[PATCH 3/7] i18n: Rewrite gettext messages start with dash","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-21T15:50:52Z","receivedAt":"2012-07-21T15:50:52Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Gettext message in a shell script should not start with '-', one\nworkaround is adding '--' between gettext and the message, like:\n\n    gettext -- \"--exec option ...\"\n\nBut due to a bug in the xgettext extraction, xgettext can not\nextract the actual message for this case. Rewrite the message\nis a simpler and better solution.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n git-rebase.sh                 | 2 +-\n git-submodule.sh              | 2 +-\n t/t3404-rebase-interactive.sh | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex df5998..640af 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -317,7 +317,7 @@ test $# -gt 2 && usage\n if test -n \"$cmd\" &&\n    test \"$interactive_rebase\" != explicit\n then\n-\tdie \"$(gettext -- \"--exec option must be used with --interactive option\")\"\n+\tdie \"$(gettext \"The --exec option must be used with the --interactive option\")\"\n fi\n \n if test -n \"$action\"\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 5629d..57f98 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -746,7 +746,7 @@ cmd_summary() {\n \tif [ -n \"$files\" ]\n \tthen\n \t\ttest -n \"$cached\" &&\n-\t\tdie \"$(gettext -- \"--cached cannot be used with --files\")\"\n+\t\tdie \"$(gettext \"The --cached option cannot be used with the --files option\")\"\n \t\tdiff_cmd=diff-files\n \t\thead=\n \tfi\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 8078..f206a 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -858,7 +858,7 @@ test_expect_success 'rebase -ix with --autosquash' '\n test_expect_success 'rebase --exec without -i shows error message' '\n \tgit reset --hard execute &&\n \ttest_must_fail git rebase --exec \"git show HEAD\" HEAD~2 2>actual &&\n-\techo \"--exec option must be used with --interactive option\" >expected &&\n+\techo \"The --exec option must be used with the --interactive option\" >expected &&\n \ttest_i18ncmp expected actual\n '\n \n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195412","messageId":"941f7bd695e8a14c940a5b8e4214d2773ae82557.1342884459.git.worldhello.net@gmail.com","threadId":"31060","inReplyTo":"77cbbce0450735a66ef1d9101af0bc82e3fc545c.1342884459.git.worldhello.net@gmail.com","subject":"[PATCH 4/7] Remove obsolete LONG_USAGE which breaks xgettext","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-21T15:50:53Z","receivedAt":"2012-07-21T15:50:53Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"The obsolete LONG_USAGE variable has the following message in it:\n\n    A'\\''--B'\\''--C'\\''\n\nAnd such complex LONG_USAGE message will breaks xgettext when extract\nl10n messages. But if remove single quotes from the message, xgettext\nworks fine on 'git-rebase.sh'.\n\nSince there is a mordern OPTIONS_SPEC variable in use in this script,\nit's safe to remove the obsolte USAGE and LONG_USAGE variables.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n git-rebase.sh | 25 -------------------------\n 1 file changed, 25 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 640af..02c63 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -3,31 +3,6 @@\n # Copyright (c) 2005 Junio C Hamano.\n #\n \n-USAGE='[--interactive | -i] [--exec | -x <cmd>] [-v] [--force-rebase | -f]\n-       [--no-ff] [--onto <newbase>] [<upstream>|--root] [<branch>] [--quiet | -q]'\n-LONG_USAGE='git-rebase replaces <branch> with a new branch of the\n-same name.  When the --onto option is provided the new branch starts\n-out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>\n-It then attempts to create a new commit for each commit from the original\n-<branch> that does not exist in the <upstream> branch.\n-\n-It is possible that a merge failure will prevent this process from being\n-completely automatic.  You will have to resolve any such merge failure\n-and run git rebase --continue.  Another option is to bypass the commit\n-that caused the merge failure with git rebase --skip.  To check out the\n-original <branch> and remove the .git/rebase-apply working files, use the\n-command git rebase --abort instead.\n-\n-Note that if <branch> is not specified on the command line, the\n-currently checked out branch is used.\n-\n-Example:       git-rebase master~1 topic\n-\n-\tA---B---C topic                   A'\\''--B'\\''--C'\\'' topic\n-       /                   -->           /\n-  D---E---F---G master          D---E---F---G master\n-'\n-\n SUBDIRECTORY_OK=Yes\n OPTIONS_KEEPDASHDASH=\n OPTIONS_SPEC=\"\\\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195411","messageId":"d5c4000b859f4b30af6fc3faec008403b82246bf.1342884459.git.worldhello.net@gmail.com","threadId":"31060","inReplyTo":"941f7bd695e8a14c940a5b8e4214d2773ae82557.1342884459.git.worldhello.net@gmail.com","subject":"[PATCH 5/7] i18n: am: mark more strings for translation","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-21T15:50:54Z","receivedAt":"2012-07-21T15:50:54Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n git-am.sh | 11 +++++------\n 1 file changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex b6a53..20c1a 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -92,7 +92,7 @@ safe_to_abort () {\n \tthen\n \t\treturn 0\n \tfi\n-\t\tgettextln \"You seem to have moved HEAD since the last 'am' failure.\n+\tgettextln \"You seem to have moved HEAD since the last 'am' failure.\n Not rewinding to ORIG_HEAD\" >&2\n \treturn 1\n }\n@@ -136,7 +136,7 @@ fall_back_3way () {\n     git write-tree >\"$dotest/patch-merge-base+\" ||\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+    say \"$(gettext \"Using index info to reconstruct a base tree...\")\"\n \n     cmd='GIT_INDEX_FILE=\"$dotest/patch-merge-tmp-index\"'\n \n@@ -176,8 +176,7 @@ It does not apply to blobs recorded in its index.\")\"\n     fi\n     git-merge-recursive $orig_tree -- HEAD $his_tree || {\n \t    git rerere $allow_rerere_autoupdate\n-\t    echo Failed to merge in the changes.\n-\t    exit 1\n+\t    die \"$(gettext \"Failed to merge in the changes.\")\"\n     }\n     unset GITHEAD_$his_tree\n }\n@@ -387,8 +386,8 @@ do\n \t-i|--interactive)\n \t\tinteractive=t ;;\n \t-b|--binary)\n-\t\techo >&2 \"The $1 option has been a no-op for long time, and\"\n-\t\techo >&2 \"it will be removed. Please do not use it anymore.\"\n+\t\techo >&2 $(gettext \"The -b option has been a no-op for long time, and\n+it will be removed. Please do not use it anymore.\")\n \t\t;;\n \t-3|--3way)\n \t\tthreeway=t ;;\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195410","messageId":"d1af1d40b0edbb8e356ecbb700cd0a7c13832a8f.1342884459.git.worldhello.net@gmail.com","threadId":"31060","inReplyTo":"d5c4000b859f4b30af6fc3faec008403b82246bf.1342884459.git.worldhello.net@gmail.com","subject":"[PATCH 6/7] Remove unused and bad gettext block from git-am","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-21T15:50:55Z","receivedAt":"2012-07-21T15:50:55Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Gettext message should not start with '-' nor '--'. Since the '-d' and\n'--dotest' options are not exist in OPTIONS_SPEC variable, so it's safe\nto remove the block.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n git-am.sh | 3 ---\n 1 file changed, 3 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 20c1a..cfa63 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -413,9 +413,6 @@ it will be removed. Please do not use it anymore.\")\n \t\tabort=t ;;\n \t--rebasing)\n \t\trebasing=t threeway=t ;;\n-\t-d|--dotest)\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 \t--whitespace|--directory|--exclude|--include)\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195414","messageId":"e2d7401d2b8352a8cf856610941a1c20c8a6b82d.1342884459.git.worldhello.net@gmail.com","threadId":"31060","inReplyTo":"d1af1d40b0edbb8e356ecbb700cd0a7c13832a8f.1342884459.git.worldhello.net@gmail.com","subject":"[PATCH 7/7] i18n: merge-recursive: mark strings for translation","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-21T15:50:56Z","receivedAt":"2012-07-21T15:50:56Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n merge-recursive.c | 152 +++++++++++++++++++++++++++++-------------------------\n 1 file changed, 81 insertions(+), 71 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 68093..d0167 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -187,7 +187,7 @@ static void output_commit_title(struct merge_options *o, struct commit *commit)\n \telse {\n \t\tprintf(\"%s \", find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));\n \t\tif (parse_commit(commit) != 0)\n-\t\t\tprintf(\"(bad commit)\\n\");\n+\t\t\tprintf(_(\"(bad commit)\\n\"));\n \t\telse {\n \t\t\tconst char *title;\n \t\t\tint len = find_commit_subject(commit->buffer, &title);\n@@ -203,7 +203,7 @@ static int add_cacheinfo(unsigned int mode, const unsigned char *sha1,\n \tstruct cache_entry *ce;\n \tce = make_cache_entry(mode, sha1 ? sha1 : null_sha1, path, stage, refresh);\n \tif (!ce)\n-\t\treturn error(\"addinfo_cache failed for path '%s'\", path);\n+\t\treturn error(_(\"addinfo_cache failed for path '%s'\"), path);\n \treturn add_cache_entry(ce, options);\n }\n \n@@ -249,14 +249,14 @@ struct tree *write_tree_from_memory(struct merge_options *o)\n \n \tif (unmerged_cache()) {\n \t\tint i;\n-\t\tfprintf(stderr, \"BUG: There are unmerged index entries:\\n\");\n+\t\tfprintf(stderr, _(\"BUG: There are unmerged index entries:\\n\"));\n \t\tfor (i = 0; i < active_nr; i++) {\n \t\t\tstruct cache_entry *ce = active_cache[i];\n \t\t\tif (ce_stage(ce))\n \t\t\t\tfprintf(stderr, \"BUG: %d %.*s\\n\", ce_stage(ce),\n \t\t\t\t\t(int)ce_namelen(ce), ce->name);\n \t\t}\n-\t\tdie(\"Bug in merge-recursive.c\");\n+\t\tdie(_(\"Bug in merge-recursive.c\"));\n \t}\n \n \tif (!active_cache_tree)\n@@ -265,7 +265,7 @@ struct tree *write_tree_from_memory(struct merge_options *o)\n \tif (!cache_tree_fully_valid(active_cache_tree) &&\n \t    cache_tree_update(active_cache_tree,\n \t\t\t      active_cache, active_nr, 0) < 0)\n-\t\tdie(\"error building trees\");\n+\t\tdie(_(\"error building trees\"));\n \n \tresult = lookup_tree(active_cache_tree->sha1);\n \n@@ -494,7 +494,7 @@ static struct string_list *get_renames(struct merge_options *o,\n \topts.show_rename_progress = o->show_rename_progress;\n \topts.output_format = DIFF_FORMAT_NO_OUTPUT;\n \tif (diff_setup_done(&opts) < 0)\n-\t\tdie(\"diff setup failed\");\n+\t\tdie(_(\"diff setup failed\"));\n \tdiff_tree_sha1(o_tree->object.sha1, tree->object.sha1, \"\", &opts);\n \tdiffcore_std(&opts);\n \tif (opts.needed_rename_limit > o->needed_rename_limit)\n@@ -624,7 +624,7 @@ static void flush_buffer(int fd, const char *buf, unsigned long size)\n \t\t\t\tbreak;\n \t\t\tdie_errno(\"merge-recursive\");\n \t\t} else if (!ret) {\n-\t\t\tdie(\"merge-recursive: disk full?\");\n+\t\t\tdie(_(\"merge-recursive: disk full?\"));\n \t\t}\n \t\tsize -= ret;\n \t\tbuf += ret;\n@@ -687,7 +687,7 @@ static int would_lose_untracked(const char *path)\n static int make_room_for_path(struct merge_options *o, const char *path)\n {\n \tint status, i;\n-\tconst char *msg = \"failed to create path '%s'%s\";\n+\tconst char *msg = _(\"failed to create path '%s'%s\");\n \n \t/* Unlink any D/F conflict files that are in the way */\n \tfor (i = 0; i < o->df_conflict_file_set.nr; i++) {\n@@ -698,7 +698,7 @@ static int make_room_for_path(struct merge_options *o, const char *path)\n \t\t    path[df_pathlen] == '/' &&\n \t\t    strncmp(path, df_path, df_pathlen) == 0) {\n \t\t\toutput(o, 3,\n-\t\t\t       \"Removing %s to make room for subdirectory\\n\",\n+\t\t\t       _(\"Removing %s to make room for subdirectory\\n\"),\n \t\t\t       df_path);\n \t\t\tunlink(df_path);\n \t\t\tunsorted_string_list_delete_item(&o->df_conflict_file_set,\n@@ -712,7 +712,7 @@ static int make_room_for_path(struct merge_options *o, const char *path)\n \tif (status) {\n \t\tif (status == -3) {\n \t\t\t/* something else exists */\n-\t\t\terror(msg, path, \": perhaps a D/F conflict?\");\n+\t\t\terror(msg, path, _(\": perhaps a D/F conflict?\"));\n \t\t\treturn -1;\n \t\t}\n \t\tdie(msg, path, \"\");\n@@ -723,7 +723,7 @@ static int make_room_for_path(struct merge_options *o, const char *path)\n \t * tracking it.\n \t */\n \tif (would_lose_untracked(path))\n-\t\treturn error(\"refusing to lose untracked file at '%s'\",\n+\t\treturn error(_(\"refusing to lose untracked file at '%s'\"),\n \t\t\t     path);\n \n \t/* Successful unlink is good.. */\n@@ -733,7 +733,7 @@ static int make_room_for_path(struct merge_options *o, const char *path)\n \tif (errno == ENOENT)\n \t\treturn 0;\n \t/* .. but not some other error (who really cares what?) */\n-\treturn error(msg, path, \": perhaps a D/F conflict?\");\n+\treturn error(msg, path, _(\": perhaps a D/F conflict?\"));\n }\n \n static void update_file_flags(struct merge_options *o,\n@@ -763,9 +763,9 @@ static void update_file_flags(struct merge_options *o,\n \n \t\tbuf = read_sha1_file(sha, &type, &size);\n \t\tif (!buf)\n-\t\t\tdie(\"cannot read object %s '%s'\", sha1_to_hex(sha), path);\n+\t\t\tdie(_(\"cannot read object %s '%s'\"), sha1_to_hex(sha), path);\n \t\tif (type != OBJ_BLOB)\n-\t\t\tdie(\"blob expected for %s '%s'\", sha1_to_hex(sha), path);\n+\t\t\tdie(_(\"blob expected for %s '%s'\"), sha1_to_hex(sha), path);\n \t\tif (S_ISREG(mode)) {\n \t\t\tstruct strbuf strbuf = STRBUF_INIT;\n \t\t\tif (convert_to_working_tree(path, buf, size, &strbuf)) {\n@@ -788,7 +788,7 @@ static void update_file_flags(struct merge_options *o,\n \t\t\t\tmode = 0666;\n \t\t\tfd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode);\n \t\t\tif (fd < 0)\n-\t\t\t\tdie_errno(\"failed to open '%s'\", path);\n+\t\t\t\tdie_errno(_(\"failed to open '%s'\"), path);\n \t\t\tflush_buffer(fd, buf, size);\n \t\t\tclose(fd);\n \t\t} else if (S_ISLNK(mode)) {\n@@ -796,10 +796,10 @@ static void update_file_flags(struct merge_options *o,\n \t\t\tsafe_create_leading_directories_const(path);\n \t\t\tunlink(path);\n \t\t\tif (symlink(lnk, path))\n-\t\t\t\tdie_errno(\"failed to symlink '%s'\", path);\n+\t\t\t\tdie_errno(_(\"failed to symlink '%s'\"), path);\n \t\t\tfree(lnk);\n \t\t} else\n-\t\t\tdie(\"do not know what to do with %06o %s '%s'\",\n+\t\t\tdie(_(\"do not know what to do with %06o %s '%s'\"),\n \t\t\t    mode, sha1_to_hex(sha), path);\n \t\tfree(buf);\n \t}\n@@ -936,11 +936,11 @@ static struct merge_file_info merge_file_1(struct merge_options *o,\n \t\t\t\t\t\t  branch1, branch2);\n \n \t\t\tif ((merge_status < 0) || !result_buf.ptr)\n-\t\t\t\tdie(\"Failed to execute internal merge\");\n+\t\t\t\tdie(_(\"Failed to execute internal merge\"));\n \n \t\t\tif (write_sha1_file(result_buf.ptr, result_buf.size,\n \t\t\t\t\t    blob_type, result.sha))\n-\t\t\t\tdie(\"Unable to add %s to database\",\n+\t\t\t\tdie(_(\"Unable to add %s to database\"),\n \t\t\t\t    a->path);\n \n \t\t\tfree(result_buf.ptr);\n@@ -956,7 +956,7 @@ static struct merge_file_info merge_file_1(struct merge_options *o,\n \t\t\tif (!sha_eq(a->sha1, b->sha1))\n \t\t\t\tresult.clean = 0;\n \t\t} else {\n-\t\t\tdie(\"unsupported object type in the tree\");\n+\t\t\tdie(_(\"unsupported object type in the tree\"));\n \t\t}\n \t}\n \n@@ -1034,22 +1034,32 @@ static void handle_change_delete(struct merge_options *o,\n \t\tremove_file_from_cache(path);\n \t\tupdate_file(o, 0, o_sha, o_mode, renamed ? renamed : path);\n \t} else if (!a_sha) {\n-\t\toutput(o, 1, \"CONFLICT (%s/delete): %s deleted in %s \"\n-\t\t       \"and %s in %s. Version %s of %s left in tree%s%s.\",\n-\t\t       change, path, o->branch1,\n-\t\t       change_past, o->branch2, o->branch2, path,\n-\t\t       NULL == renamed ? \"\" : \" at \",\n-\t\t       NULL == renamed ? \"\" : renamed);\n-\t\tupdate_file(o, 0, b_sha, b_mode, renamed ? renamed : path);\n+\t\tif (NULL == renamed) {\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n+\t\t\t       \"and %s in %s. Version %s of %s left in tree.\"),\n+\t\t\t       change, path, o->branch1, change_past,\n+\t\t\t       o->branch2, o->branch2, path);\n+\t\t\tupdate_file(o, 0, b_sha, b_mode, path);\n+\t\t} else {\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n+\t\t\t       \"and %s in %s. Version %s of %s left in tree at %s.\"),\n+\t\t\t       change, path, o->branch1, change_past,\n+\t\t\t       o->branch2, o->branch2, path, renamed);\n+\t\t\tupdate_file(o, 0, b_sha, b_mode, renamed);\n+\t\t}\n \t} else {\n-\t\toutput(o, 1, \"CONFLICT (%s/delete): %s deleted in %s \"\n-\t\t       \"and %s in %s. Version %s of %s left in tree%s%s.\",\n-\t\t       change, path, o->branch2,\n-\t\t       change_past, o->branch1, o->branch1, path,\n-\t\t       NULL == renamed ? \"\" : \" at \",\n-\t\t       NULL == renamed ? \"\" : renamed);\n-\t\tif (renamed)\n+\t\tif (NULL == renamed) {\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n+\t\t\t       \"and %s in %s. Version %s of %s left in tree.\"),\n+\t\t\t       change, path, o->branch2, change_past,\n+\t\t\t       o->branch1, o->branch1, path);\n+\t\t} else {\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n+\t\t\t       \"and %s in %s. Version %s of %s left in tree at %s.\"),\n+\t\t\t       change, path, o->branch2, change_past,\n+\t\t\t       o->branch1, o->branch1, path, renamed);\n \t\t\tupdate_file(o, 0, a_sha, a_mode, renamed);\n+\t\t}\n \t\t/*\n \t\t * No need to call update_file() on path when !renamed, since\n \t\t * that would needlessly touch path.  We could call\n@@ -1085,7 +1095,7 @@ static void conflict_rename_delete(struct merge_options *o,\n \t\t\t     orig->sha1, orig->mode,\n \t\t\t     a_sha, a_mode,\n \t\t\t     b_sha, b_mode,\n-\t\t\t     \"rename\", \"renamed\");\n+\t\t\t     _(\"rename\"), _(\"renamed\"));\n \n \tif (o->call_depth) {\n \t\tremove_file_from_cache(dest->path);\n@@ -1141,7 +1151,7 @@ static void handle_file(struct merge_options *o,\n \t} else {\n \t\tif (dir_in_way(rename->path, !o->call_depth)) {\n \t\t\tdst_name = unique_path(o, rename->path, cur_branch);\n-\t\t\toutput(o, 1, \"%s is a directory in %s adding as %s instead\",\n+\t\t\toutput(o, 1, _(\"%s is a directory in %s adding as %s instead\"),\n \t\t\t       rename->path, other_branch, dst_name);\n \t\t}\n \t}\n@@ -1163,12 +1173,12 @@ static void conflict_rename_rename_1to2(struct merge_options *o,\n \tstruct diff_filespec *a = ci->pair1->two;\n \tstruct diff_filespec *b = ci->pair2->two;\n \n-\toutput(o, 1, \"CONFLICT (rename/rename): \"\n+\toutput(o, 1, _(\"CONFLICT (rename/rename): \"\n \t       \"Rename \\\"%s\\\"->\\\"%s\\\" in branch \\\"%s\\\" \"\n-\t       \"rename \\\"%s\\\"->\\\"%s\\\" in \\\"%s\\\"%s\",\n+\t       \"rename \\\"%s\\\"->\\\"%s\\\" in \\\"%s\\\"%s\"),\n \t       one->path, a->path, ci->branch1,\n \t       one->path, b->path, ci->branch2,\n-\t       o->call_depth ? \" (left unresolved)\" : \"\");\n+\t       o->call_depth ? _(\" (left unresolved)\") : \"\");\n \tif (o->call_depth) {\n \t\tstruct merge_file_info mfi;\n \t\tstruct diff_filespec other;\n@@ -1222,9 +1232,9 @@ static void conflict_rename_rename_2to1(struct merge_options *o,\n \tstruct merge_file_info mfi_c1;\n \tstruct merge_file_info mfi_c2;\n \n-\toutput(o, 1, \"CONFLICT (rename/rename): \"\n+\toutput(o, 1, _(\"CONFLICT (rename/rename): \"\n \t       \"Rename %s->%s in %s. \"\n-\t       \"Rename %s->%s in %s\",\n+\t       \"Rename %s->%s in %s\"),\n \t       a->path, c1->path, ci->branch1,\n \t       b->path, c2->path, ci->branch2);\n \n@@ -1252,7 +1262,7 @@ static void conflict_rename_rename_2to1(struct merge_options *o,\n \t} else {\n \t\tchar *new_path1 = unique_path(o, path, ci->branch1);\n \t\tchar *new_path2 = unique_path(o, path, ci->branch2);\n-\t\toutput(o, 1, \"Renaming %s to %s and %s to %s instead\",\n+\t\toutput(o, 1, _(\"Renaming %s to %s and %s to %s instead\"),\n \t\t       a->path, new_path1, b->path, new_path2);\n \t\tremove_file(o, 0, path, 0);\n \t\tupdate_file(o, 0, mfi_c1.sha, mfi_c1.mode, new_path1);\n@@ -1451,8 +1461,8 @@ static int process_renames(struct merge_options *o,\n \t\t\t} else if (!sha_eq(dst_other.sha1, null_sha1)) {\n \t\t\t\tclean_merge = 0;\n \t\t\t\ttry_merge = 1;\n-\t\t\t\toutput(o, 1, \"CONFLICT (rename/add): Rename %s->%s in %s. \"\n-\t\t\t\t       \"%s added in %s\",\n+\t\t\t\toutput(o, 1, _(\"CONFLICT (rename/add): Rename %s->%s in %s. \"\n+\t\t\t\t       \"%s added in %s\"),\n \t\t\t\t       ren1_src, ren1_dst, branch1,\n \t\t\t\t       ren1_dst, branch2);\n \t\t\t\tif (o->call_depth) {\n@@ -1461,12 +1471,12 @@ static int process_renames(struct merge_options *o,\n \t\t\t\t\t\t\t ren1->pair->two->sha1, ren1->pair->two->mode,\n \t\t\t\t\t\t\t dst_other.sha1, dst_other.mode,\n \t\t\t\t\t\t\t branch1, branch2);\n-\t\t\t\t\toutput(o, 1, \"Adding merged %s\", ren1_dst);\n+\t\t\t\t\toutput(o, 1, _(\"Adding merged %s\"), ren1_dst);\n \t\t\t\t\tupdate_file(o, 0, mfi.sha, mfi.mode, ren1_dst);\n \t\t\t\t\ttry_merge = 0;\n \t\t\t\t} else {\n \t\t\t\t\tchar *new_path = unique_path(o, ren1_dst, branch2);\n-\t\t\t\t\toutput(o, 1, \"Adding as %s instead\", new_path);\n+\t\t\t\t\toutput(o, 1, _(\"Adding as %s instead\"), new_path);\n \t\t\t\t\tupdate_file(o, 0, dst_other.sha1, dst_other.mode, new_path);\n \t\t\t\t\tfree(new_path);\n \t\t\t\t}\n@@ -1517,10 +1527,10 @@ static int read_sha1_strbuf(const unsigned char *sha1, struct strbuf *dst)\n \tunsigned long size;\n \tbuf = read_sha1_file(sha1, &type, &size);\n \tif (!buf)\n-\t\treturn error(\"cannot read object %s\", sha1_to_hex(sha1));\n+\t\treturn error(_(\"cannot read object %s\"), sha1_to_hex(sha1));\n \tif (type != OBJ_BLOB) {\n \t\tfree(buf);\n-\t\treturn error(\"object %s is not a blob\", sha1_to_hex(sha1));\n+\t\treturn error(_(\"object %s is not a blob\"), sha1_to_hex(sha1));\n \t}\n \tstrbuf_attach(dst, buf, size, size + 1);\n \treturn 0;\n@@ -1568,7 +1578,7 @@ static void handle_modify_delete(struct merge_options *o,\n \t\t\t     o_sha, o_mode,\n \t\t\t     a_sha, a_mode,\n \t\t\t     b_sha, b_mode,\n-\t\t\t     \"modify\", \"modified\");\n+\t\t\t     _(\"modify\"), _(\"modified\"));\n }\n \n static int merge_content(struct merge_options *o,\n@@ -1578,14 +1588,14 @@ static int merge_content(struct merge_options *o,\n \t\t\t unsigned char *b_sha, int b_mode,\n \t\t\t struct rename_conflict_info *rename_conflict_info)\n {\n-\tconst char *reason = \"content\";\n+\tconst char *reason = _(\"content\");\n \tconst char *path1 = NULL, *path2 = NULL;\n \tstruct merge_file_info mfi;\n \tstruct diff_filespec one, a, b;\n \tunsigned df_conflict_remains = 0;\n \n \tif (!o_sha) {\n-\t\treason = \"add/add\";\n+\t\treason = _(\"add/add\");\n \t\to_sha = (unsigned char *)null_sha1;\n \t}\n \tone.path = a.path = b.path = (char *)path;\n@@ -1619,7 +1629,7 @@ static int merge_content(struct merge_options *o,\n \tif (mfi.clean && !df_conflict_remains &&\n \t    sha_eq(mfi.sha, a_sha) && mfi.mode == a_mode) {\n \t\tint path_renamed_outside_HEAD;\n-\t\toutput(o, 3, \"Skipped %s (merged same as existing)\", path);\n+\t\toutput(o, 3, _(\"Skipped %s (merged same as existing)\"), path);\n \t\t/*\n \t\t * The content merge resulted in the same file contents we\n \t\t * already had.  We can return early if those file contents\n@@ -1633,12 +1643,12 @@ static int merge_content(struct merge_options *o,\n \t\t\treturn mfi.clean;\n \t\t}\n \t} else\n-\t\toutput(o, 2, \"Auto-merging %s\", path);\n+\t\toutput(o, 2, _(\"Auto-merging %s\"), path);\n \n \tif (!mfi.clean) {\n \t\tif (S_ISGITLINK(mfi.mode))\n-\t\t\treason = \"submodule\";\n-\t\toutput(o, 1, \"CONFLICT (%s): Merge conflict in %s\",\n+\t\t\treason = _(\"submodule\");\n+\t\toutput(o, 1, _(\"CONFLICT (%s): Merge conflict in %s\"),\n \t\t\t\treason, path);\n \t\tif (rename_conflict_info && !df_conflict_remains)\n \t\t\tupdate_stages(path, &one, &a, &b);\n@@ -1664,7 +1674,7 @@ static int merge_content(struct merge_options *o,\n \n \t\t}\n \t\tnew_path = unique_path(o, path, rename_conflict_info->branch1);\n-\t\toutput(o, 1, \"Adding as %s instead\", new_path);\n+\t\toutput(o, 1, _(\"Adding as %s instead\"), new_path);\n \t\tupdate_file(o, 0, mfi.sha, mfi.mode, new_path);\n \t\tfree(new_path);\n \t\tmfi.clean = 0;\n@@ -1728,7 +1738,7 @@ static int process_entry(struct merge_options *o,\n \t\t\t/* Deleted in both or deleted in one and\n \t\t\t * unchanged in the other */\n \t\t\tif (a_sha)\n-\t\t\t\toutput(o, 2, \"Removing %s\", path);\n+\t\t\t\toutput(o, 2, _(\"Removing %s\"), path);\n \t\t\t/* do not touch working file if it did not exist */\n \t\t\tremove_file(o, 1, path, !a_sha);\n \t\t} else {\n@@ -1753,19 +1763,19 @@ static int process_entry(struct merge_options *o,\n \t\t\tother_branch = o->branch2;\n \t\t\tmode = a_mode;\n \t\t\tsha = a_sha;\n-\t\t\tconf = \"file/directory\";\n+\t\t\tconf = _(\"file/directory\");\n \t\t} else {\n \t\t\tadd_branch = o->branch2;\n \t\t\tother_branch = o->branch1;\n \t\t\tmode = b_mode;\n \t\t\tsha = b_sha;\n-\t\t\tconf = \"directory/file\";\n+\t\t\tconf = _(\"directory/file\");\n \t\t}\n \t\tif (dir_in_way(path, !o->call_depth)) {\n \t\t\tchar *new_path = unique_path(o, path, add_branch);\n \t\t\tclean_merge = 0;\n-\t\t\toutput(o, 1, \"CONFLICT (%s): There is a directory with name %s in %s. \"\n-\t\t\t       \"Adding %s as %s\",\n+\t\t\toutput(o, 1, _(\"CONFLICT (%s): There is a directory with name %s in %s. \"\n+\t\t\t       \"Adding %s as %s\"),\n \t\t\t       conf, path, other_branch, path, new_path);\n \t\t\tif (o->call_depth)\n \t\t\t\tremove_file_from_cache(path);\n@@ -1774,7 +1784,7 @@ static int process_entry(struct merge_options *o,\n \t\t\t\tremove_file_from_cache(path);\n \t\t\tfree(new_path);\n \t\t} else {\n-\t\t\toutput(o, 2, \"Adding %s\", path);\n+\t\t\toutput(o, 2, _(\"Adding %s\"), path);\n \t\t\t/* do not overwrite file if already present */\n \t\t\tupdate_file_flags(o, sha, mode, path, 1, !a_sha);\n \t\t}\n@@ -1791,7 +1801,7 @@ static int process_entry(struct merge_options *o,\n \t\t */\n \t\tremove_file(o, 1, path, !a_mode);\n \t} else\n-\t\tdie(\"Fatal merge failure, shouldn't happen.\");\n+\t\tdie(_(\"Fatal merge failure, shouldn't happen.\"));\n \n \treturn clean_merge;\n }\n@@ -1810,7 +1820,7 @@ int merge_trees(struct merge_options *o,\n \t}\n \n \tif (sha_eq(common->object.sha1, merge->object.sha1)) {\n-\t\toutput(o, 0, \"Already up-to-date!\");\n+\t\toutput(o, 0, _(\"Already up-to-date!\"));\n \t\t*result = head;\n \t\treturn 1;\n \t}\n@@ -1819,7 +1829,7 @@ int merge_trees(struct merge_options *o,\n \n \tif (code != 0) {\n \t\tif (show(o, 4) || o->call_depth)\n-\t\t\tdie(\"merging of trees %s and %s failed\",\n+\t\t\tdie(_(\"merging of trees %s and %s failed\"),\n \t\t\t    sha1_to_hex(head->object.sha1),\n \t\t\t    sha1_to_hex(merge->object.sha1));\n \t\telse\n@@ -1849,7 +1859,7 @@ int merge_trees(struct merge_options *o,\n \t\tfor (i = 0; i < entries->nr; i++) {\n \t\t\tstruct stage_data *e = entries->items[i].util;\n \t\t\tif (!e->processed)\n-\t\t\t\tdie(\"Unprocessed path??? %s\",\n+\t\t\t\tdie(_(\"Unprocessed path??? %s\"),\n \t\t\t\t    entries->items[i].string);\n \t\t}\n \n@@ -1894,7 +1904,7 @@ int merge_recursive(struct merge_options *o,\n \tint clean;\n \n \tif (show(o, 4)) {\n-\t\toutput(o, 4, \"Merging:\");\n+\t\toutput(o, 4, _(\"Merging:\"));\n \t\toutput_commit_title(o, h1);\n \t\toutput_commit_title(o, h2);\n \t}\n@@ -1905,7 +1915,7 @@ int merge_recursive(struct merge_options *o,\n \t}\n \n \tif (show(o, 5)) {\n-\t\toutput(o, 5, \"found %u common ancestor(s):\", commit_list_count(ca));\n+\t\toutput(o, 5, _(\"found %u common ancestor(s):\"), commit_list_count(ca));\n \t\tfor (iter = ca; iter; iter = iter->next)\n \t\t\toutput_commit_title(o, iter->item);\n \t}\n@@ -1941,7 +1951,7 @@ int merge_recursive(struct merge_options *o,\n \t\to->call_depth--;\n \n \t\tif (!merged_common_ancestors)\n-\t\t\tdie(\"merge returned no commit\");\n+\t\t\tdie(_(\"merge returned no commit\"));\n \t}\n \n \tdiscard_cache();\n@@ -1998,7 +2008,7 @@ int merge_recursive_generic(struct merge_options *o,\n \t\tfor (i = 0; i < num_base_list; ++i) {\n \t\t\tstruct commit *base;\n \t\t\tif (!(base = get_ref(base_list[i], sha1_to_hex(base_list[i]))))\n-\t\t\t\treturn error(\"Could not parse object '%s'\",\n+\t\t\t\treturn error(_(\"Could not parse object '%s'\"),\n \t\t\t\t\tsha1_to_hex(base_list[i]));\n \t\t\tcommit_list_insert(base, &ca);\n \t\t}\n@@ -2010,7 +2020,7 @@ int merge_recursive_generic(struct merge_options *o,\n \tif (active_cache_changed &&\n \t\t\t(write_cache(index_fd, active_cache, active_nr) ||\n \t\t\t commit_locked_index(lock)))\n-\t\treturn error(\"Unable to write index.\");\n+\t\treturn error(_(\"Unable to write index.\"));\n \n \treturn clean ? 0 : 1;\n }\n-- \n1.7.11.2.259.g37fc0e1\n"},{"id":"195417","messageId":"500AD6C9.7030802@gmail.com","threadId":"31060","inReplyTo":"a7d2248051ddc62e38e67d9efbb41c01498c7a4c.1342884459.git.worldhello.net@gmail.com","subject":"Re: [PATCH 1/7] i18n: New keywords for xgettext extraction from sh","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2012-07-21T16:20:25Z","receivedAt":"2012-07-21T16:20:25Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 07/21/2012 05:50 PM, Jiang Xin wrote:\n> Since we have additional shell wrappers (gettextln and eval_gettextln)\n> for gettext, we need to take into account these wrapers\n>\ns/wrapers/wrappers/\n\nRegards,\n  Stefano\n"},{"id":"195418","messageId":"500AD774.4030008@gmail.com","threadId":"31060","inReplyTo":"77cbbce0450735a66ef1d9101af0bc82e3fc545c.1342884459.git.worldhello.net@gmail.com","subject":"Re: [PATCH 3/7] i18n: Rewrite gettext messages start with dash","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2012-07-21T16:23:16Z","receivedAt":"2012-07-21T16:23:16Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 07/21/2012 05:50 PM, Jiang Xin wrote:\n> Gettext message in a shell script should not start with '-', one\n> workaround is adding '--' between gettext and the message, like:\n> \n>     gettext -- \"--exec option ...\"\n> \n> But due to a bug in the xgettext extraction, xgettext can not\n> extract the actual message for this case. Rewrite\n>\ns/Rewrite/Rewriting/ I think.\n\n> the message is a simpler and better solution.\n> \n\nRegards,\n  Stefano\n"},{"id":"195419","messageId":"500AD82B.9010604@gmail.com","threadId":"31060","inReplyTo":"941f7bd695e8a14c940a5b8e4214d2773ae82557.1342884459.git.worldhello.net@gmail.com","subject":"Re: [PATCH 4/7] Remove obsolete LONG_USAGE which breaks xgettext","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2012-07-21T16:26:19Z","receivedAt":"2012-07-21T16:26:19Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 07/21/2012 05:50 PM, Jiang Xin wrote:\n> The obsolete LONG_USAGE variable has the following message in it:\n> \n>     A'\\''--B'\\''--C'\\''\n> \n> And such complex LONG_USAGE message will breaks xgettext when extract\n>\ns/extract/extracting/ I think.\n\n> l10n messages. But if remove single quotes from the message,\n>\ns/remove/we remove/; or, if the passive voice is not a problem, you might\nreformulate the sentence as follows:\n\n   But if single quotes are removed from the message, ...\n\n> xgettext works fine on 'git-rebase.sh'.\n> \n> Since there is a mordern\n>\ns/mordern/modern/\n\n\n> OPTIONS_SPEC variable in use in this script,\n> it's safe to remove the obsolte\n>\ns/obsolte/obsolete/\n\n> USAGE and LONG_USAGE variables.\n> \n\nRegards,\n  Stefano\n"},{"id":"195420","messageId":"500AD87C.3010201@gmail.com","threadId":"31060","inReplyTo":"d5c4000b859f4b30af6fc3faec008403b82246bf.1342884459.git.worldhello.net@gmail.com","subject":"Re: [PATCH 5/7] i18n: am: mark more strings for translation","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2012-07-21T16:27:40Z","receivedAt":"2012-07-21T16:27:40Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 07/21/2012 05:50 PM, Jiang Xin wrote:\n> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n> ---\n>  git-am.sh | 11 +++++------\n>  1 file changed, 5 insertions(+), 6 deletions(-)\n> \n> diff --git a/git-am.sh b/git-am.sh\n> index b6a53..20c1a 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -92,7 +92,7 @@ safe_to_abort () {\n>  \tthen\n>  \t\treturn 0\n>  \tfi\n> -\t\tgettextln \"You seem to have moved HEAD since the last 'am' failure.\n> +\tgettextln \"You seem to have moved HEAD since the last 'am' failure.\n>\nSpurious whitespace change?  It certainly is unrelated with what you say in\nthe commit message ...\n\nRegards,\n  Stefano\n"},{"id":"195421","messageId":"500AD8F2.1000101@gmail.com","threadId":"31060","inReplyTo":"d1af1d40b0edbb8e356ecbb700cd0a7c13832a8f.1342884459.git.worldhello.net@gmail.com","subject":"Re: [PATCH 6/7] Remove unused and bad gettext block from git-am","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2012-07-21T16:29:38Z","receivedAt":"2012-07-21T16:29:38Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 07/21/2012 05:50 PM, Jiang Xin wrote:\n> Gettext message\n>\ns/message/messages/ I think.\n\n> should not start with '-' nor '--'. Since the '-d' and\n> '--dotest' options are not exist\n>\ns/are not/do not/\n\n> in OPTIONS_SPEC variable,\n>\ns/OPTIONS_SPEC/the OPTIONS_SPEC/\n\n> so it's safe to remove the block.\n>\nThis \"so\" is redundant, in light of the earlier \"Since\".  I'd just remove it.\n\nRegards,\n  Stefano\n"},{"id":"195434","messageId":"CANYiYbEofo=NrEZ5g7TZpunBsmXMCJFVdkufY5uAOGPgbVTn5Q@mail.gmail.com","threadId":"31060","inReplyTo":"500AD8F2.1000101@gmail.com","subject":"Re: [PATCH 6/7] Remove unused and bad gettext block from git-am","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-07-22T01:33:44Z","receivedAt":"2012-07-22T01:33:44Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2012/7/22 Stefano Lattarini <stefano.lattarini@gmail.com>:\n> s/message/messages/ I think.\n> s/are not/do not/\n> This \"so\" is redundant, in light of the earlier \"Since\".  I'd just remove it.\n\nThanks, Stefano. New series of patches are generated and sent to this list.\n\n-- \nJiang Xin\n"}]}