aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-12-22 11:21:26 -0800
committerJunio C Hamano <gitster@pobox.com>2011-12-22 11:21:26 -0800
commit23cb5bf3b3b9699bf00fa38c4c08f32f8c60b529 (patch)
treee6b40396e1c10c960fd3969951cfe3a20b5457a1 /builtin
parent2ce0edcd786b790fed580e7df56291619834d276 (diff)
downloadgit-23cb5bf3b3b9699bf00fa38c4c08f32f8c60b529.tar.gz
git-23cb5bf3b3b9699bf00fa38c4c08f32f8c60b529.tar.xz
i18n of multi-line advice messages
Advice messages are by definition meant for human end-users, and prime candidates for i18n/l10n. They tend to also be more verbose to be helpful, and need to be longer than just one line. Although we do not have parameterized multi-line advice messages yet, once we do, we cannot emit such a message like this: advise(_("Please rename %s to something else"), gostak); advise(_("so that we can avoid distimming %s unnecessarily."), doshes); because some translations may need to have the replacement of 'gostak' on the second line (or 'doshes' on the first line). Some languages may even need to use three lines in order to fit the same message within a reasonable width. Instead, it has to be a single advise() construct, like this: advise(_("Please rename %s to something else\n" "so that we can avoid distimming %s unnecessarily."), gostak, doshes); Update the advise() function and its existing callers to - take a format string that can be multi-line and translatable as a whole; - use the string and the parameters to form a localized message; and - show each line in the result with the localization of the "hint: ". Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/revert.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index 1ea525c10..3ad14a1f9 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -332,11 +332,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)