summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-31 19:00:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-31 19:00:27 (GMT)
commitdd4c0ce908f4ea89375aefb5566d4bf9ec21db5c (patch)
tree1a1c1787a30292b22b8b6247074932108ac2e1a6 /builtin
parentb3c89315a33fbded4a8c5d533ca8ddc6087e4c23 (diff)
parentc9ea118e75b1b8f8cc744e372576b4cf63594e0d (diff)
downloadgit-dd4c0ce908f4ea89375aefb5566d4bf9ec21db5c.zip
git-dd4c0ce908f4ea89375aefb5566d4bf9ec21db5c.tar.gz
git-dd4c0ce908f4ea89375aefb5566d4bf9ec21db5c.tar.bz2
Merge branch 'ab/i18n-fixup' into maint
* ab/i18n-fixup: (24 commits) i18n: use test_i18n{cmp,grep} in t7600, t7607, t7611 and t7811 i18n: use test_i18n{grep,cmp} in t7508 i18n: use test_i18ngrep in t7506 i18n: use test_i18ngrep and test_i18ncmp in t7502 i18n: use test_i18ngrep in t7501 i18n: use test_i18ncmp in t7500 i18n: use test_i18ngrep in t7201 i18n: use test_i18ncmp and test_i18ngrep in t7102 and t7110 i18n: use test_i18ncmp and test_i18ngrep in t5541, t6040, t6120, t7004, t7012 and t7060 i18n: use test_i18ncmp and test_i18ngrep in t3700, t4001 and t4014 i18n: use test_i18ncmp and test_i18ngrep in t3203, t3501 and t3507 i18n: use test_i18ngrep in t2020, t2204, t3030, and t3200 i18n: use test_i18ngrep in lib-httpd and t2019 i18n: do not overuse C_LOCALE_OUTPUT (grep) i18n: use test_i18ncmp in t1200 and t2200 i18n: .git file is not a human readable message (t5601) i18n: do not overuse C_LOCALE_OUTPUT i18n: mark init-db messages for translation i18n: mark checkout plural warning for translation i18n: mark checkout --detach messages for translation ...
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c24
-rw-r--r--builtin/clone.c2
-rw-r--r--builtin/init-db.c10
-rw-r--r--builtin/merge.c16
4 files changed, 32 insertions, 20 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index eece5d6..38632fc 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -648,18 +648,30 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
if (more == 1)
describe_one_orphan(&sb, last);
else
- strbuf_addf(&sb, " ... and %d more.\n", more);
+ strbuf_addf(&sb, _(" ... and %d more.\n"), more);
}
fprintf(stderr,
- "Warning: you are leaving %d commit%s behind, "
+ Q_(
+ /* The singular version */
+ "Warning: you are leaving %d commit behind, "
+ "not connected to\n"
+ "any of your branches:\n\n"
+ "%s\n"
+ "If you want to keep it by creating a new branch, "
+ "this may be a good time\nto do so with:\n\n"
+ " git branch new_branch_name %s\n\n",
+ /* The plural version */
+ "Warning: you are leaving %d commits behind, "
"not connected to\n"
"any of your branches:\n\n"
"%s\n"
"If you want to keep them by creating a new branch, "
"this may be a good time\nto do so with:\n\n"
" git branch new_branch_name %s\n\n",
- lost, ((1 < lost) ? "s" : ""),
+ /* Give ngettext() the count */
+ lost),
+ lost,
sb.buf,
sha1_to_hex(commit->object.sha1));
strbuf_release(&sb);
@@ -961,9 +973,9 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
die (_("--patch is incompatible with all other options"));
if (opts.force_detach && (opts.new_branch || opts.new_orphan_branch))
- die("--detach cannot be used with -b/-B/--orphan");
+ die(_("--detach cannot be used with -b/-B/--orphan"));
if (opts.force_detach && 0 < opts.track)
- die("--detach cannot be used with -t");
+ die(_("--detach cannot be used with -t"));
/* --track without -b should DWIM */
if (0 < opts.track && !opts.new_branch) {
@@ -1043,7 +1055,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
}
if (opts.force_detach)
- die("git checkout: --detach does not take a path argument");
+ die(_("git checkout: --detach does not take a path argument"));
if (1 < !!opts.writeout_stage + !!opts.force + !!opts.merge)
die(_("git checkout: --ours/--theirs, --force and --merge are incompatible when\nchecking out of the index."));
diff --git a/builtin/clone.c b/builtin/clone.c
index 8560cf8..f579794 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -417,7 +417,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (path)
repo = xstrdup(absolute_path(repo_name));
else if (!strchr(repo_name, ':'))
- die("repository '%s' does not exist", repo_name);
+ die(_("repository '%s' does not exist"), repo_name);
else
repo = repo_name;
is_local = path && !is_bundle;
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 7d8ff09..025aa47 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -319,10 +319,10 @@ int set_git_dir_init(const char *git_dir, const char *real_git_dir,
struct stat st;
if (!exist_ok && !stat(git_dir, &st))
- die("%s already exists", git_dir);
+ die(_("%s already exists"), git_dir);
if (!exist_ok && !stat(real_git_dir, &st))
- die("%s already exists", real_git_dir);
+ die(_("%s already exists"), real_git_dir);
/*
* make sure symlinks are resolved because we'll be
@@ -351,15 +351,15 @@ static void separate_git_dir(const char *git_dir)
else if (S_ISDIR(st.st_mode))
src = git_link;
else
- die("unable to handle file type %d", st.st_mode);
+ die(_("unable to handle file type %d"), st.st_mode);
if (rename(src, git_dir))
- die_errno("unable to move %s to %s", src, git_dir);
+ die_errno(_("unable to move %s to %s"), src, git_dir);
}
fp = fopen(git_link, "w");
if (!fp)
- die("Could not create git link %s", git_link);
+ die(_("Could not create git link %s"), git_link);
fprintf(fp, "gitdir: %s\n", git_dir);
fclose(fp);
}
diff --git a/builtin/merge.c b/builtin/merge.c
index a437ecb..24445f4 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -839,7 +839,7 @@ static void read_merge_msg(void)
{
strbuf_reset(&merge_msg);
if (strbuf_read_file(&merge_msg, git_path("MERGE_MSG"), 0) < 0)
- die_errno("Could not read from '%s'", git_path("MERGE_MSG"));
+ die_errno(_("Could not read from '%s'"), git_path("MERGE_MSG"));
}
static void run_prepare_commit_msg(void)
@@ -979,16 +979,16 @@ static int setup_with_upstream(const char ***argv)
const char **args;
if (!branch)
- die("No current branch.");
+ die(_("No current branch."));
if (!branch->remote)
- die("No remote for the current branch.");
+ die(_("No remote for the current branch."));
if (!branch->merge_nr)
- die("No default upstream defined for the current branch.");
+ die(_("No default upstream defined for the current branch."));
args = xcalloc(branch->merge_nr + 1, sizeof(char *));
for (i = 0; i < branch->merge_nr; i++) {
if (!branch->merge[i]->dst)
- die("No remote tracking branch for %s from %s",
+ die(_("No remote tracking branch for %s from %s"),
branch->merge[i]->src, branch->remote_name);
args[i] = branch->merge[i]->dst;
}
@@ -1062,10 +1062,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
}
if (file_exists(git_path("CHERRY_PICK_HEAD"))) {
if (advice_resolve_conflict)
- die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
- "Please, commit your changes before you can merge.");
+ die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
+ "Please, commit your changes before you can merge."));
else
- die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).");
+ die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."));
}
resolve_undo_clear();