Skip to content

Commit

Permalink
i18n: apply: split to fix a partial i18n message
Browse files Browse the repository at this point in the history
The 4th arg of "new mode (%o) of %s does not match old mode (%o)%s%s"
is blank string or string " of ". Even mark the string " of " for a
complete i18n, this message is still hard to translate right.

Split it into two slight different messages would make l10n teams happy.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jiang Xin authored and Junio C Hamano committed Jun 1, 2012
1 parent b2478aa commit f50b565
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions builtin/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -3262,10 +3262,18 @@ static int check_patch(struct patch *patch)
int same = !strcmp(old_name, new_name);
if (!patch->new_mode)
patch->new_mode = patch->old_mode;
if ((patch->old_mode ^ patch->new_mode) & S_IFMT)
return error(_("new mode (%o) of %s does not match old mode (%o)%s%s"),
patch->new_mode, new_name, patch->old_mode,
same ? "" : " of ", same ? "" : old_name);
if ((patch->old_mode ^ patch->new_mode) & S_IFMT) {
if (same)
return error(_("new mode (%o) of %s does not "
"match old mode (%o)"),
patch->new_mode, new_name,
patch->old_mode);
else
return error(_("new mode (%o) of %s does not "
"match old mode (%o) of %s"),
patch->new_mode, new_name,
patch->old_mode, old_name);
}
}

if (apply_data(patch, &st, ce) < 0)
Expand Down

0 comments on commit f50b565

Please sign in to comment.