зеркало из https://github.com/microsoft/git.git
Merge branch 'jc/advise-i18n'
* jc/advise-i18n: i18n of multi-line advice messages
This commit is contained in:
Коммит
87a23e77c6
23
advice.c
23
advice.c
|
@ -21,11 +21,21 @@ static struct {
|
||||||
|
|
||||||
void advise(const char *advice, ...)
|
void advise(const char *advice, ...)
|
||||||
{
|
{
|
||||||
|
struct strbuf buf = STRBUF_INIT;
|
||||||
va_list params;
|
va_list params;
|
||||||
|
const char *cp, *np;
|
||||||
|
|
||||||
va_start(params, advice);
|
va_start(params, advice);
|
||||||
vreportf("hint: ", advice, params);
|
strbuf_addf(&buf, advice, params);
|
||||||
va_end(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)
|
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)
|
int error_resolve_conflict(const char *me)
|
||||||
{
|
{
|
||||||
error("'%s' is not possible because you have unmerged files.", 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
|
* Message used both when 'git commit' fails and when
|
||||||
* other commands doing a merge do.
|
* other commands doing a merge do.
|
||||||
*/
|
*/
|
||||||
advise("Fix them up in the work tree,");
|
advise(_("Fix them up in the work tree,\n"
|
||||||
advise("and then use 'git add/rm <file>' as");
|
"and then use 'git add/rm <file>' as\n"
|
||||||
advise("appropriate to mark resolution and make a commit,");
|
"appropriate to mark resolution and make a commit,\n"
|
||||||
advise("or use 'git commit -a'.");
|
"or use 'git commit -a'."));
|
||||||
}
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -343,11 +343,10 @@ static void print_advice(int show_hint)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (show_hint) {
|
if (show_hint)
|
||||||
advise("after resolving the conflicts, mark the corrected paths");
|
advise(_("after resolving the conflicts, mark the corrected paths\n"
|
||||||
advise("with 'git add <paths>' or 'git rm <paths>'");
|
"with 'git add <paths>' or 'git rm <paths>'\n"
|
||||||
advise("and commit the result with 'git commit'");
|
"and commit the result with 'git commit'"));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_message(struct strbuf *msgbuf, const char *filename)
|
static void write_message(struct strbuf *msgbuf, const char *filename)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче