aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-04-08 12:07:06 -0700
committerJunio C Hamano <gitster@pobox.com>2014-04-08 12:07:06 -0700
commit360f852d249f365009b63cab70b50d6f5b5c65e7 (patch)
treeb06a0709420c771a91b6b1d9b5f68e678e09ef79
parent86b4c1639c4a44fa8c10a7c438c5af24ca87e2a9 (diff)
parent7a76c28ff29d6f819bb0bf9852b858f974b5c53a (diff)
downloadgit-360f852d249f365009b63cab70b50d6f5b5c65e7.tar.gz
Merge branch 'mm/status-porcelain-format-i18n-fix' into maint
* mm/status-porcelain-format-i18n-fix: status: disable translation when --porcelain is used
-rw-r--r--wt-status.c13
-rw-r--r--wt-status.h1
2 files changed, 9 insertions, 5 deletions
diff --git a/wt-status.c b/wt-status.c
index c89c3bb537..9bf96c3af0 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1542,19 +1542,21 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
return;
}
+#define LABEL(string) (s->no_gettext ? (string) : _(string))
+
color_fprintf(s->fp, header_color, " [");
if (upstream_is_gone) {
- color_fprintf(s->fp, header_color, _("gone"));
+ color_fprintf(s->fp, header_color, LABEL(N_("gone")));
} else if (!num_ours) {
- color_fprintf(s->fp, header_color, _("behind "));
+ color_fprintf(s->fp, header_color, LABEL(N_("behind ")));
color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
} else if (!num_theirs) {
- color_fprintf(s->fp, header_color, _("ahead "));
+ color_fprintf(s->fp, header_color, LABEL(N_(("ahead "))));
color_fprintf(s->fp, branch_color_local, "%d", num_ours);
} else {
- color_fprintf(s->fp, header_color, _("ahead "));
+ color_fprintf(s->fp, header_color, LABEL(N_(("ahead "))));
color_fprintf(s->fp, branch_color_local, "%d", num_ours);
- color_fprintf(s->fp, header_color, _(", behind "));
+ color_fprintf(s->fp, header_color, ", %s", LABEL(N_("behind ")));
color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
}
@@ -1599,5 +1601,6 @@ void wt_porcelain_print(struct wt_status *s)
s->use_color = 0;
s->relative_paths = 0;
s->prefix = NULL;
+ s->no_gettext = 1;
wt_shortstatus_print(s);
}
diff --git a/wt-status.h b/wt-status.h
index 30a4812583..82f6ce64f8 100644
--- a/wt-status.h
+++ b/wt-status.h
@@ -50,6 +50,7 @@ struct wt_status {
enum commit_whence whence;
int nowarn;
int use_color;
+ int no_gettext;
int display_comment_prefix;
int relative_paths;
int submodule_summary;