summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-20 22:25:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-03-20 22:25:38 (GMT)
commit39af78961d8e7f4c0aee73e77e9eb5b6033f79c2 (patch)
tree03df3de35df25fa5aae34b993fb7da8eb383a462
parentbd193f46b70fd3f8a55e2a8dcbb1fb2b4eec13d6 (diff)
parent23cb5bf3b3b9699bf00fa38c4c08f32f8c60b529 (diff)
downloadgit-39af78961d8e7f4c0aee73e77e9eb5b6033f79c2.zip
git-39af78961d8e7f4c0aee73e77e9eb5b6033f79c2.tar.gz
git-39af78961d8e7f4c0aee73e77e9eb5b6033f79c2.tar.bz2
Merge branch 'jc/advise-i18n' into maint-1.7.8
* jc/advise-i18n: i18n of multi-line advice messages
-rw-r--r--advice.c23
-rw-r--r--builtin/revert.c9
2 files changed, 20 insertions, 12 deletions
diff --git a/advice.c b/advice.c
index e02e632..65a0785 100644
--- a/advice.c
+++ b/advice.c
@@ -21,11 +21,21 @@ static struct {
void advise(const char *advice, ...)
{
+ struct strbuf buf = STRBUF_INIT;
va_list params;
+ const char *cp, *np;
va_start(params, advice);
- vreportf("hint: ", advice, params);
+ strbuf_addf(&buf, advice, params);
va_end(params);
+
+ for (cp = buf.buf; *cp; cp = np) {
+ np = strchrnul(cp, '\n');
+ fprintf(stderr, _("hint: %.*s\n"), (int)(np - cp), cp);
+ if (*np)
+ np++;
+ }
+ strbuf_release(&buf);
}
int git_default_advice_config(const char *var, const char *value)
@@ -46,16 +56,15 @@ int git_default_advice_config(const char *var, const char *value)
int error_resolve_conflict(const char *me)
{
error("'%s' is not possible because you have unmerged files.", me);
- if (advice_resolve_conflict) {
+ if (advice_resolve_conflict)
/*
* Message used both when 'git commit' fails and when
* other commands doing a merge do.
*/
- advise("Fix them up in the work tree,");
- advise("and then use 'git add/rm <file>' as");
- advise("appropriate to mark resolution and make a commit,");
- advise("or use 'git commit -a'.");
- }
+ advise(_("Fix them up in the work tree,\n"
+ "and then use 'git add/rm <file>' as\n"
+ "appropriate to mark resolution and make a commit,\n"
+ "or use 'git commit -a'."));
return -1;
}
diff --git a/builtin/revert.c b/builtin/revert.c
index 028bcbc..00df526 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -343,11 +343,10 @@ static void print_advice(int show_hint)
return;
}
- if (show_hint) {
- advise("after resolving the conflicts, mark the corrected paths");
- advise("with 'git add <paths>' or 'git rm <paths>'");
- advise("and commit the result with 'git commit'");
- }
+ if (show_hint)
+ advise(_("after resolving the conflicts, mark the corrected paths\n"
+ "with 'git add <paths>' or 'git rm <paths>'\n"
+ "and commit the result with 'git commit'"));
}
static void write_message(struct strbuf *msgbuf, const char *filename)