Merge branch 'nd/i18n' into next

More message strings marked for i18n.

By Nguyễn Thái Ngọc Duy
* nd/i18n:
  help: replace underlining "help -a" headers using hyphens with a blank line
This commit is contained in:
Junio C Hamano
2012-04-30 14:56:15 -07:00
3 changed files with 5 additions and 16 deletions

View File

@@ -425,7 +425,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)
if (show_all) {
printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
list_commands(_("git commands"), &main_cmds, &other_cmds);
list_commands(&main_cmds, &other_cmds);
printf("%s\n", _(git_more_info_string));
return 0;
}

16
help.c
View File

@@ -203,8 +203,7 @@ void load_command_list(const char *prefix,
exclude_cmds(other_cmds, main_cmds);
}
void list_commands(const char *title, struct cmdnames *main_cmds,
struct cmdnames *other_cmds)
void list_commands(struct cmdnames *main_cmds, struct cmdnames *other_cmds)
{
int i, longest = 0;
@@ -217,23 +216,14 @@ void list_commands(const char *title, struct cmdnames *main_cmds,
if (main_cmds->cnt) {
const char *exec_path = git_exec_path();
printf_ln(_("available %s in '%s'"), title, exec_path);
/* TRANSLATORS: this must align with "available %s in '%s'" */
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, longest);
putchar('\n');
}
if (other_cmds->cnt) {
printf_ln(_("%s available from elsewhere on your $PATH"), title);
/* TRANSLATORS:
* this must align with
* "%s available from elsewhere on your $PATH"
*/
printf(_("---------------------------------------"));
mput_char('-', strlen(title));
printf_ln(_("git commands available from elsewhere on your $PATH"));
putchar('\n');
pretty_print_string_list(other_cmds, longest);
putchar('\n');

3
help.h
View File

@@ -25,8 +25,7 @@ extern void add_cmdname(struct cmdnames *cmds, const char *name, int len);
/* Here we require that excludes is a sorted list. */
extern void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes);
extern int is_in_cmdlist(struct cmdnames *cmds, const char *name);
extern void list_commands(const char *title,
struct cmdnames *main_cmds,
extern void list_commands(struct cmdnames *main_cmds,
struct cmdnames *other_cmds);
#endif /* HELP_H */