0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.0004: plural messages not translated properly

Problem:    Plural messages not translated properly.
Solution:   Use ngettext() in a few more places. (Matvey Tarasov,
            closes #10606)
This commit is contained in:
Matvey Tarasov
2022-06-29 13:18:27 +01:00
committed by Bram Moolenaar
parent ee47eaceaa
commit d14bb1aef9
2 changed files with 10 additions and 16 deletions

View File

@@ -735,6 +735,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
4,
/**/ /**/
3, 3,
/**/ /**/

View File

@@ -478,20 +478,16 @@ call_dfunc(
arg_to_add = ufunc->uf_args.ga_len - argcount; arg_to_add = ufunc->uf_args.ga_len - argcount;
if (arg_to_add < 0) if (arg_to_add < 0)
{ {
if (arg_to_add == -1) semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many,
emsg(_(e_one_argument_too_many)); -arg_to_add), -arg_to_add);
else
semsg(_(e_nr_arguments_too_many), -arg_to_add);
return FAIL; return FAIL;
} }
else if (arg_to_add > ufunc->uf_def_args.ga_len) else if (arg_to_add > ufunc->uf_def_args.ga_len)
{ {
int missing = arg_to_add - ufunc->uf_def_args.ga_len; int missing = arg_to_add - ufunc->uf_def_args.ga_len;
if (missing == 1) semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few,
emsg(_(e_one_argument_too_few)); missing), missing);
else
semsg(_(e_nr_arguments_too_few), missing);
return FAIL; return FAIL;
} }
@@ -5170,19 +5166,15 @@ call_def_function(
idx = argc - ufunc->uf_args.ga_len; idx = argc - ufunc->uf_args.ga_len;
if (idx > 0 && ufunc->uf_va_name == NULL) if (idx > 0 && ufunc->uf_va_name == NULL)
{ {
if (idx == 1) semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many,
emsg(_(e_one_argument_too_many)); idx), idx);
else
semsg(_(e_nr_arguments_too_many), idx);
goto failed_early; goto failed_early;
} }
idx = argc - ufunc->uf_args.ga_len + ufunc->uf_def_args.ga_len; idx = argc - ufunc->uf_args.ga_len + ufunc->uf_def_args.ga_len;
if (idx < 0) if (idx < 0)
{ {
if (idx == -1) semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few,
emsg(_(e_one_argument_too_few)); -idx), -idx);
else
semsg(_(e_nr_arguments_too_few), -idx);
goto failed_early; goto failed_early;
} }