diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-03-31 16:31:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-31 16:31:25 -0700 |
commit | 4ab9211ac28a39f275db92ca1b91f638538c7e43 (patch) | |
tree | 3909a302ac6fd4743919883524c6d2b01a13b670 /wt-status.c | |
parent | 1d9aaed2fa43dde6ea223b42c0a1a5a714343988 (diff) | |
parent | 7a76c28ff29d6f819bb0bf9852b858f974b5c53a (diff) | |
download | git-4ab9211ac28a39f275db92ca1b91f638538c7e43.tar.gz |
Merge branch 'mm/status-porcelain-format-i18n-fix'
* mm/status-porcelain-format-i18n-fix:
status: disable translation when --porcelain is used
Diffstat (limited to 'wt-status.c')
-rw-r--r-- | wt-status.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/wt-status.c b/wt-status.c index e1827faf07..ec7344e508 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1547,19 +1547,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); } @@ -1604,5 +1606,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); } |