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 <worldhello.net@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin committed
May 31, 2012 at 19:20 UTC
f50b565a0f3af5a4045d0e713ac43e3f0de3aa9a
1 file changed
+12
-4
builtin/apply.c
+12
-4
@@ -3262,10 +3262,18 @@ static int check_patch(struct patch *patch)
3262
int same = !strcmp(old_name, new_name);
3263
if (!patch->new_mode)
3264
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
+ }
3277
}
3278
3279
if (apply_data(patch, &st, ce) < 0)