]> granicus.if.org Git - vim/commitdiff
patch 9.0.0004: plural messages not translated properly v9.0.0004
authorMatvey Tarasov <matthewtarasov@yandex.ru>
Wed, 29 Jun 2022 12:18:27 +0000 (13:18 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 29 Jun 2022 12:18:27 +0000 (13:18 +0100)
Problem:    Plural messages not translated properly.
Solution:   Use ngettext() in a few more places. (Matvey Tarasov,
            closes #10606)

src/version.c
src/vim9execute.c

index 2faf3bdfcca5bc5a195dc4955e1d67f6d62de6a9..dd99f8575a53eade9835a77c3c5d69d7e24ada30 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4,
 /**/
     3,
 /**/
index 217a97797f8222e98fbc984050fa1a452996b45c..9dd5937e47cf34986ce3954f77cd76fc59433210 100644 (file)
@@ -478,20 +478,16 @@ call_dfunc(
     arg_to_add = ufunc->uf_args.ga_len - argcount;
     if (arg_to_add < 0)
     {
-       if (arg_to_add == -1)
-           emsg(_(e_one_argument_too_many));
-       else
-           semsg(_(e_nr_arguments_too_many), -arg_to_add);
+       semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many,
+                       -arg_to_add), -arg_to_add);
        return FAIL;
     }
     else if (arg_to_add > ufunc->uf_def_args.ga_len)
     {
        int missing = arg_to_add - ufunc->uf_def_args.ga_len;
 
-       if (missing == 1)
-           emsg(_(e_one_argument_too_few));
-       else
-           semsg(_(e_nr_arguments_too_few), missing);
+       semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few,
+                       missing), missing);
        return FAIL;
     }
 
@@ -5170,19 +5166,15 @@ call_def_function(
     idx = argc - ufunc->uf_args.ga_len;
     if (idx > 0 && ufunc->uf_va_name == NULL)
     {
-       if (idx == 1)
-           emsg(_(e_one_argument_too_many));
-       else
-           semsg(_(e_nr_arguments_too_many), idx);
+       semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many,
+                       idx), idx);
        goto failed_early;
     }
     idx = argc - ufunc->uf_args.ga_len + ufunc->uf_def_args.ga_len;
     if (idx < 0)
     {
-       if (idx == -1)
-           emsg(_(e_one_argument_too_few));
-       else
-           semsg(_(e_nr_arguments_too_few), -idx);
+       semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few,
+                       -idx), -idx);
        goto failed_early;
     }