From: Junio C Hamano Date: Fri, 6 Mar 2015 23:02:29 +0000 (-0800) Subject: Merge branch 'ja/clean-confirm-i18n' X-Git-Tag: v2.4.0-rc0~57 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/83ac11fac4a71be40b6397763f685f49a39718be?ds=inline;hp=-c Merge branch 'ja/clean-confirm-i18n' The prompt string "remove?" used when "git clean -i" asks the user if a path should be removed was localizable, but the code always expects a substring of "yes" to tell it to go ahead. Always show [y/N] as part of this prompt to hint that the answer is not (yet) localized. * ja/clean-confirm-i18n: Add hint interactive cleaning --- 83ac11fac4a71be40b6397763f685f49a39718be diff --combined builtin/clean.c index 7e7fdcfe54,15b378bde3..98c103fa8b --- a/builtin/clean.c +++ b/builtin/clean.c @@@ -67,7 -67,7 +67,7 @@@ struct menu_item char hotkey; const char *title; int selected; - int (*fn)(); + int (*fn)(void); }; enum menu_stuff_type { @@@ -100,8 -100,6 +100,8 @@@ static int parse_clean_color_slot(cons static int git_clean_config(const char *var, const char *value, void *cb) { + const char *slot_name; + if (starts_with(var, "column.")) return git_column_config(var, value, "clean", &colopts); @@@ -111,13 -109,15 +111,13 @@@ clean_use_color = git_config_colorbool(var, value); return 0; } - if (starts_with(var, "color.interactive.")) { - int slot = parse_clean_color_slot(var + - strlen("color.interactive.")); + if (skip_prefix(var, "color.interactive.", &slot_name)) { + int slot = parse_clean_color_slot(slot_name); if (slot < 0) return 0; if (!value) return config_error_nonbool(var); - color_parse(value, var, clean_colors[slot]); - return 0; + return color_parse(value, clean_colors[slot]); } if (!strcmp(var, "clean.requireforce")) { @@@ -321,7 -321,7 +321,7 @@@ static void print_highlight_menu_stuff( switch (stuff->type) { default: - die("Bad type of menu_staff when print menu"); + die("Bad type of menu_stuff when print menu"); case MENU_STUFF_TYPE_MENU_ITEM: menu_item = (struct menu_item *)stuff->stuff; for (i = 0; i < stuff->nr; i++, menu_item++) { @@@ -754,7 -754,8 +754,8 @@@ static int ask_each_cmd(void /* Ctrl-D should stop removing files */ if (!eof) { qname = quote_path_relative(item->string, NULL, &buf); - printf(_("remove %s? "), qname); + /* TRANSLATORS: Make sure to keep [y/N] as is */ + printf(_("Remove %s [y/N]? "), qname); if (strbuf_getline(&confirm, stdin, '\n') != EOF) { strbuf_trim(&confirm); } else {