Skip to content

Commit

Permalink
Merge branch 'mm/status-porcelain-format-i18n-fix' into maint
Browse files Browse the repository at this point in the history
* mm/status-porcelain-format-i18n-fix:
  status: disable translation when --porcelain is used
  • Loading branch information
Junio C Hamano committed Apr 8, 2014
2 parents 86b4c16 + 7a76c28 commit 360f852
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions wt-status.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}
1 change: 1 addition & 0 deletions wt-status.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 360f852

Please sign in to comment.