diff options
Diffstat (limited to 'help.c')
-rw-r--r-- | help.c | 29 |
1 files changed, 14 insertions, 15 deletions
@@ -199,23 +199,19 @@ void load_command_list(const char *prefix, exclude_cmds(other_cmds, main_cmds); } -void list_commands(const char *title, unsigned int colopts, +void list_commands(unsigned int colopts, struct cmdnames *main_cmds, struct cmdnames *other_cmds) { if (main_cmds->cnt) { const char *exec_path = git_exec_path(); - printf("available %s in '%s'\n", title, exec_path); - printf("----------------"); - mput_char('-', strlen(title) + strlen(exec_path)); + printf_ln(_("available git commands in '%s'"), exec_path); putchar('\n'); pretty_print_string_list(main_cmds, colopts); putchar('\n'); } if (other_cmds->cnt) { - printf("%s available from elsewhere on your $PATH\n", title); - printf("---------------------------------------"); - mput_char('-', strlen(title)); + printf_ln(_("git commands available from elsewhere on your $PATH")); putchar('\n'); pretty_print_string_list(other_cmds, colopts); putchar('\n'); @@ -328,7 +324,7 @@ const char *help_unknown_cmd(const char *cmd) sizeof(*main_cmds.names), levenshtein_compare); if (!main_cmds.cnt) - die ("Uh oh. Your system reports no Git commands at all."); + die(_("Uh oh. Your system reports no Git commands at all.")); /* skip and count prefix matches */ for (n = 0; n < main_cmds.cnt && !main_cmds.names[n]->len; n++) @@ -349,23 +345,26 @@ const char *help_unknown_cmd(const char *cmd) const char *assumed = main_cmds.names[0]->name; main_cmds.names[0] = NULL; clean_cmdnames(&main_cmds); - fprintf(stderr, "WARNING: You called a Git command named '%s', " - "which does not exist.\n" - "Continuing under the assumption that you meant '%s'\n", + fprintf_ln(stderr, + _("WARNING: You called a Git command named '%s', " + "which does not exist.\n" + "Continuing under the assumption that you meant '%s'"), cmd, assumed); if (autocorrect > 0) { - fprintf(stderr, "in %0.1f seconds automatically...\n", + fprintf_ln(stderr, _("in %0.1f seconds automatically..."), (float)autocorrect/10.0); poll(NULL, 0, autocorrect * 100); } return assumed; } - fprintf(stderr, "git: '%s' is not a git command. See 'git --help'.\n", cmd); + fprintf_ln(stderr, _("git: '%s' is not a git command. See 'git --help'."), cmd); if (SIMILAR_ENOUGH(best_similarity)) { - fprintf(stderr, "\nDid you mean %s?\n", - n < 2 ? "this": "one of these"); + fprintf_ln(stderr, + Q_("\nDid you mean this?", + "\nDid you mean one of these?", + n)); for (i = 0; i < n; i++) fprintf(stderr, "\t%s\n", main_cmds.names[i]->name); |