0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -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

@@ -985,12 +985,8 @@ do_move(linenr_T line1, linenr_T line2, linenr_T dest)
ml_delete(line1 + extra, TRUE);
if (!global_busy && num_lines > p_report)
{
if (num_lines == 1)
MSG(_("1 line moved"));
else
smsg((char_u *)_("%ld lines moved"), num_lines);
}
smsg((char_u *)NGETTEXT("%ld line moved", "%ld lines moved", num_lines),
(long)num_lines);
/*
* Leave the cursor on the last of the moved lines.
@@ -5940,23 +5936,29 @@ do_sub_msg(
|| count_only)
&& messaging())
{
char *msg_single;
char *msg_plural;
if (got_int)
STRCPY(msg_buf, _("(Interrupted) "));
else
*msg_buf = NUL;
if (sub_nsubs == 1)
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
"%s", count_only ? _("1 match") : _("1 substitution"));
else
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
count_only ? _("%ld matches") : _("%ld substitutions"),
sub_nsubs);
if (sub_nlines == 1)
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
"%s", _(" on 1 line"));
else
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
_(" on %ld lines"), (long)sub_nlines);
msg_single = count_only
? NGETTEXT("%ld match on %ld line",
"%ld matches on %ld line", sub_nsubs)
: NGETTEXT("%ld substitution on %ld line",
"%ld substitutions on %ld line", sub_nsubs);
msg_plural = count_only
? NGETTEXT("%ld match on %ld lines",
"%ld matches on %ld lines", sub_nsubs)
: NGETTEXT("%ld substitution on %ld lines",
"%ld substitutions on %ld lines", sub_nsubs);
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
NGETTEXT(msg_single, msg_plural, sub_nlines),
sub_nsubs, (long)sub_nlines);
if (msg(msg_buf))
/* save message to display it after redraw */
set_keep_msg(msg_buf, 0);