i18n: git-reset reset_type_names messages
Make the messages in git-reset that use the reset_type_names static array to be translatable by marking the array items with N_() and using _() later. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Feb 22, 2011 at 23:42 UTC
8b2a57b6c8711b7189184e4670d378d8418f7214
1 file changed
+7
-7
builtin/reset.c
+7
-7
@@ -30,7 +30,7 @@ static const char * const git_reset_usage[] = {
30
31
enum reset_type { MIXED, SOFT, HARD, MERGE, KEEP, NONE };
32
static const char *reset_type_names[] = {
33
- "mixed", "soft", "hard", "merge", "keep", NULL
33
+ N_("mixed"), N_("soft"), N_("hard"), N_("merge"), N_("keep"), NULL
34
};
35
36
static char *args_to_str(const char **argv)
@@ -228,8 +228,8 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)
228
static void die_if_unmerged_cache(int reset_type)
229
{
230
if (is_merge() || read_cache() < 0 || unmerged_cache())
231
- die("Cannot do a %s reset in the middle of a merge.",
232
- reset_type_names[reset_type]);
231
+ die(_("Cannot do a %s reset in the middle of a merge."),
232
+ _(reset_type_names[reset_type]));
233
234
}
235
@@ -320,8 +320,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
320
if (reset_type == MIXED)
321
warning(_("--mixed with paths is deprecated; use 'git reset -- <paths>' instead."));
322
else if (reset_type != NONE)
323
- die("Cannot do %s reset with paths.",
324
- reset_type_names[reset_type]);
323
+ die(_("Cannot do %s reset with paths."),
324
+ _(reset_type_names[reset_type]));
325
return read_from_tree(prefix, argv + i, sha1,
326
quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
327
}
@@ -332,8 +332,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
332
setup_work_tree();
333
334
if (reset_type == MIXED && is_bare_repository())
335
- die("%s reset is not allowed in a bare repository",
336
- reset_type_names[reset_type]);
335
+ die(_("%s reset is not allowed in a bare repository"),
336
+ _(reset_type_names[reset_type]));
337
338
/* Soft reset does not touch the index file nor the working tree
339
* at all, but requires them in a good order. Other resets reset