Merge branch 'mm/status-porcelain-format-i18n-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 31 Mar 2014 23:31:25 +0000 (16:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 31 Mar 2014 23:31:25 +0000 (16:31 -0700)
* mm/status-porcelain-format-i18n-fix:
status: disable translation when --porcelain is used

wt-status.c
wt-status.h
index e1827faf073ce384bea6a697dd903ffc643bdfdc..ec7344e50834f18821692d7e38f634778d632080 100644 (file)
@@ -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);
 }
index b56ce3f0355f3a1e188c7d9bd44ea90f0d06d76f..283a9fef0335ce272c6799a5af17274e4798e15f 100644 (file)
@@ -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;