Skip to content

Commit f50b565

Browse files
jiangxingitster
authored andcommitted
i18n: apply: split to fix a partial i18n message
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b2478aa commit f50b565

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

builtin/apply.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,10 +3262,18 @@ static int check_patch(struct patch *patch)
32623262
int same = !strcmp(old_name, new_name);
32633263
if (!patch->new_mode)
32643264
patch->new_mode = patch->old_mode;
3265-
if ((patch->old_mode ^ patch->new_mode) & S_IFMT)
3266-
return error(_("new mode (%o) of %s does not match old mode (%o)%s%s"),
3267-
patch->new_mode, new_name, patch->old_mode,
3268-
same ? "" : " of ", same ? "" : old_name);
3265+
if ((patch->old_mode ^ patch->new_mode) & S_IFMT) {
3266+
if (same)
3267+
return error(_("new mode (%o) of %s does not "
3268+
"match old mode (%o)"),
3269+
patch->new_mode, new_name,
3270+
patch->old_mode);
3271+
else
3272+
return error(_("new mode (%o) of %s does not "
3273+
"match old mode (%o) of %s"),
3274+
patch->new_mode, new_name,
3275+
patch->old_mode, old_name);
3276+
}
32693277
}
32703278

32713279
if (apply_data(patch, &st, ce) < 0)

0 commit comments

Comments
 (0)