0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.1.0306: plural messages are not translated properly

Problem:    Plural messages are not translated properly.
Solution:   Add more usage of NGETTEXT(). (Sergey Alyoshin)
This commit is contained in:
Bram Moolenaar
2018-08-21 15:12:14 +02:00
parent 830e3583da
commit da6e8919e7
8 changed files with 79 additions and 128 deletions

View File

@@ -244,7 +244,6 @@ op_shift(oparg_T *oap, int curs_top, int amount)
{
long i;
int first_char;
char_u *s;
int block_col = 0;
if (u_save((linenr_T)(oap->start.lnum - 1),
@@ -297,26 +296,21 @@ op_shift(oparg_T *oap, int curs_top, int amount)
if (oap->line_count > p_report)
{
char *op;
char *msg_line_single;
char *msg_line_plural;
if (oap->op_type == OP_RSHIFT)
s = (char_u *)">";
op = ">";
else
s = (char_u *)"<";
if (oap->line_count == 1)
{
if (amount == 1)
sprintf((char *)IObuff, _("1 line %sed 1 time"), s);
else
sprintf((char *)IObuff, _("1 line %sed %d times"), s, amount);
}
else
{
if (amount == 1)
sprintf((char *)IObuff, _("%ld lines %sed 1 time"),
oap->line_count, s);
else
sprintf((char *)IObuff, _("%ld lines %sed %d times"),
oap->line_count, s, amount);
}
op = "<";
msg_line_single = NGETTEXT("%ld line %sed %d time",
"%ld line %sed %d times", amount);
msg_line_plural = NGETTEXT("%ld lines %sed %d time",
"%ld lines %sed %d times", amount);
vim_snprintf((char *)IObuff, IOSIZE,
NGETTEXT(msg_line_single, msg_line_plural, oap->line_count),
oap->line_count, op, amount);
msg(IObuff);
}
@@ -789,10 +783,8 @@ op_reindent(oparg_T *oap, int (*how)(void))
if (oap->line_count > p_report)
{
i = oap->line_count - (i + 1);
if (i == 1)
MSG(_("1 line indented "));
else
smsg((char_u *)_("%ld lines indented "), i);
smsg((char_u *)NGETTEXT("%ld line indented ",
"%ld lines indented ", i), i);
}
/* set '[ and '] marks */
curbuf->b_op_start = oap->start;
@@ -2529,12 +2521,8 @@ op_tilde(oparg_T *oap)
curbuf->b_op_end = oap->end;
if (oap->line_count > p_report)
{
if (oap->line_count == 1)
MSG(_("1 line changed"));
else
smsg((char_u *)_("%ld lines changed"), oap->line_count);
}
smsg((char_u *)NGETTEXT("%ld line changed", "%ld lines changed",
oap->line_count), oap->line_count);
}
/*
@@ -3348,19 +3336,18 @@ op_yank(oparg_T *oap, int deleting, int mess)
/* redisplay now, so message is not deleted */
update_topline_redraw();
if (yanklines == 1)
if (oap->block_mode)
{
if (oap->block_mode)
smsg((char_u *)_("block of 1 line yanked%s"), namebuf);
else
smsg((char_u *)_("1 line yanked%s"), namebuf);
smsg((char_u *)NGETTEXT("block of %ld line yanked%s",
"block of %ld lines yanked%s", yanklines),
yanklines, namebuf);
}
else if (oap->block_mode)
smsg((char_u *)_("block of %ld lines yanked%s"),
yanklines, namebuf);
else
smsg((char_u *)_("%ld lines yanked%s"), yanklines,
namebuf);
{
smsg((char_u *)NGETTEXT("%ld line yanked%s",
"%ld lines yanked%s", yanklines),
yanklines, namebuf);
}
}
}
@@ -5653,12 +5640,8 @@ op_addsub(
curbuf->b_op_start = startpos;
if (change_cnt > p_report)
{
if (change_cnt == 1)
MSG(_("1 line changed"));
else
smsg((char_u *)_("%ld lines changed"), change_cnt);
}
smsg((char_u *)NGETTEXT("%ld line changed", "%ld lines changed",
change_cnt), change_cnt);
}
}