Merge branch 'ja/clean-confirm-i18n'
authorJunio C Hamano <gitster@pobox.com>
Fri, 6 Mar 2015 23:02:29 +0000 (15:02 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Mar 2015 23:02:30 +0000 (15:02 -0800)
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

1  2 
builtin/clean.c
diff --combined builtin/clean.c
index 7e7fdcfe54a547c90a5a6911eb59b0ec22151ac6,15b378bde3287c114d675d2fca7622c73f1bbe0a..98c103fa8b4faa83c33a62e5d7871c1e9d888c38
@@@ -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);
  
                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 {